Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 922809

Summary: sys-boot/grub - grub-mkconfig stopped working after upgrading to kernel 6.7.x
Product: Gentoo Linux Reporter: Michelangelo Scopelliti <kernelpanic>
Component: Current packagesAssignee: Mike Gilbert <floppym>
Status: RESOLVED FIXED    
Severity: normal CC: base-system, Bernd.Feige, gentoo, immoloism, jeff.hayes87, kernel, kernelpanic, liquid.acid
Priority: Normal    
Version: unspecified   
Hardware: AMD64   
OS: Linux   
See Also: https://bugzilla.kernel.org/show_bug.cgi?id=218353
https://bugs.gentoo.org/show_bug.cgi?id=931236
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: emerge --info
Working fix (https://github.com/kdave/btrfs-devel/commit/b80f3ec6592c69f88ebc74a4e16676af161e2759)

Description Michelangelo Scopelliti 2024-01-24 09:19:43 UTC
Created attachment 883027 [details]
emerge --info

After upgrading to kernel 6.7.0, if I try to upgrade grub.cfg  with the usual

grub-mkconfig -o /boot/grub/grub.cfg

I get the error message

/usr/sbin/grub-probe: error: cannot find a device for / (is /dev mounted?).

"/dev" is indeed mounted:

devtmpfs on /dev type devtmpfs (rw,nosuid,noexec,relatime,size=10240k,nr_inodes=8218697,mode=755)

Before upgrading to 6.7.0, everything worked fine, and it still works if I boot with older kernels. The main difference  I found is that, with gentoo admin livecd, the filesystem is "udev" instead of "devtmpfs", and udev leaves a trace in dmesg; with my current setup, I see no udev occurrencies in dmesg.

The issue is present both with vanilla-sources and gentoo-sources, versions 6.7.0 and 6.7.1; in order to avoid configuration issues, I tested also with kernel defconfig -- adding as builtin just the support for nvme and btrfs, my machines storage and filesystem.

I don't use systemd; I don't use initramfs.

Some extra info:

emerge -pqv grub systemd-utils

[ebuild   R   ] sys-boot/grub-2.12-r1  USE="fonts nls themes truetype -device-mapper -doc -efiemu -libzfs -mount -sdl (-test) -verify-sig" GRUB_PLATFORMS="efi-64 pc -coreboot -efi-32 -emu -ieee1275 (-loongson) -multiboot -qemu (-qemu-mips) -uboot -xen -xen-32 -xen-pvh"
[ebuild   R   ] sys-apps/systemd-utils-254.8  USE="acl kmod (split-usr) tmpfiles udev -boot -kernel-install -secureboot (-selinux) -sysusers -test -ukify" ABI_X86="(64) -32 (-x32)" PYTHON_SINGLE_TARGET="python3_11 -python3_10 -python3_12"
Comment 1 Bernd Feige 2024-01-25 10:59:16 UTC
Same here! Confirmed that just by booting into kernel 6.6.12-gentoo, grub finds the / device again. And then back in current 6.7.1-gentoo-r1, again not.
No idea why...
Comment 2 Bernd Feige 2024-01-25 11:00:54 UTC
... BTW I do use systemd but also no initramfs here.
Comment 3 Michelangelo Scopelliti 2024-01-25 15:14:15 UTC
I think the bug is known upstream:

https://bugzilla.kernel.org/show_bug.cgi?id=218353
Comment 4 Bernd Feige 2024-02-05 13:14:02 UTC
Created attachment 884274 [details, diff]
Working fix (https://github.com/kdave/btrfs-devel/commit/b80f3ec6592c69f88ebc74a4e16676af161e2759)

There is a working fix now in https://bugzilla.kernel.org/show_bug.cgi?id=218353 by David Sterba - I attach it.
Comment 5 Tobias Jakobi 2024-02-24 14:48:35 UTC
Also confirming here. Happened when I migrated from 6.6.y to 6.7.y. Root filesystem is btrfs, no initramfs in use.

I'm using this patch successfully:
https://patchwork.kernel.org/project/linux-btrfs/patch/8dd1990114aabb775d4631969f1beabeadaac5b7.1707132247.git.anand.jain@oracle.com/

This is the latest patch discussed in the aforementioned kernel bugreport as of today:
https://bugzilla.kernel.org/show_bug.cgi?id=218353
Comment 6 Mike Gilbert gentoo-dev 2024-05-06 17:32:22 UTC
Should be resolved in linux 6.7.12.