Linux, musical road-dogging, and daily life by Paul W. Frields
Careful with that axe, Eugene.

Careful with that axe, Eugene.

I think everyone can agree that when one gives Fedora help to someone, one should give the right answer. There’s been a little confusion over in #fedora about making bootable Live USB keys.

In the old days, you used to be able to use a command like this to make a minimal, bootable USB:

dd if=bootdisk.img of=/dev/sdX

But the bootdisk.img file was a bitstream image of a bootable disk (in the hard disk/floppy diskette sense), not a CD. An ISO file, which is a bitstream image of a CD/DVD, has a very different structure from a disk image — whether the ISO is bootable or not. So the following command won’t work for making a bootable USB key from an ISO:

dd if=image.iso of=/dev/sdX

There are several requirements for booting from a USB key. One is that your system’s BIOS has to support USB booting. Another is that the USB key hardware has to be responsive to that feature — not a foregone conclusion, unfortunately. Certain system BIOS implementations don’t seem to respect some USB storage devices.

It’s a hardware problem that we can’t solve with the operating system, and it’s unfortunate. But at least you can test this sort of behavior before you buy a unit, hopefully. And if you like the computer system enough, you can always switch USB keys, since they’re a lot cheaper if you buy several different models! ?

On x86 and x86_64 platforms (I don’t know much about ppc), the BIOS reads the first sector, or 512 bytes, on the boot device, and executes some code there. In some cases, like hard disks, that means reading a partition table and possibly moving to a different location to continue booting; in others, it means executing boot code found there. (This is where the first bit of the GRUB boot loader is found, for example.)

ISO images, however, don’t have any of this information in their first 512 bytes. So if you simply write out the ISO image onto a disk device, it won’t boot. Your BIOS might throw you an error, or you may simply not be allowed to boot from that device at all.

Which brings me to the two ways that do work for making a bootable USB from our Live images: the livecd-iso-to-disk program (part of the livecd-tools package in Fedora) and the Windows program LiveUSB Creator. These programs set up your USB key with a real boot sector that allows your BIOS to find the next bit of code it needs to continue booting.

One problem I see is there’s some ground not covered in those two solutions alone. How does a user of another Linux distribution, who doesn’t either dual boot Windows, or have a CD/DVD drive available, make a Live USB key? Granted, this will be a fairly restricted subset. I know there are other distributions that carry the livecd-tools package. Our documentation should reflect how to use it on those distributions. If you run one of them, and can write a quick series of steps, the Docs team can beat it into stylistic shape!

One comment

Comments are closed.

%d bloggers like this: