grub not accessing zfs root file system

Bug #2028702 reported by Thomas Schweikle
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
grub2 (Ubuntu)
New
Undecided
Unassigned

Bug Description

Grub can not access ubuntu on root zfs. System does not boot any more.

What was tried:
- Booting from an USB-ubuntu, then mounting zfs:
  mkdir K
  zpool import -R /root/K rpool
  zpool import -R /root/K bpool
  mount -R /sys /root/K/sys
  mount -R /dev /root/K/dev
  mount -R /proc /root/K/proc
  mount -R /tmp /root/K/tmp
  cp /etc/resolv.conf /root/K/etc/resolv.conf
  chroot /root/K /bin/bash
  . /etc/profile
  cd
  mount /boot/efi
  mount -B /boot/efi/grub /boot/grub
  apt update
  apt upgrade
  apt reinstall grub
  -> no errors reported
  grub-install /dev/sda
  -> no errors reported
  update-grub
  -> no errors reported

  umount /boot/grub
  umount /boot/efi
  exit
  reboot

System rebooted into grub, then grub tells again: "/BOOT/ubuntu_sxscpx@/vmlinux-6.2.0-26-generic" not found.

Going to grub commandline trying to list zfs info with "zfsinfo (hs0,4)" tells me: unsupported festures in pool.

Kernel: linux-modules-6.2.0-26-generic linux-image-6.2.0-26-generic 6.2.0-26-generic
zfs: fsutils-linux 2.1.9-2ubuntu1.1
grub: grub-* 2.06-2ubuntu16

Grub itself loads, but cant access zfs filesystems. even after upgrading to the latest tools and versions.

/etc/lsb-release:
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=23.04
DISTRIB_CODENAME=lunar
DISTRIB_DESCRIPTION="Ubuntu 23.04"

Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Libera.chat.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/2028702/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Revision history for this message
Thomas Schweikle (tps) wrote :

Switching the boot partition from zfs to ext4 makes the whole thing boot again.

The source of the problem could be found afterwards: as grub command zfsinfo indicated: there where zfs features enabled grub zfs could not handle -- the kernel with zfs enabled indeed could. grub found bpool, but was not able to access it.

To help others out:
- enable grub to handle these zfs features or
- switch booting of an ext4 2G partition.

switching is easy, because swap has the same size than the bpool-partition.

1. boot into your not booting linux as adviced.
2. turn of swap, disable it in /etc/fstab
3. format the swap-partition to ext4, mount it to say /BB
4. unmount /boot/grub, /boot/efi
5. copy all files from /boot to /BB
6. add your new ext4 partition to /etc/fstab
7. export zfs bpool: zpool export bpool
8. mount your new ext4 using fstab: mount /boot
9. mount /boot/efi
10. mount /boot/grub
11. grub-install /dev/sda
    This has to run without any error!
12. update-grub
    This too has to run without errors.
13. unmount all drives mounted from chroot. /boot/grub, /boot/efi, /boot
14. exit chroot
15. format the bpool-partition to swap
    -> this will partly fail, because zfs keeps track on it. But mostly zfs-informations are destroyed.
16. reboot
    -> system reboots, but without swap
17. format dwap again (just to be sure it is ok.
18. edit /etc/fstab to reflect the new UUID for swap
19. enable swap.
20. reboot

Now there is no bpool anymore and grub goots from a 2GiB ext4 partition into zfs.

Paul White (paulw2u)
affects: ubuntu → grub2 (Ubuntu)
tags: added: lunar
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.