Update-grub fails to populate menu with existing ZFS root installation

Bug #1881153 reported by Chris Box
8
This bug affects 1 person
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-5.4.0-31-generic root=ZFS=ssd/root ro boot=zfs rpool=ssd bootfs=ssd/root
        initrd /initrd.img-5.4.0-31-generic

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.d/10_linux ###
### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/10_linux_zfs ###
### END /etc/grub.d/10_linux_zfs ###

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.d/10_linux ###.

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

Tags: zfs
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.