WTF Grub syntax "root=LABEL=/"

Austin Godber plug-devel@lists.PLUG.phoenix.az.us
Sat Nov 22 09:33:02 2003


Ext2 and Ext3 partitions can be refered to by their label rather than their 
partition device.  If you look in your /etc/fstab you might see a line like this:
LABEL=/boot      /boot         ext3    defaults        1 1
rather than one like this:
/dev/hda1        /boot         ext3    defaults        1 1

The label is just metadata associated with the partition that identifies what 
that partition is.  So, once you have labeled a partition you can always just 
refer to the label (in fstab, or grub or whatever support label where you would 
otherwise use a partition device).

If you look at the manpage for tune2fs or mke2fs you can read a bit about it. 
You can determine what a volumes lable is by typing:
    [root@monk sbin]# tune2fs -l /dev/hda1
    tune2fs 1.34 (25-Jul-2003)
    Filesystem volume name:   /boot
    ...

A partition without a label would be:
    [root@monk sbin]# tune2fs -l /dev/hdc1
    tune2fs 1.34 (25-Jul-2003)
    Filesystem volume name:   <none>
    ...

When in doubt you can always refer to the actual partition.  Oh, I am not sure 
if other fs have labels ... ?  But ext2 and 3 do.

Good luck
Austin

Ed Skinner wrote:
> I must be looking in all the wrong places for the answer...
> In my /boot/grub/grub.conf file, the kernel line is:
> 
> kernel /vmlinuz-2.4.22-skinner ro root=LABEL=/
> 
> But darned if I can find where the "root=LABEL=/" meaning is spelled out. "man 
> grub" sends me to "info grub" but it never mentions this particular form of 
> the command. It gives examples such as "root=/dev/hda1" but never a form with 
> two equals signs.
> 
> I presume this syntax means to look for the partition that is labelled as "/" 
> but, again, I must be looking in the wrong places -- how do I display and 
> then modify partition labels, if that's what's going on.
> 
> I'm playing with a 2.6.0-test9 kernel and the only way I can get it to try and 
> boot is to modify the corresponding line for that kernel from "root=LABEL=/" 
> to "root=/dev/hda1" (which is my "/" partition). I'm having other (possibly 
> unrelated) problems after that but, since this "problem" is so early in the 
> boot, I'm hoping it may account for some of the subsequent problems.
> 
> Interestingly, the grub.conf for my normal kernel (2.4.22-skinner) is the one 
> shown above and it works just fine with "root=LABEL=/".
> 
> WTF???
>