[ltp] A question about USB storage and ehci_hcd

Matt Graham linux-thinkpad@linux-thinkpad.org
Sat, 05 Jan 2008 09:43:08 -0700


From: Fredrik Wendt <fredrik@wendt.se>
> Matt Graham wrote:
> > [...] The thing to do is to mount =

> > removable disklike devices by label or by /dev/disk/by-uuid/
> I have three [systems] that boot from a USB memory stick. Is there a wa=
y
> to get GRUB working with that device addressing instead of /dev/sd*
> (hd*,*)?

No.  GRUB has to use real-mode BIOS functions to address disks for
obvious reasons, and can't use labels or UUIDs.  The calls GRUB has to
make go by number--first disk is 0x80, second disk is 0x81, etc.  And
the *BIOS* decides which disk is first.  This can lead to hassles.  The
BIOS might decide that SATA disk 0 is (hd2) when you boot from an IDE =

CD-R*, and might decide that it's (hd0) when you boot from the SATA disk.=

For USB devices, anything might happen.

> The current way works, but it's always a [hassle] to get it right when =
the
> system is set up

Installing a bootloader should be a one-time thing.  However, if you
always keep /boot in the same place (sda1, whatever) and keep it as
the same filesystem, then you should be able to dd the first 62 sectors
of /dev/sd? on a working disk to a file.  Then dd that file back to a
new disk.  This should bypass the second-guessing that GRUB does.