Debian Bug report logs - #614143
os-prober: generated linux entries don't use UUIDs for root= parameter

version graph

Package: os-prober; Maintainer for os-prober is Debian Install System Team <[email protected]>; Source for os-prober is src:os-prober (PTS, buildd, popcon).

Reported by: Matthias Berndt <[email protected]>

Date: Sat, 19 Feb 2011 22:39:08 UTC

Severity: normal

Tags: bookworm, bullseye, buster, jessie, patch, sid, stretch, trixie

Found in versions os-prober/1.44, 1.49ubuntu1

Reply or subscribe to this bug.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to [email protected], Debian Install System Team <[email protected]>:
Bug#614143; Package os-prober. (Sat, 19 Feb 2011 22:39:10 GMT) (full text, mbox, link).


Acknowledgement sent to Matthias Berndt <[email protected]>:
New Bug report received and forwarded. Copy sent to Debian Install System Team <[email protected]>. (Sat, 19 Feb 2011 22:39:11 GMT) (full text, mbox, link).


Message #5 received at [email protected] (full text, mbox, reply):

From: Matthias Berndt <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: os-prober: generated linux entries don't use UUIDs for root= parameter
Date: Sat, 19 Feb 2011 23:36:00 +0100
Package: os-prober
Version: 1.44
Severity: normal
Tags: sid patch

Hi,

As you probably know, os-prober is used by grub-mkconfig to generate grub.cfg
entries for other operating systems. Today I ran update-grub in order for it to
pick up the Fedora 14 Kernel I had installed today. The command line it
generated looked like this:
linux /boot/vmlinuz-2.6.35.6-45.fc14.x86_64 root=/dev/sdb3
But with the Fedora kernel the relevant device isn't called /dev/sdb3 but
/dev/sda3, so this command line doesn't work, and I guess UUIDs should be used
instead. The following change to /usr/share/os-prober/common.sh did the trick
for me: replace

mapdevfs () {
    readlink -f "$1"
}

with

mapdevfs() {
    echo "/dev/disk/by-uuid/$(blkid -o value -s UUID "$1")"
}

Perhaps this can be applied upstream?




Information forwarded to [email protected], Debian Install System Team <[email protected]>:
Bug#614143; Package os-prober. (Tue, 08 Mar 2011 22:03:03 GMT) (full text, mbox, link).


Acknowledgement sent to Colin Watson <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <[email protected]>. (Tue, 08 Mar 2011 22:03:03 GMT) (full text, mbox, link).


Message #10 received at [email protected] (full text, mbox, reply):

From: Colin Watson <[email protected]>
To: Matthias Berndt <[email protected]>
Cc: [email protected]
Subject: Re: os-prober: generated linux entries don't use UUIDs for root= parameter
Date: Tue, 8 Mar 2011 21:58:52 +0000
On Sat, Feb 19, 2011 at 11:36:00PM +0100, Matthias Berndt wrote:
> As you probably know, os-prober is used by grub-mkconfig to generate grub.cfg
> entries for other operating systems. Today I ran update-grub in order for it to
> pick up the Fedora 14 Kernel I had installed today. The command line it
> generated looked like this:
> linux /boot/vmlinuz-2.6.35.6-45.fc14.x86_64 root=/dev/sdb3
> But with the Fedora kernel the relevant device isn't called /dev/sdb3 but
> /dev/sda3, so this command line doesn't work, and I guess UUIDs should be used
> instead. The following change to /usr/share/os-prober/common.sh did the trick
> for me: replace
> 
> mapdevfs () {
>     readlink -f "$1"
> }
> 
> with
> 
> mapdevfs() {
>     echo "/dev/disk/by-uuid/$(blkid -o value -s UUID "$1")"
> }
> 
> Perhaps this can be applied upstream?

I don't think this is generally safe.  It relies on the kernel in
question coming with an initramfs with suitable UUID support; os-prober
can't reliably know this.

os-prober presumably picked this kernel up from some other boot loader's
configuration file - perhaps /boot/grub/grub.conf in your Fedora system.
Could you please attach that file?

Thanks,

-- 
Colin Watson                                       [[email protected]]




Information forwarded to [email protected], Debian Install System Team <[email protected]>:
Bug#614143; Package os-prober. (Wed, 09 Mar 2011 15:21:05 GMT) (full text, mbox, link).


Acknowledgement sent to Matthias Berndt <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <[email protected]>. (Wed, 09 Mar 2011 15:21:05 GMT) (full text, mbox, link).


Message #15 received at [email protected] (full text, mbox, reply):

From: Matthias Berndt <[email protected]>
To: Colin Watson <[email protected]>
Cc: [email protected]
Subject: Re: os-prober: generated linux entries don't use UUIDs for root= parameter
Date: Wed, 9 Mar 2011 16:17:50 +0100
Hi Colin, 

thank you for your response. 

> I don't think this is generally safe.
Well, on the other hand, the current assumption that the device files are 
named the same on debian and fedora doesn't seem to be safe either. 

> It relies on the kernel in
> question coming with an initramfs with suitable UUID support;
Perhaps it would be possible to introduce a blacklist for distros that 
don't support UUIDs? I don't think there are that many. 

> os-prober presumably picked this kernel up from some other boot loader's
> configuration file - perhaps /boot/grub/grub.conf in your Fedora system.
I didn't install the boot loader when I installed Fedora, so this isn't the 
case.

Regards
Matthias




Information forwarded to [email protected], Debian Install System Team <[email protected]>:
Bug#614143; Package os-prober. (Tue, 13 Dec 2011 22:03:04 GMT) (full text, mbox, link).


Acknowledgement sent to Marcin Konarski <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <[email protected]>. (Tue, 13 Dec 2011 22:03:04 GMT) (full text, mbox, link).


Message #20 received at [email protected] (full text, mbox, reply):

From: Marcin Konarski <[email protected]>
To: Debian Bug Tracking System <[email protected]>
Subject: Re: os-prober: generated linux entries don't use UUIDs for root= parameter
Date: Tue, 13 Dec 2011 22:59:49 +0100
Package: os-prober
Version: 1.49ubuntu1
Followup-For: Bug #614143

Dear Maintainer,
Issuing update-grub command sometimes creates menu entries
for coexisting linux installations with 
root=/dev/sdaX parameter at "linux" line.

My CentOS likes to name my drive at random "sda" or "sdb"
so entry mentioned above likes to cause CentOS boot to fail.

-------

I fixed my problem locally by applying following patch to:
/usr/lib/linux-boot-probes/mounted/90fallback.

#v+
--- linux-boot-probes/mounted/common/90fallback	2011-09-16 14:29:55.000000000 +0200
+++ /usr/lib/linux-boot-probes/mounted/90fallback	2011-12-13 18:55:53.000000000 +0100
@@ -2,6 +2,10 @@
 # Fallback in case nothing else works. Look for vmlinu[xz] file in root and
 # /boot, see if there is a matching initrd, and wing it.
 . /usr/share/os-prober/common.sh
+if [ -f /etc/default/grub ] ; then
+	. /etc/default/grub
+fi
+
 set -e
 
 partition="$1"
@@ -11,6 +15,10 @@
 
 mappedpartition=$(mapdevfs "$partition" 2>/dev/null) || mappedpartition="$partition"
 
+if [ "x${GRUB_OSPROBER_FALLBACK_USE_UUID}" = "xtrue" ] ; then
+	mappedpartition=$(blkid -s UUID -o export ${partition})
+fi
+
 exitcode=1
 for kernpat in /vmlinuz /vmlinux /boot/vmlinuz /boot/vmlinux "/boot/vmlinuz*" \
 	        "/boot/vmlinux*" "/vmlinuz*" "/vmlinux*" "/kernel-*" "/boot/kernel-*"; do
#v-

and added:

#v+

# Uncomment to use UUID for root= option on kernel line
# for coexisting linux installations for last resort configuration attempt.
GRUB_OSPROBER_FALLBACK_USE_UUID=true

#v-

to /etc/default/grub.

After I rerun update-grub required entries were in place, i.e.
CentOS menu entry had root=UUID=xxxxx-xxxx-xxxxx-xxxxx parameter at "linux" line.

-- System Information:
Debian Release: wheezy/sid
  APT prefers precise-updates
  APT policy: (500, 'precise-updates'), (500, 'precise')
Architecture: amd64 (x86_64)

Kernel: Linux 2.6.39-3-generic (SMP w/2 CPU cores)
Locale: LANG=C, LC_CTYPE=pl_PL (charmap=ISO-8859-2)
Shell: /bin/sh linked to /bin/dash

Versions of packages os-prober depends on:
ii  libc6  2.13-20ubuntu10

os-prober recommends no packages.

os-prober suggests no packages.

-- no debconf information


-- 
  Huginn
GCS d? s: a C++$() UBLS++++$ P++ L++++$ E---
W+(-) N++ w-- O M- V- PS+ PE++ Y PGP-
t--- 5-- X- R !tv b++ DI+++ D+ G e* h r++ y**




Added tag(s) jessie. Request was from Julien Cristau <[email protected]> to [email protected]. (Thu, 18 Apr 2013 17:43:46 GMT) (full text, mbox, link).


Added tag(s) stretch. Request was from Ivo De Decker <[email protected]> to [email protected]. (Tue, 28 Apr 2015 17:11:14 GMT) (full text, mbox, link).


Added tag(s) buster. Request was from [email protected] to [email protected]. (Sun, 18 Jun 2017 09:52:07 GMT) (full text, mbox, link).


Added tag(s) bullseye. Request was from [email protected] to [email protected]. (Mon, 08 Jul 2019 08:28:16 GMT) (full text, mbox, link).


Added tag(s) bookworm. Request was from Sebastian Ramacher <[email protected]> to [email protected]. (Mon, 16 Aug 2021 07:03:26 GMT) (full text, mbox, link).


Added tag(s) trixie. Request was from Sebastian Ramacher <[email protected]> to [email protected]. (Sun, 11 Jun 2023 15:39:31 GMT) (full text, mbox, link).


Information forwarded to [email protected], Debian Install System Team <[email protected]>:
Bug#614143; Package os-prober. (Sat, 26 Jul 2025 16:45:02 GMT) (full text, mbox, link).


Acknowledgement sent to Casey Connor <[email protected]>:
Extra info received and forwarded to list. Copy sent to Debian Install System Team <[email protected]>. (Sat, 26 Jul 2025 16:45:02 GMT) (full text, mbox, link).


Message #37 received at [email protected] (full text, mbox, reply):

From: Casey Connor <[email protected]>
To: [email protected]
Subject: Re: os-prober: generated linux entries don't use UUIDs for root= parameter
Date: Sat, 26 Jul 2025 09:36:12 -0700
[Message part 1 (text/plain, inline)]
Old bug; per suggestion from this thread: 
https://forums.debian.net/viewtopic.php?p=825776 I am adding:

I did a fresh install of Debian 12 which is my main daily driver desktop 
environment. I installed a headless Debain 12 (from same installer .iso) 
to a seperate partition but did not have it run update-grub on the install.

I then reboot to my main install, update-grub to pick up the new 
install, reboot and try to boot to the headless install but the grub.cfg 
uses /dev/sdX instead of the UUID, so it can't boot (because dev names 
are different.)

I tried the patch suggested 2011-12-13 by Marcin but it seemed to 
corrupt my grub.cfg (not surprising, given the age and that it was 
perhaps for CentOS).

My hack solution was to change /etc/grub.d/30_os-prober line 248 to be:

|linux ${LKERNEL} root=UUID=${boot_device_id}|

...which I assume is a Bad Idea for some reason, but I don't know 
anything about this stuff. Just wanted to report that this is still an 
issue.

[Message part 2 (text/html, inline)]

Send a report that this bug log contains spam.


Debian bug tracking system administrator <[email protected]>. Last modified: Sun Jul 27 09:06:23 2025; Machine Name: buxtehude

Debian Bug tracking system

Debbugs is free software and licensed under the terms of the GNU General Public License version 2. The current version can be obtained from https://bugs.debian.org/debbugs-source/.

Copyright © 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson, 2005-2017 Don Armstrong, and many other contributors.