Update-grub fails to populate menu with existing ZFS root installation
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
grub2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
I had an existing ZFS system running 18.04 which I upgraded to 20.04. It uses an ext4 /boot, but / is ZFS. So I am expecting /boot/grub/grub.cfg to contain this:
set root='hd0,gpt2'
linux /vmlinuz-
initrd /initrd.
However after do-release-upgrade, the above was absent and after reboot all I had was an option to go into UEFI bios settings, plus my 40_custom entries.
The cause of this is that both these sections were empty:
### BEGIN /etc/grub.
### END /etc/grub.
### BEGIN /etc/grub.
### END /etc/grub.
Looking at those scripts, 10_linux outputs nothing because it aborts early, due to the presence of 10_linux_zfs installed by focal's grub-common 2.04-1ubuntu26:
xzfs)
# We have a more specialized ZFS handler, with multiple system in 10_linux_zfs.
if [ -e "`dirname $(readlink -f $0)`/10_linux_zfs" ]; then
exit 0
fi
However 10_linux_zfs doesn't output anything either, although it is hard to read so I'm not sure why. Is 10_linux_zfs supposed to cover the cases where /boot is on ext4?
To recover my system, I renamed 10_linux_zfs and re-ran update-grub. This then generated the correct entries under ### BEGIN /etc/grub.
As I say, I'd first like to understand which script has the responsibility of finding bootable kernels for this kind of layout, then we can work from there.
Thanks,
Chris