[buug] Booting from a drive selected by LABEL or UUID

Ian Zimmerman itz at buug.org
Thu Feb 5 08:39:04 PST 2009

Hello friends.  We're about to ship some boxes; for as long as we tested
them, they had a flash card on /dev/hda, on which we put the kernel and
root filesystem, and a set of LSI MegaRaid SAS drives on /dev/sd[a-z],
which we use for our own nefarious purposes as raw devices.  Now, just
before the shipment it was decided the flash is too buggy and we need to
get rid of it, and boot from one of the SAS drives.  The trouble is
they're subject to unpredictable reordering, particularly if one of them
is physically replaced.  IOW, what is /dev/sda today may become /dev/sdb
tomorrow.  Is there _any_ way we can make GRUB (or another bootloader)
deal with this?  I know that once the kernel (and initrd) is loaded,
I can tell it where the root is with the root=LABEL=foo or root=UUID=foo
trick, my question is how to tell the bootloader where the kernel is.

I googled a lot yesterday and it seems like GRUB2 will be able to do this,
but there's no documentation :-(  I could live with an answer pointing me
to some real GRUB2 documentation.

Yet another headache is how to tell the BIOS which drive is bootable
(and not have to change that after every drive replacement operation),
but I'm taking it 1 step at a time.

Ian Zimmerman <itz at buug.org>
gpg public key: 1024D/C6FF61AD 
fingerprint: 66DC D68F 5C1B 4D71 2EE5  BD03 8A00 786C C6FF 61AD
Ham is for reading, not for eating.

More information about the buug mailing list