FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > Gentoo > Gentoo User

 
 
LinkBack Thread Tools
 
Old 01-21-2011, 02:09 AM
walt
 
Default Mounting the rootfs by UUID?

This is a followup to my grub2 thread, which got a bit too long for comfort.

I actually have grub2 installed and working properly, so it's very do-able.
But the main point (for me) was grub2's ability to find partitions by LABEL.

That is, if you know the LABEL of the boot partition, grub2 is guaranteed to
find and load the kernel from that partition, no matter how the BIOS juggles
and shuffles disk numbers as you plug and unplug USB drives.

That feature of grub2 is rilly kool, and all that, but the next problem is
how to tell your cleverly-located-and-booted kernel what partition to mount
as the root filesystem. That's where those dreaded kernel panics come from,
when the kernel can't find the device number that was hard-coded into it when
you compiled it.

The usual way to override that hard-wired device number is to give the kernel
the "root=/dev/xxxx" boot parameter in your grub menu.lst.

But, if you have some arbitrary number of USB disks plugged into your machine,
you have no way of knowing in advance what the correct /dev/xxxx is going to
be. Your BIOS is going to shuffle those device numbers around however it likes.

Sadly, there is no kernel boot parameter (yet) that will accept the LABEL of
the rootfs. But there is (maybe?) a kernel parameter that will accept the UUID
of the rootfs instead of /dev/xxxx or LABEL.

The problem is, I can't get it to work -- the kernel still panics when I give
it a UUID instead of /dev/xxxx.

(Note that I'm *not* referring to /etc/fstab, where you can easily use UUID, or
LABEL, or /dev/xxxx, as you please. But if the kernel can't find the partition
where /etc/fstab lives (the rootfs) the kernel can't read it, right?)

I've found references (even in the grub2 wiki) about passing root=UUID=<uuid>
on the kernel parameter line (instead of in /etc/fstab) but that doesn't work
for me.

If you read /usr/src/linux/init/do_mounts.c (for kernels >= 2.6.37) you will
see that the code is looking for the string "PARTUUID=" instead of "UUID=", so
I've tried that also. Kernel panic again.

Has anyone managed to use that UUID feature to tell the kernel where to find
the rootfs?

Beat me with the cluestick, please!
 
Old 01-21-2011, 10:59 AM
Nils Larsson
 
Default Mounting the rootfs by UUID?

On Friday 21 January 2011 04:09:12 walt wrote:
> Has anyone managed to use that UUID feature to tell the kernel where to
> find the rootfs?

You have to use a initramfs, see:
http://en.gentoo-wiki.com/wiki/Initramfs#UUID.2FLABEL_Root_Mounting
 
Old 01-21-2011, 12:04 PM
Daniel Pielmeier
 
Default Mounting the rootfs by UUID?

Nils Larsson <nisselarsson@home.se>:
> On Friday 21 January 2011 04:09:12 walt wrote:
>> Has anyone managed to use that UUID feature to tell the kernel where to
>> find the rootfs?
>
> You have to use a initramfs, see:
> http://en.gentoo-wiki.com/wiki/Initramfs#UUID.2FLABEL_Root_Mounting

Starting from kernel-2.6.37 [1,2] this is possible without an intramfs

[1] http://kernelnewbies.org/Linux_2_6_37#head-da4cb5f727d0f3b8fac1b23c097e15c3b49ff793
[2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b5af921ec02333e943efb59aca4 f56b78fc0e100

--
Daniel Pielmeier
 
Old 01-21-2011, 02:07 PM
walt
 
Default Mounting the rootfs by UUID?

On 01/21/2011 05:04 AM, Daniel Pielmeier wrote:

Nils Larsson<nisselarsson@home.se>:

On Friday 21 January 2011 04:09:12 walt wrote:

Has anyone managed to use that UUID feature to tell the kernel where to
find the rootfs?


You have to use a initramfs, see:
http://en.gentoo-wiki.com/wiki/Initramfs#UUID.2FLABEL_Root_Mounting


Starting from kernel-2.6.37 [1,2] this is possible without an intramfs

[1] http://kernelnewbies.org/Linux_2_6_37#head-da4cb5f727d0f3b8fac1b23c097e15c3b49ff793
[2] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commitdiff;h=b5af921ec02333e943efb59aca4 f56b78fc0e100


Yes, that's exactly the feature I'm unable to get working correctly.

After re-reading the commit message I now see that the UUID he refers
to is part of a GPT, *not* part of an MSDOS partition table <sigh>.
(I've been trying to use the uuid that appears in /dev/disk/by-uuid,
which is not at all the same thing.)

Thanks for posting the link -- it did give me the answer, but one I
didn't want to hear

Now I need to find out if I can use a GPT on this machine...
 

Thread Tools




All times are GMT. The time now is 10:30 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org