Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upBTRFS: grubby fatal error: unable to find a suitable template #22
Comments
|
A similar problem occurs when using raid, and having the root partition (with /boot) on md0. grubby can't determine the uuid of the root partition. It chokes at this line: https://github.com/rhinstaller/grubby/blob/master/grubby.c#L2191
On a server with the problem, strace has this:
|
|
Just a note that I'm also getting this when running
It's worth noting that Seems another libguestfs user had some similar issue back in 2010 https://www.redhat.com/archives/libguestfs/2010-April/msg00079.html. They worked around this by just generating the grub.conf update themselves in this case using augeas. Excerpt:
In case it's useful to others my workaround is to run the following hack after
This is essentially replicating the grubby post installation step of the kernel package but adding in FWIW I dont seem to experience the issue with the CentOS 7 qcow2 images... |
|
I hit the same issue than @jtriley with a RHEL 6 cloud image. Looking at grubby code (branch rhel-6.8), it looks like the grubby command is failing in findDiskForRoot(). This function search the drive in /etc/mtab. I found out the / device is /dev/vda1 in /etc/mtab while it is /dev/sda1 in the guestfish session. While only relevant to the previous comment, a basic |
|
I think the error message is a generic one, so everyone with configurations other than the original bug report, which is about Btrfs subvolumes, needs to file separate bugs. |
|
I don't know that this is BTRFS specific so much as 'no separate /boot' mount specific Of course a non-readable FS adds to the friction, but any failure to be able to read (no FS support, or simple non-presence) is enough I have an open bug on this at Red Hat presently |
|
It's definitely not 'no separate /boot' related because I've done /boot on LVM, /boot on mdadm raid of various levels, /boot as a directory part of rootfs, where rootfs is a range of simple to complex. As I understand it, grubby is looking at the kernel command line, and tests it against templates for layouts it's explicitly supporting and if there's something about the layout it isn't familiar with (no template) then it fails with this error message. |
|
hit this problem today. my current workaround is to move /usr/sbin/grubby /usr/sbin/grubby.real and make a wrapper that looks like looks like: /usr/sbin/grubby.real --bad-image-okay "$@" |
In order to find the subvolume prefix from a given path, we parse /proc/mounts. In cases where /proc/mounts doesn't contain the filesystem, the caller can use the --mounts option to specify his own mounts file. Btrfs subvolumes are already supported by grub2 and by grub2-mkconfig. Fixes rhboot#22
In order to find the subvolume prefix from a given path, we parse /proc/mounts. In cases where /proc/mounts doesn't contain the filesystem, the caller can use the --mounts option to specify his own mounts file. Btrfs subvolumes are already supported by grub2 and by grub2-mkconfig. Fixes rhboot#22
|
Please check #34, it does not work on my machine yet. |
grubby-8.40-3.fc24.x86_64
Summary:
When a Btrfs subvolume is mounted at /boot, grubby fails to update grub.cfg with this error message. grub2-mkconfig has no issue with this configuration and produces working grub.cfg.
Detail:
Evaluation:
This example uses /boot as a directory in the 'root' subvolume which is in turn mounted at /.
Basically this bug is not so much a Btrfs subvolume problem per se, but a combination of how Fedora's installer creates subvolumes at the top level of the Btrfs volume, and how they end up being bind mounted behind the scenes with the Btrfs subvol= mount option found in fstab. GRUB understands this by always following the top level of the volume whether it's mounted or not. Grubby doesn't seem to know about the top level of Btrfs volumes, it merely follows the mounted path structure. Therefore it doesn't recognize the path /root/boot/ instead it only sees the path as /boot/.
An old downstream bug report uses a 'boot' subvolume mounted at /boot which runs into the identical error.
https://bugzilla.redhat.com/show_bug.cgi?id=864198
grub.cfg.txt
grubby-debug.log.txt