Description of problem: I have a modified entry in my grub.cfg to shorted the boot time (since my non-LVM partition is easily accessible without initrd): linux ... root=/dev/sda2 rootfstype=ext4 ... <removed initrd line> When this kernel is booted, grub2-mkconfig fails with the following error: /sbin/grub2-probe: error: cannot stat `/dev/root'. Version-Release number of selected component (if applicable): 1.99 How reproducible: every time Steps to Reproduce: 1. Alter grub.cfg to remove initrd, reboot 2. Try updating grub.cfg automatically (grub2-mkconfig or yum update/grubby) 3. Actual results: grub.cfg is not updated Expected results: grub.cfg should be updated Additional info: This makes it hard to run yum update -- new kernel is not added to the list of bootable choices I realize this is pretty low priority since most users don't change their grub.cfg by hand, but it's probably pretty easy to fix
Please attach the log from bash -x /etc/grub.d/10_linux > /dev/null 2> log The grub2-mkconfig failure is one thing, but it is not involved in kernel updates. The kernel installation script uses grubby to clone the latest good kernel entry. I think it is fair enough that grubby consider a kernel entry without initrd something special that it shouldn't look at.
Created attachment 535201 [details] output of 10_linux Right, I think grubby problem is a separate bug. When it runs, it says "no suitable template found" although there are plenty of suitable examples (it's just that the currently booted one is "not suitable"). But grub2-mkconfig doesn't/shouldn't care about those things. Near as I can tell it just inserts all available kernels into grub.cfg... Anyway, the log is attached. Note: I've modified 10_linux a little bit, to generate an extra line without initrd. Here's the diff: diff 10_linux.orig /etc/grub.d/10_linux 197a198,205 > ## Kostya: once more, with feeling [[[[ > initrd= > initramfs= > linux_root_device_thisversion=${GRUB_DEVICE} > linux_entry "OPTIMIZED ${OS}" "${version}" false \ > "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" > ## ]]]] >
grubby is run on everything that looks like a boot loader, "no suitable template found" will usually come from that. I requested a bad log. Instead please try to insert 'set -x' in 10_linux and run bash -x grub2-mkconfig 2> log
Created attachment 535214 [details] requested log diff 10_linux.orig /etc/grub.d/10_linux 1a2 > set -x 196a198,205 > > ## Kostya: once more, with feeling [[[[ > initrd= > initramfs= > linux_root_device_thisversion=${GRUB_DEVICE} > linux_entry "OPTIMIZED ${OS}" "${version}" false \ > "${GRUB_CMDLINE_LINUX} ${GRUB_CMDLINE_LINUX_DEFAULT}" > ## ]]]]
Oops, looks like this is a known bug already: https://bugzilla.redhat.com/show_bug.cgi?id=737370
Yes, I will mark this as a duplicate. The error message come from a failing "/sbin/grub2-probe --target=device /" *** This bug has been marked as a duplicate of bug 737370 ***