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.
This is a pretty kludgy workaround. I don't want to officially document it. Instead, you should figure out why grub-probe fails.
grub-probe.c simply looks outdated and broken. Not worth fixing. Anyway I'll just keep this solution to myself.
I wonder if you have the "device-mapper" USE flag disabled on sys-boot/grub? If so, try enabling it.
(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?
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(-)
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(-)