Just coming across your question while looking for some answers concerning ZFS myself, so I'm pretty steeped in the issue right now.
While I don't have a direct solution, I thought I might share some resources from a working system:
- UUIDs are your friend - since
/dev/disk/by-id
is not particularly helpful for /etc/fstab
, so make sure you're up on which one's which using lsblk -f
and/or blkid
:
$ lsblk -f
nvme0n1
│
├─nvme0n1p1
│ vfat FAT32 5363-5E6F 485.1M 5% /boot/efi
├─nvme0n1p2
│ swap 1 e5e9eace-5ce4-4bea-a900-e836788963e7 [SWAP]
├─nvme0n1p3
│ zfs_me 5000 bpool 11441242366189825385
└─nvme0n1p4
zfs_me 5000 rpool 10749750096631427503
$ blkid | grep nvme
/dev/nvme0n1p1: UUID="5363-5E6F" BLOCK_SIZE="512" TYPE="vfat" PARTLABEL="EFI System Partition" PARTUUID="09716541-5559-49f9-a998-e06bc57c1fe6"
/dev/nvme0n1p2: UUID="e5e9eace-5ce4-4bea-a900-e836788963e7" TYPE="swap" PARTUUID="69e175df-272a-7e4e-8691-c27bc7f08b32"
/dev/nvme0n1p3: LABEL="bpool" UUID="11441242366189825385" UUID_SUB="9297990641780606350" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="4716a6e3-b84f-344a-a8eb-528f4cbd0ff0"
/dev/nvme0n1p4: LABEL="rpool" UUID="10749750096631427503" UUID_SUB="9348454491950206043" BLOCK_SIZE="4096" TYPE="zfs_member" PARTUUID="72c4025b-023f-ef43-878d-9e1f60af796b"
$ cat /etc/fstab # auto-generated during installer setup
❯ cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# /boot/efi was on /dev/nvme0n1p1 during installation
UUID=5363-5E6F /boot/efi vfat umask=0022,fmask=0022,dmask=0022 0 1
/boot/efi/grub /boot/grub none defaults,bind 0 0
UUID=e5e9eace-5ce4-4bea-a900-e836788963e7 none swap sw 0 0
- Make sure your grub-related packages are all present in your installation. From 21.10 installer-generated setup:
$ apt list --installed | grep grub
grub-common/impish,now 2.04-1ubuntu47 amd64 [installed,automatic]
grub-efi-amd64-bin/impish,now 2.04-1ubuntu47 amd64 [installed,automatic]
grub-efi-amd64-signed/impish,now 1.173+2.04-1ubuntu47 amd64 [installed,automatic]
grub-efi-amd64/impish,now 2.04-1ubuntu47 amd64 [installed]
grub2-common/impish,now 2.04-1ubuntu47 amd64 [installed,automatic]
- If the ZFS-specific file(s) in
/etc/grub.d
are not present, obtain a copy of it/them and place them in the folder:
❯ ls -la /etc/grub.d
total 117
drwxr-xr-x 2 root root 13 Jan 27 14:08 .
drwxr-xr-x 188 root root 311 Jan 27 15:21 ..
-rwxr-xr-x 1 root root 10627 Sep 2 05:37 00_header
-rwxr-xr-x 1 root root 6258 Sep 2 05:37 05_debian_theme
-rwxr-xr-x 1 root root 18151 Sep 2 05:37 10_linux
-rwxr-xr-x 1 root root 43031 Sep 2 05:37 10_linux_zfs
-rwxr-xr-x 1 root root 12894 Sep 2 05:37 20_linux_xen
-rwxr-xr-x 1 root root 1992 Oct 7 03:20 20_memtest86+
-rwxr-xr-x 1 root root 12059 Sep 2 05:37 30_os-prober
-rwxr-xr-x 1 root root 1424 Sep 2 05:37 30_uefi-firmware
-rwxr-xr-x 1 root root 214 Sep 2 05:37 40_custom
-rwxr-xr-x 1 root root 216 Sep 2 05:37 41_custom
-rw-r--r-- 1 root root 483 Sep 2 05:37 README
Note: I tried to attach 10_linux_zfs
but it was too long. I found the source code for the proper package, though - on the right side you can download it in .tar.gz
format and extract the 10_linux_zfs
file, or download the grub-common-2.04-1ubuntu47.deb
file and re-install the entire thing: https://packages.ubuntu.com/impish/grub-common
(notice if you're using a different version, you can select between them at the top)
If re-installing from a local package, apt needs you to specify the file location - the ./
part at the start of the name. Relative is OK, but it needs to be explicit:
$ sudo apt install -y --reinstall ./grub-common-2.04-1ubuntu47.deb
Apt should resolve any other dependencies you might need, so I prefer installing individual .deb
s through apt
rather than dpkg -i