#568084 grub-common: Use of LABEL for 'root='

Package:
grub-common
Source:
grub2
Description:
GRand Unified Bootloader (common files)
Submitter:
nutzteil
Date:
2021-04-11 04:33:27 UTC
Severity:
wishlist
Tags:
#568084#5
Date:
2010-02-02 10:47:22 UTC
From:
To:

Patch for /etc/grub.d/10_linux,
so you can use LABEL beside UUID and devices.

Activation in /etc/default/grub with:
GRUB_DISABLE_LINUX_UUID=true
GRUB_ENABLE_LINUX_LABEL=true

Thanks
christian

#568084#10
Date:
2010-08-26 15:59:12 UTC
From:
To:
(Now there is grub-pc 1.98+20100804-2 in squeeze.) Corrected Version of my previous try: --------------------------------------------------------------------------------- --- 10_linux 2010-07-12 13:10:04.000000000 +0200 +++ 10_linux_+label 2010-08-18 09:17:33.816200799 +0200 @@ -49,6 +49,12 @@ LINUX_ROOT_DEVICE=${GRUB_DEVICE} else LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID} + GRUB_DEVICE_LABEL="$(blkid -l -t UUID=${GRUB_DEVICE_UUID} -s LABEL -o value)" + . /etc/default/grub + if [ "x${GRUB_ENABLE_LINUX_LABEL}" = "xtrue" ] \ + && test -e "/dev/disk/by-label/${GRUB_DEVICE_LABEL}" ; then + LINUX_ROOT_DEVICE=LABEL=${GRUB_DEVICE_LABEL} + fi fi linux_entry () --------------------------------------------------------------------------------- - it moved after the setting of LINUX_ROOT_DEVICE=UUID=...., the previous was not correct. - it sources /etc/default/grub for reading the Value of my Variable GRUB_ENABLE_LINUX_LABEL, because that is no Variable in /usr/sbin/update-grub (maybe it will be?). Also 20_linux_xen can be patched with this.
#568084#15
Date:
2010-08-26 16:25:25 UTC
From:
To:
(onesmore because Provider-Webmailer destroyed the format)
---------------------------------------------------------------------------------
--- 10_linux	2010-07-12 13:10:04.000000000 +0200
+++ 10_linux_+label	2010-08-18 09:17:33.816200799 +0200
@@ -49,6 +49,12 @@
 LINUX_ROOT_DEVICE=${GRUB_DEVICE}
 else
 LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
+  GRUB_DEVICE_LABEL="$(blkid -l -t UUID=${GRUB_DEVICE_UUID} -s LABEL -o value)"
+  . /etc/default/grub
+    if [ "x${GRUB_ENABLE_LINUX_LABEL}" = "xtrue" ] \
+    && test -e "/dev/disk/by-label/${GRUB_DEVICE_LABEL}" ; then
+      LINUX_ROOT_DEVICE=LABEL=${GRUB_DEVICE_LABEL}
+    fi
 fi

 linux_entry ()
---------------------------------------------------------------------------------
 - it moved after the setting of LINUX_ROOT_DEVICE=UUID=...., the previous was not correct.
 - it sources /etc/default/grub for reading the Value of my Variable GRUB_ENABLE_LINUX_LABEL,
 because that is no Variable in /usr/sbin/update-grub (maybe it will be?).

Also 20_linux_xen can be patched with this.


Activation in /etc/default/grub with:
#GRUB_DISABLE_LINUX_UUID=true (not disable the LINUX_UUID!)
GRUB_ENABLE_LINUX_LABEL=true

#568084#20
Date:
2012-08-13 15:04:03 UTC
From:
To:
Thanks for the patch, it worked beautifully! Let's hope it gets included in the package.

Best regards
Torquil Sørensen

#568084#25
Date:
2013-10-11 15:11:24 UTC
From:
To:
Is there a way to raise the priority of this patch from wishlist?

I think it's a major usability bug likely to lead to an unbootable
system if you happen to think ahead enough to use LABEL= in your
/etc/fstab

UUID's are great (if hidden) for most users, but my experience is
it's a lot easier and less prone to error to recover something at
3am when you remember the label of the root filesystem you want.

There's no way I'm going to ever remember, or even accurately
write down the UUID.

#568084#30
Date:
2017-01-06 05:36:12 UTC
From:
To:
Dear Customer,

Your item has arrived at January 03, but our courier was not able to deliver the parcel.

Postal label is enclosed to this e-mail. Please check the attachment!

Your help is greatly appreciated,
Nicholas Hooper,
USPS Mail Delivery Manager.

#568084#35
Date:
2019-10-03 13:14:41 UTC
From:
To:
Hi, I also think that this thing is really useful and needed.

Is there someone that can update/complete/improve the patch and forward
also upstream please?

#568084#40
Date:
2021-04-11 04:26:38 UTC
From:
To:
Dear Maintainer,

Might I ask this to be fixed, please?
It's much more easy to use labels than tinkering around with UUID, which
is both error-prone and, in some cases, when using mirrors of the same
disk, problematic.

Thanks.

Best regards,

Dario Susman