* Why ignore UUID when linux root device is an LV?
@ 2014-05-02 12:54 Sree Harsha Totakura
2014-05-02 14:23 ` Colin Watson
0 siblings, 1 reply; 3+ messages in thread
From: Sree Harsha Totakura @ 2014-05-02 12:54 UTC (permalink / raw)
To: grub-devel; +Cc: Colin Watson
Hi,
I would like to know why UUID is not used for root device in Linux
kernel's `root=' parameter when the root device uses LVM.
The following is a snippet from util/10_linux.in:
> if [ "x${GRUB_DEVICE_UUID}" = "x" ] || [ "x${GRUB_DISABLE_LINUX_UUID}" = "xtrue" ] \
> || ! test -e "/dev/disk/by-uuid/${GRUB_DEVICE_UUID}" \
> || uses_abstraction "${GRUB_DEVICE}" lvm; then
> LINUX_ROOT_DEVICE=${GRUB_DEVICE}
> else
> LINUX_ROOT_DEVICE=UUID=${GRUB_DEVICE_UUID}
> fi
I have a setup where my root device resides on an LV which is created
from an LUKS encrypted partition. The kernel's initramfs takes care of
opening the encrypted partition and exposing the logical volumes. So, I
believe the condition `uses_abstraction "${GRUB_DEVICE}" lvm' is not
required; or am I missing anything?
From the commit log:
> commit 507736c87c49712ac618169d17a659bd6c25eecc
> Author: Colin Watson <cjwatson@ubuntu.com>
> Date: Fri Jul 2 12:32:05 2010 +0100
>
> * util/grub-mkconfig_lib.in (uses_abstraction): New function.
> * util/grub.d/10_linux.in: Use it to check for LVM, so that
> LVM-on-RAID is handled correctly.
I see that this condition is added to address LVM/RAID configurations.
But, I guess it is similar to LVM/LUKS; is it not?
I tried booting my setup with root devices addressed by UUID and it
works. In fact, some initramfs errors about not being to able to find
volume group are no longer present. I guess these errors were apparent
when `root=/dev/mapper/vg0-root' parameter is used as the volume group
`vg0' is only visible after decrypting the LUKS partition. When the
root device is addressed by UUID, the initramfs does not lookout for
`vg0' before opening LUKS partition.
Regards,
Sree
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why ignore UUID when linux root device is an LV?
2014-05-02 12:54 Why ignore UUID when linux root device is an LV? Sree Harsha Totakura
@ 2014-05-02 14:23 ` Colin Watson
2014-06-02 15:33 ` Andrey Borzenkov
0 siblings, 1 reply; 3+ messages in thread
From: Colin Watson @ 2014-05-02 14:23 UTC (permalink / raw)
To: Sree Harsha Totakura; +Cc: grub-devel
On Fri, May 02, 2014 at 02:54:13PM +0200, Sree Harsha Totakura wrote:
> I would like to know why UUID is not used for root device in Linux
> kernel's `root=' parameter when the root device uses LVM.
Filesystem UUIDs on LVM aren't necessarily unique in the presence of
snapshots; and not all initramfses cope with root=UUID=* in any event,
for instance:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612402
Every time this breaks in GRUB and we end up using UUIDs on LVM again, I
get a slew of Debian bug reports until I figure it out and fix it.
The LVM device names themselves are sufficiently stable that there
should be no need to introduce additional layers of complexity by using
filesystem UUIDs. In general we only need them in cases where the
device names are not stable.
> >From the commit log:
> > commit 507736c87c49712ac618169d17a659bd6c25eecc
> > Author: Colin Watson <cjwatson@ubuntu.com>
> > Date: Fri Jul 2 12:32:05 2010 +0100
> >
> > * util/grub-mkconfig_lib.in (uses_abstraction): New function.
> > * util/grub.d/10_linux.in: Use it to check for LVM, so that
> > LVM-on-RAID is handled correctly.
>
> I see that this condition is added to address LVM/RAID configurations.
> But, I guess it is similar to LVM/LUKS; is it not?
I'm not sure, but perhaps GRUB_ENABLE_CRYPTODISK=y would help
grub-mkconfig notice this?
Regards,
--
Colin Watson [cjwatson@ubuntu.com]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Why ignore UUID when linux root device is an LV?
2014-05-02 14:23 ` Colin Watson
@ 2014-06-02 15:33 ` Andrey Borzenkov
0 siblings, 0 replies; 3+ messages in thread
From: Andrey Borzenkov @ 2014-06-02 15:33 UTC (permalink / raw)
To: The development of GNU GRUB; +Cc: Sree Harsha Totakura, cjwatson
В Fri, 2 May 2014 15:23:30 +0100
Colin Watson <cjwatson@ubuntu.com> пишет:
> On Fri, May 02, 2014 at 02:54:13PM +0200, Sree Harsha Totakura wrote:
> > I would like to know why UUID is not used for root device in Linux
> > kernel's `root=' parameter when the root device uses LVM.
>
> Filesystem UUIDs on LVM aren't necessarily unique in the presence of
> snapshots; and not all initramfses cope with root=UUID=* in any event,
> for instance:
>
> https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=612402
>
> Every time this breaks in GRUB and we end up using UUIDs on LVM again, I
> get a slew of Debian bug reports until I figure it out and fix it.
>
Note Debian Bug#747653 which results exactly from this behavior - btrfs
which spans multiple LVM volumes; grub hits LVM and does not use UUID
which results in passing multiple devices as root= argument.
> The LVM device names themselves are sufficiently stable that there
> should be no need to introduce additional layers of complexity by using
> filesystem UUIDs. In general we only need them in cases where the
> device names are not stable.
>
> > >From the commit log:
> > > commit 507736c87c49712ac618169d17a659bd6c25eecc
> > > Author: Colin Watson <cjwatson@ubuntu.com>
> > > Date: Fri Jul 2 12:32:05 2010 +0100
> > >
> > > * util/grub-mkconfig_lib.in (uses_abstraction): New function.
> > > * util/grub.d/10_linux.in: Use it to check for LVM, so that
> > > LVM-on-RAID is handled correctly.
> >
> > I see that this condition is added to address LVM/RAID configurations.
> > But, I guess it is similar to LVM/LUKS; is it not?
>
> I'm not sure, but perhaps GRUB_ENABLE_CRYPTODISK=y would help
> grub-mkconfig notice this?
>
> Regards,
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-06-02 15:33 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-05-02 12:54 Why ignore UUID when linux root device is an LV? Sree Harsha Totakura
2014-05-02 14:23 ` Colin Watson
2014-06-02 15:33 ` Andrey Borzenkov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).