Bug 833011 - /dev/root in mtab doesn't exist when no initrd and grubby fails to find a suitable template
/dev/root in mtab doesn't exist when no initrd and grubby fails to find a sui...
Status: CLOSED WONTFIX
Product: Fedora
Classification: Fedora
Component: kernel (Show other bugs)
17
Unspecified Linux
unspecified Severity unspecified
: ---
: ---
Assigned To: Kernel Maintainer List
Fedora Extras Quality Assurance
: Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-06-18 07:50 EDT by dgod.osa
Modified: 2013-08-01 13:21 EDT (History)
12 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2013-08-01 13:21:00 EDT
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description dgod.osa 2012-06-18 07:50:31 EDT
when I update the kernel, there're an errror

grubby fatal error: unable to find a suitable template

my grub menu entry is like this

menuentry 'Fedora (3.4.0-1.fc17.x86_64)' --class fedora --class gnu-linux --class gnu --class os {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_msdos
        insmod ext2
        set root='(hd0,msdos1)'
        search --no-floppy --fs-uuid --set=root 269490f7-b6aa-4f80-9537-fd8ae6be8127
        echo 'Loading Fedora (3.4.0-1.fc17.x86_64)'
        linux   /boot/vmlinuz-3.4.0-1.fc17.x86_64 root=/dev/sda1 rootfstype=ext4 ro rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us quiet SYSFONT=latarcyrheb-sun16 rd.luks=0 LANG=en_US.UTF-8 i915.i915_enable_rc6=1 selinux=0 plymouth.enable=0 libahci.ignore_sss=1
}
Comment 1 Mads Kiilerich 2012-07-30 11:59:34 EDT

*** This bug has been marked as a duplicate of bug 730357 ***
Comment 2 Mads Kiilerich 2012-07-30 14:09:17 EDT
Correction:
The symptoms looks exactly like bug 730357, but it seems like it is caused by booting without initrd:

[root@dev-mk ~]# cat /proc/cmdline 
BOOT_IMAGE=/boot/vmlinuz-3.4.6-2.fc17.i686.PAE root=/dev/sda3 ro quiet rhgb

[root@dev-mk ~]# grubby --grub2 -c /boot/grub2/grub.cfg --add-kernel=/boot/vmlinuz-3.4.6-2.fc17.i686.PAE --copy-default --make-default --title 'Fedora (3.4.6-2.fc17.i686.PAE)' '--args=root=/dev/sda3' '--remove-kernel=TITLE=Fedora (3.4.6-2.fc17.i686.PAE)'
grubby fatal error: unable to find a suitable template

Debugging shows that it is caused by:

[root@dev-mk ~]# grep ' / ' /proc/mounts
rootfs / rootfs rw 0 0
/dev/root / ext3 rw,seclabel,relatime,data=ordered 0 0

[root@dev-mk ~]# ls -l /dev/root
ls: cannot access /dev/root: No such file or directory


It looks like a kernel bug to me that it reports /dev/root in mtab when it doesn't exist in /dev.

Reassigning to kernel.
Comment 3 Freddy Willemsen 2012-08-20 03:03:59 EDT
I am using the following workaround till this is fixed:

cat > /etc/kernel/postinst.d/rhbz833011  <<_EOF_
#!/bin/bash

# We're passed the version of the kernel being installed
inst_kern=\$1

GRUBCFG=/boot/grub2/grub.cfg
cp \${GRUBCFG} \${GRUBCFG}.pre_\${inst_kern}

# initramfs is unneccessary for a laptop with only one disk
sed -i "s/.*\/boot\/vmlinuz-\${inst_kern}.*/\\tlinux \/boot\/vmlinuz-\${inst_kern} root=\/dev\/sda1 rootfstype=ext4 ro rd.luks=0 rd.md=0 rd.lvm=0 rd.dm=0 KEYTABLE=us SYSFONT=latarcyrheb-sun16 LANG=en_US.UTF-8 selinux=0 intel_iommu=on i915.semaphores=1 i915.i915_enable_rc6=1 i915.i915_enable_fbc=1 i915.lvds_downclock=1 slub_debug=- plymouth.enable=0 raid=noautodetect libahci.ignore_sss=1 quiet/g" \${GRUBCFG}
sed -i "s/.*initrd \/boot\/initramfs-\${inst_kern}.img/\\t#initrd \/boot\/initramfs-\${inst_kern}.img/g" \${GRUBCFG}
_EOF_

I am commenting the initramfs line instead of deleting it so I can return easily when needed.

To finish it of it needs this:

cat > /etc/rc.d/rc.local <<_EOF_
#!/bin/sh

# grubby needs this one
ln -s /dev/sda1 /dev/root
_EOF_

Be careful, this one overwrites any rc.local file, you may just want to add the 'ln -s /dev/sda1 /dev/root' to your own rc.local file.

And off course make sure the rc-local.service is started:

systemctl enable rc-local.service
Comment 4 Fedora End Of Life 2013-07-04 02:00:04 EDT
This message is a reminder that Fedora 17 is nearing its end of life.
Approximately 4 (four) weeks from now Fedora will stop maintaining
and issuing updates for Fedora 17. It is Fedora's policy to close all
bug reports from releases that are no longer maintained. At that time
this bug will be closed as WONTFIX if it remains open with a Fedora 
'version' of '17'.

Package Maintainer: If you wish for this bug to remain open because you
plan to fix it in a currently maintained version, simply change the 'version' 
to a later Fedora version prior to Fedora 17's end of life.

Bug Reporter:  Thank you for reporting this issue and we are sorry that 
we may not be able to fix it before Fedora 17 is end of life. If you 
would still like  to see this bug fixed and are able to reproduce it 
against a later version  of Fedora, you are encouraged  change the 
'version' to a later Fedora version prior to Fedora 17's end of life.

Although we aim to fix as many bugs as possible during every release's 
lifetime, sometimes those efforts are overtaken by events. Often a 
more recent Fedora release includes newer upstream software that fixes 
bugs or makes them obsolete.
Comment 5 Fedora End Of Life 2013-08-01 13:21:17 EDT
Fedora 17 changed to end-of-life (EOL) status on 2013-07-30. Fedora 17 is 
no longer maintained, which means that it will not receive any further 
security or bug fix updates. As a result we are closing this bug.

If you can reproduce this bug against a currently maintained version of 
Fedora please feel free to reopen this bug against that version.

Thank you for reporting this bug and we are sorry it could not be fixed.

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