-   Linux - General (
-   -   How do you make a usb drive bootable? (

comcastuser 06-24-2007 10:21 PM

How do you make a usb drive bootable?
I have an 80gb usb drive with 1.8gb swap on partition 2 and the rest is ext3 on partition 1.

I just copied an existing and working Linux filesystem over to this partition and used gparted to mark partition 1 as a boot partition.

Is there something I need to do with grub? I've read the readmes and manuals, but I'm hopelessly lost trying to interpret this as far as making a usb drive boot right to the linux kernel within (and I don't want to mess with the host computer's boot sector).

Any advice? Thanks!

AceofSpades19 06-24-2007 10:35 PM

change your BIOS to boot off of it

comcastuser 06-24-2007 10:37 PM


Originally Posted by AceofSpades19
change your BIOS to boot off of it

I already did that.

But how do I use grub to make it actually boot into Linux?

Do I need to do something with the menu.lst file?

lakris 06-25-2007 12:27 AM

It depends on several things.
When You say copy, how did You copy? dd, rsync, cp?
It isn't too much messing with boot system on the original. An easy way would be to just add an entry to the end of Your existing boot loaders /boot/grub/menu.lst file, You can try something like this:

title          My Old Linux
root            (hd2,0)
kernel          /boot/your-vmlinuz-name root=/dev/sdc1 ro quiet splash
initrd          /boot/your-initrd.img-name

...and reboot. You wont lose Your old settings. You need to change the (hd2,0) and /dev/sdc1 to what You actually have and the filenames. (hd2,0) means Your third harddisks first partition. Check /var/log/syslog or /var/log/messages for info on what drives You have.

saikee 06-25-2007 03:19 AM

You must do the following to boot a distro, originally installed in another disk, in the 1st partition of an external hard disk

(1) Edit menu.lst so that (a) the partition and disk numbers correspond to the USB disk position and this should be (hd0,0) and (b) amend the "kernel" statement with the parameter "root=" corresponding to the new partition reference. For example the 1st partition of a bootable USB disk would be sda1 but your Linux may be installed in device hda3. The change should therefore from root=/dev/hda3 to root=/dev/sda1.

(2) Do the same as Item 1b for /etc/fstab

(3) Edit /boot/grub/ to reflect the (hd0) is now sda

(4) Restore the boot loader. Say boot up by a Live CD and activate a Grub shell in root console the command would be

root (hd0,0)
setup (hd0)

Your Linux should now boot

All times are GMT -5. The time now is 04:33 AM.