Monday, July 26, 2010

F8: How to install Live images on a USB drive

You decided to test Fedora 9-beta but you don't want to install it yet on your disk. A good solution is to install the live version of Fedora 9-beta on your usb stick and then boot on it.
But how to install an iso image on a usb drive?

Well, insert your usb drive and check on which device your usb drive is mounted.

# mount
/dev/sdb1 on /media/disk type vfat (rw,nosuid,nodev,uhelper=hal,shortname=lower,uid=501)

Then check that you have the necessary tools installed on your pc.

# rpm -q livecd-tools

If not, install them as root:

yum install livecd-tools

Then run live-iso-to-disk as root:

# livecd-iso-to-disk Fedora-9-Beta-Live-i686.iso /dev/sdb1
Verifying image...
Fedora-9-Beta-Live-i686.iso: 1df4a4bc641220fa44cfd5d252dadb16
Fragment sums: 74221c82498ad77168fb66d935bd358ba8ca1727cbf3b5bf55259ff692c6
Fragment count: 20
Percent complete: 100.0% Fragment[20/20] -> OK
The media check is complete, the result is: PASS.

It is OK to use this media.
Copying live image to USB stick
Updating boot config file
Installing boot loader
USB stick set up as live image!

Note that your usb drive has to be bootable:

# fdisk -l /dev/sdb
Disk /dev/sdb: 1031 MB, 1031798272 bytes
255 heads, 63 sectors/track, 125 cylinders
Units = cylinders of 16065 * 512 = 8225280 bytes
Disk identifier: 0x91f72d24

Device Boot Start End Blocks Id System
/dev/sdb1 * 1 126 1007584 6 FAT16
Partition 1 has different physical/logical endings:
phys=(124, 254, 63) logical=(125, 112, 50)

Leave your usb drive and reboot your pc on it.