[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

grub: avoiding device references



Hi,

So I was concerned with avoiding the knowledge of *what* device is needed in grub commands.

Like 'root (hd2,2)' you have to know that what you want is on device '2'.

Or 'kernel root=/dev/sdc' you have to know that the root is on /dev/sdc.

I changed the latest Sid legacy grub 0.97-29, a bit funky, but it works:

To avoid specifying '(hd<drive no>,<partition no>)' do this:

find /ST380211.03                [1]
root FILE=/ST380211.03
(file ST380211.03 is in the root of the partition I am interested in booting.

To avoid specifying root=/dev/sdc do:

use the appropriate fs label command and say:

kernel root=LABEL=ST380211.03

and you never need to know what devices to use. Just make sure the file exists on the partition you want and the device you want is labeled correctly.

You can use those labels in fstab also so nowhere do you have to have device knowledge.

I tried [1] without the 'find' command and invoking the 'find' builtin with 'root', but that doesn't work. Grub legacy cannot quite do nesting of builtins apparently.

Hugo



Reply to: