lkml.org 
[lkml]   [2010]   [Aug]   [26]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: Please add generic support for root=UUID= at kernel parameter command line (LABEL, BYID maybe also)
Hi Eric,

On 08/26/2010 11:32 AM, Eric Valette wrote:
> I found a solution myself using the grub embedded "search --fs-uuid". I do it once the linux boot partition and also on one partition of the external disk. If the search on the external disk report an error, I know root=/dev/sda1 else root=/dev/sdb1. But I really think this should be linux job!

Although this works now, there's no guarantee this will continue to work. What if you plug in an eSATA enclosure that has a port multiplier and two disks? I think you'll find your root device on /dev/sdc1. Or maybe someday a robust scheme for simultaneous probing will be adopted (for faster booting, presumably), and the order will vary from boot to boot.

> I also converted my /etc/fstab to LABEL=foo /foo syntax.

That's good.

> Now I'm really puzzled grub2 as a "search by fs uuid" command that linux is unable to deliver for the root device!

The key word here is "unable". The maintainers aren't *unable* to do this. They are *unwilling* to do this. I don't recall the precise discussion, but basically it boils down to the fact that early userspace (aka initramfs) can do this efficiently, and it needs to be supported in initramfs for other reasons, so it is pointless to duplicate this code in the kernel. I'm sure block folk will chime in if this isn't a fair representation (my apologies in advance if so).

Try dracut. Seriously. It's lean and mean just for this use-case, and you'll be protecting yourself against future changes in the block layer. And you can put root=LABEL=foo on your kernel command line to match your fstab.

Usage (from your kernel source dir):

$ make
$ make modules
# make modules_install
# make install
# dracut [-v] [-f] '' `make kernelrelease`

HTH,

Phil


\
 
 \ /
  Last update: 2010-08-26 21:55    [W:0.073 / U:0.416 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site