Posted by sebas on Mon 9 Oct 2006 at 12:49
Here is a very short (but in my opinion very useful) how-to for creating an USB boot device, which enables you to boot Debian from your memory stick.
We are assuming that your USB device is indicated by /dev/sda, and that you are interested in Debian stable (other distributions are untested, but should work).
First unmount your memory stick.
sudo umount /dev/sda
Now download the boot.img.gz, which is necessary to make your USB device bootable:
cd ~ wget ftp://ftp.debian.org/debian/dists/stable/main/installer-i386/current/images/hd-media/boot.img.gz
Extract this image and write it to your USB device:
sudo zcat ~/boot.img.gz > /dev/sda
Now mount the volume to /mnt:
sudo mount /dev/sda /mnt
In this case a Debian Stable net-install image is used. You may also use a business card iso. Nevertheless, you should be sure to use the same version of the ISO-image as the image.tar.gz that was used before.
Download the ISO to the USB device:
cd /mnt/ sudo wget http://cdimage.debian.org/debian-cd/3.1_r3/i386/iso-cd/debian-31r3-i386-netinst.iso
Now you can unmount the volume:
cd ~ sudo umount /dev/sda
You can remove the USB device, and plug it in your new system. Of course you should tell your BIOS to boot from USB.
There is a copy of this how-to on the website of our company VirtualConcepts
[ Parent ]
zcat ~/boot.img.gz | sudo tee /dev/sda > /dev/nullIn general, this also has the advantage of not running the command generating the output as root.
[ Parent ]
Nice write-up, yo.
Depending on the contents of your /etc/fstab, the mount command might need to look something like this: mount -t msdos /dev/sda /mnt
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
[ Parent ]
# dmesg [1635627.664036] usb 1-2: new high speed USB device using ehci_hcd and address 3 [1635627.796968] usb 1-2: New USB device found, idVendor=0781, idProduct=556b [1635627.796974] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3 [1635627.796979] usb 1-2: Product: Cruzer Edge [1635627.796982] usb 1-2: Manufacturer: SanDisk [1635627.796985] usb 1-2: SerialNumber: 200517389209D132C49B [1635627.797983] usb 1-2: configuration #1 chosen from 1 choice [1635627.798823] scsi5 : SCSI emulation for USB Mass Storage devices [1635627.799272] usb-storage: device found at 3 [1635627.799275] usb-storage: waiting for device to settle before scanning [1635632.796270] usb-storage: device scan complete [1635632.797002] scsi 5:0:0:0: Direct-Access SanDisk Cruzer Edge 1.01 PQ: 0 ANSI: 2 [1635632.799874] sd 5:0:0:0: [sdb] 7821312 512-byte logical blocks: (4.00 GB/3.72 GiB) [1635632.801369] sd 5:0:0:0: [sdb] Write Protect is off [1635632.801375] sd 5:0:0:0: [sdb] Mode Sense: 03 00 00 00 [1635632.801379] sd 5:0:0:0: [sdb] Assuming drive cache: write through [1635632.803965] sd 5:0:0:0: [sdb] Assuming drive cache: write through [1635632.803999] sdb: sdb1 [1635632.809841] sd 5:0:0:0: [sdb] Assuming drive cache: write through [1635632.809876] sd 5:0:0:0: [sdb] Attached SCSI removable diskso device is /dev/sdb here and it holds one partition (/dev/sdb1) in this case
[ Parent ]
[ Parent ]
Will only work if your user has write access to /dev/sda. You probably want to do
sudo sh -c 'zcat ~/boot.img.gz > /dev/sda'
[ Parent ]