LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - General (https://www.linuxquestions.org/questions/linux-general-1/)
-   -   How do you make a usb drive bootable? (https://www.linuxquestions.org/questions/linux-general-1/how-do-you-make-a-usb-drive-bootable-564245/)

comcastuser 06-24-2007 09: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 09:35 PM

change your BIOS to boot off of it

comcastuser 06-24-2007 09:37 PM

Quote:

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-24-2007 11:27 PM

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:
Code:

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

...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 02: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/device.map 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
Code:

grub
root (hd0,0)
setup (hd0)
quit
reboot

Your Linux should now boot


All times are GMT -5. The time now is 06:46 PM.