grub inside and outside USB-Flash

Charlie Kravetz cjk at
Mon Feb 11 03:47:53 UTC 2008

On Sun, 2008-02-03 at 23:29 +0900, '2+ wrote:
> is there something i have to take into account
> if i want to boot ubuntu in my usb-flash from the grub in my hda?
> i forgot where but i read somewhere that i can install ubuntu to an usb-flash
> just like we do to an internal hdd
> so bought a 2GB flash and made it into sdb1(512M-vfat) and sdb2(1.5G-ext3)
> installed a tiny cui hardy to sdb2(without swap) and also a grub to MBR of sdb
> the menu.lst in the usb-flash says that the root is (hd1,1)
> but here
> it says
> "You might have noticed that the root line at the top of the menu.lst
> file says (hd0,0) even though we used (hd2,0) earlier. When you boot
> from the USB flash memory key, the key itself becomes hd0, even before
> the primary master hard drive. "
> so maybe i should edit it to (hd0,1)
> BUT my OptiplexGX150 doesn't have a BIOS
> that can select an USB-Flash for a boot device ;-D
> this is why i want to also boot it from the grub in my hda
> i simply copy&pasted the original lines in menu.lst of usb-flash to that of hda
> but this results into:
> selected disk does not exist
> editing it to (sd0,1) goes:
> error while parsing number
> (fd0,1) becomes:
> unrecognized dev string
> i found something like this:
> # to boot from a usb device
> title Boot USB drive
> root (hd1,0)
> chainloader +1
> boot
> but it didn't work
> i should simply
> grub-install /dev/hda
> ?
> don't want to create a boot-cd for this flash
> seems to be the different way but the won't be a custom CUI one ... right?
> if the BIOS doesn't do the USB-boot then grub from hda won't also boot
> the system in the flash neither?
> tia
> -- 
> '2+
If the BIOS sees the USB drive when the system is setting up, then you
should be able to determine the drive letters and add it to the Grub
menu on your hard drive to boot to the USB drive. Drives are numbers
starting at (hd0,0). If you have a single hard drive, the USB drive root
partition will be (hd1,1). That is the drive to add to Grub menu on the
hard drive to boot the USB drive. If the BIOS does not recognize the USB
drive on setup (my Dell Optiplex does not), then it does not matter, and
you can not boot to a USB drive anyway.

Grub does not care if the drives are labeled hda1, sda1, etc. It still
uses the same drive assignments of (hd0,0). If you have 2 internal hard
drives, use (hd2,1) for the USB drive root. I keep saying to use a ,1
because you partitions the USB drive with sdb1 and sdb2. You have to
boot to sdb2, which is the 2nd partition. For more information, see 
info grub

good luck,
Charlie Kravetz 
Linux Registered User Number 425914          []
Never let anyone steal your DREAM.           []

More information about the ubuntu-users mailing list