Tuesday, April 22, 2008

Creating a Boot USB Key

You can create images on a USB key with the dd command from any running UNIX or Linux computer. Find a USB key, save anything important that you've stored onto it, and insert it into your system. Run the fdisk -l command to find the device associated with the USB key. Assuming it's /dev/sdc, run the following commands:

# dd if=/media/disk/images/diskboot.img of=/dev/sdc

Be careful -- if /dev/sdc is a hardrive with data, these commands will overwrite all data on that drive.

Alternatively, you can just run the cat command to read the disk image of your choice directly to a floppy drive or USB device. For example, the following command reads the laptop driver disk directly to the USB key:

# cat /media/disk/images/diskboot.img > /dev/sdc

You can also create a boot CD from the boot.iso file in the images/ subdirectory. Assuming you don't have two CD/DVD drivers, you'll first have to copy the boot.iso file to a directory such as /tmp. You can then burn the boot CD using the following command:

# cdrecord dev=/dev/hdc -v -eject /tmp/boot.iso

Naturally, this command may vary; for example, a system with a SATA-based drive may require that you substitute the appropriate device name, such as dev=/dev/scd0.

0 comments: