Bug 755719 - grub2-mkconfig fails if current kernel booted without initrd
Summary: grub2-mkconfig fails if current kernel booted without initrd
Keywords:
Status: CLOSED DUPLICATE of bug 737370
Alias: None
Product: Fedora
Classification: Fedora
Component: grub2
Version: 16
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Peter Jones
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2011-11-21 21:04 UTC by Konstantin Svist
Modified: 2011-11-22 23:30 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2011-11-22 23:30:50 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)
output of 10_linux (17.13 KB, text/plain)
2011-11-22 21:39 UTC, Konstantin Svist
no flags Details
requested log (1.52 KB, text/plain)
2011-11-22 22:20 UTC, Konstantin Svist
no flags Details

Description Konstantin Svist 2011-11-21 21:04:06 UTC
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

Comment 1 Mads Kiilerich 2011-11-22 19:56:44 UTC
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.

Comment 2 Konstantin Svist 2011-11-22 21:39:35 UTC
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}"
>   ## ]]]]
>

Comment 3 Mads Kiilerich 2011-11-22 22:03:25 UTC
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

Comment 4 Konstantin Svist 2011-11-22 22:20:08 UTC
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}"
>   ## ]]]]

Comment 5 Konstantin Svist 2011-11-22 23:20:53 UTC
Oops, looks like this is a known bug already: https://bugzilla.redhat.com/show_bug.cgi?id=737370

Comment 6 Mads Kiilerich 2011-11-22 23:30:50 UTC
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 ***


Note You need to log in before you can comment on or make changes to this bug.