#980782 os-prober: linux-boot-prober returning "root=/dev/dm-X" line instead of expected "root=UUID=[UUID128]

Package:
os-prober
Source:
os-prober
Description:
utility to detect other OSes on a set of drives
Submitter:
Mirko Vogt
Date:
2021-01-22 05:51:03 UTC
Severity:
normal
#980782#5
Date:
2021-01-22 04:02:42 UTC
From:
To:
Version: 1.77

Severity: important



I noticed when running update-grub on Debian stable and testing, that

the resulting grub.cfg has lines as part of menuentres like:



"linux [..] root=/dev/dm-X"



for found linux installations on other block devices - in my case
residing on LVs - ,instead of "root=UUID=[XXX]", which I'd have expected
(and would favour).

This is due to `linux-boot-prober` calling `mapdevfs` defined in

"/usr/share/os-prober/common.sh".

`mapdevfs` does a simple `readlink` on the path given.

The other lines within the menuentry look fine, e.g.:

"set root='lvmid/XXXXXX/YYYYYY'"

or

"search [..] --set=root [UUID]"



GRUB_DISABLE_LINUX_UUID is undefined.


Is this intentional and if so, why?

#980782#10
Date:
2021-01-22 04:19:18 UTC
From:
To:
Just adding, this isn't only a feature request but results in
non-bootable systems.
If one of the os-probe'd systems e.g. is also a Debian, it will drop
into an initramfs due to not finding the root device.
This is due to - within the initramfs - the VGs as part of the the LVM
system only get activated by certain naming schemes
("/usr/share/initramfs-tools/scripts/local-top/lvm2").
It tries ti figure out whether the rootfs resides on a LVM and if it
thinks it doesn't, the respective VG won't be activated, resulting in
the passed /dev/dm-X block device not being available.

#980782#15
Date:
2021-01-22 04:38:15 UTC
From:
To:

#980782#20
Date:
2021-01-22 05:46:37 UTC
From:
To:
Mirko Vogt <bugs-debian@nanl.de> writes:

The first thing that comes to mind is:

For a given UUID
  run blkid, and exclude all lines that do not match the UUID
  count lines and error if there are duplicates
    (it probably already does this, and I think the risk of collisions
     most significant for short UUIDs like FAT has)
  as part of that regex, check for ^/dev/mapper, with that anchor
  use /dev/mapper/X for the truly unique UUID


Cheers,
Nicholas