Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 939361 - sys-boot/grub[-device-mapper] fails to detect LUKS root
Summary: sys-boot/grub[-device-mapper] fails to detect LUKS root
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal enhancement
Assignee: Mike Gilbert
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2024-09-09 07:30 UTC by konsolebox
Modified: 2024-09-12 18:26 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description konsolebox 2024-09-09 07:30:40 UTC
grub-probe fails a lot so it might be a good idea to have an already-available config line that can easily be enabled by users.

--- grub.default-4	2024-09-09 15:21:34.127342089 +0800
+++ grub.default-5	2024-09-09 15:20:39.849340895 +0800
@@ -1,4 +1,4 @@
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2024 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 #
 # To populate all changes in this file you need to regenerate your
@@ -74,3 +74,7 @@
 # This is useful, for example, to allow users who can't see the screen
 # to know when they can make a choice on the menu.
 #GRUB_INIT_TUNE="60 800 1"
+
+# Uncomment to enable detection of root device's UUID using findmnt when
+# grub-probe doesn't find it.
+#GRUB_DEVICE_UUID=${GRUB_DEVICE_UUID:-$(findmnt / -no UUID)}

It can help people having issues like https://forums.gentoo.org/viewtopic-t-1170736-start-0.html fix the problem by themselves.


Reproducible: Sometimes

Steps to Reproduce:
# grub-probe --device /dev/mapper/root --target=fs_uuid
grub-probe: error: disk `lvm/root' not found.
Comment 1 Mike Gilbert gentoo-dev 2024-09-09 20:10:06 UTC
This is a pretty kludgy workaround. I don't want to officially document it.

Instead, you should figure out why grub-probe fails.
Comment 2 konsolebox 2024-09-09 20:47:27 UTC
grub-probe.c simply looks outdated and broken.  Not worth fixing.

Anyway I'll just keep this solution to myself.
Comment 3 Mike Gilbert gentoo-dev 2024-09-10 00:18:25 UTC
I wonder if you have the "device-mapper" USE flag disabled on sys-boot/grub? If so, try enabling it.
Comment 4 konsolebox 2024-09-10 04:57:39 UTC
(In reply to Mike Gilbert from comment #3)
> I wonder if you have the "device-mapper" USE flag disabled on sys-boot/grub?
> If so, try enabling it.

Looks like it's working with device-mapper.  Perhaps just enable this flag by default?
Comment 5 Larry the Git Cow gentoo-dev 2024-09-11 14:54:54 UTC
The bug has been referenced in the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=986a98ecc0e29535d3a6c55fedf599aea56841f4

commit 986a98ecc0e29535d3a6c55fedf599aea56841f4
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-09-11 14:50:51 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-09-11 14:50:51 +0000

    sys-boot/grub: update device-mapper USE description
    
    Bug: https://bugs.gentoo.org/939361
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-boot/grub/metadata.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Comment 6 Larry the Git Cow gentoo-dev 2024-09-12 18:26:58 UTC
The bug has been closed via the following commit(s):

https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b4efe21a38947ac8eef56424b79ae2e36c134325

commit b4efe21a38947ac8eef56424b79ae2e36c134325
Author:     Mike Gilbert <floppym@gentoo.org>
AuthorDate: 2024-09-12 18:26:09 +0000
Commit:     Mike Gilbert <floppym@gentoo.org>
CommitDate: 2024-09-12 18:26:09 +0000

    sys-boot/grub: enable device-mapper by default
    
    Closes: https://bugs.gentoo.org/939361
    Signed-off-by: Mike Gilbert <floppym@gentoo.org>

 sys-boot/grub/grub-2.12-r5.ebuild | 2 +-
 sys-boot/grub/grub-9999.ebuild    | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)