I've successfully managed to install the latest currently available Buster distro (frozen - 2019-03-11) on a ZFS root, booting in UEFI. This, in itself, already makes me rather happy
Unfortunately, I'm still facing a problem that I so far was unable to resolve by myself, despite searching for hours, not to say days. This is the reason I'm finally posting here in hope that someone more enlightened than I am might help me find a solution...
Here is the situation:
On a UEFI system, Debian Buster (frozen-20190311) has been installed on a single NVMe drive, using two partitions, one for the ESP, the other one being dedicated for ZFS.
The ZFS configuration / installation was mainly carried out following the GitHub's zfsonlinux HOWTO for Debian Stretch https://github.com/zfsonlinux/zfs/wiki/ ... oot-on-ZFS.
Therefore, the configuration of the disk, its partitions, ZFS datasets and /etc/fstab file are as follow:
Code: Select all
$ blkid
/dev/nvme0n1: LABEL="rpool" UUID="980046881818473778" UUID_SUB="11196991732143542666" TYPE="zfs_member" PTUUID="40008bd4-3d2a-4f78-8c32-2f48ad9873d4" PTTYPE="gpt"
/dev/nvme0n1p1: LABEL="rpool" UUID="980046881818473778" UUID_SUB="11196991732143542666" TYPE="zfs_member" PARTUUID="845abebe-7785-4785-8382-3761982fbcd6"
/dev/nvme0n1p3: LABEL_FATBOOT="EFI" LABEL="EFI" UUID="8241-499B" TYPE="vfat" PARTUUID="581b4260-b5c1-4389-8e11-aa43f71d35b9"
$ lsblk -f
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
nvme0n1 zfs_member rpool 980046881818473778
├─nvme0n1p1 zfs_member rpool 980046881818473778
└─nvme0n1p3 vfat EFI 8241-499B 507.3M 1% /boot/efi
$ zfs list -r -o name,mountpoint,canmount,exec,setuid rpool
NAME MOUNTPOINT CANMOUNT EXEC SETUID
rpool / off on on
rpool/ROOT none off on on
rpool/ROOT/debian-10 / noauto on on
rpool/ROOT/debian-10/opt /opt on on on
rpool/ROOT/debian-10/var /var off off off
rpool/ROOT/debian-10/var/cache /var/cache on off off
rpool/ROOT/debian-10/var/log legacy on off off
rpool/ROOT/debian-10/var/tmp legacy on on off
rpool/home /home on on off
rpool/home/root /root on on off
rpool/tmp legacy on on off
$ cat /etc/fstab
# EFI BOOT PARTITION
PARTUUID=581b4260-b5c1-4389-8e11-aa43f71d35b9 /boot/efi vfat noatime,nofail,x-systemd.device-timeout=1 0 1
# ZFS FILESYSTEM LEGACY MOUNTS
rpool/ROOT/debian-10/var/log /var/log zfs noatime,nodev,noexec,nosuid 0 0
rpool/ROOT/debian-10/var/tmp /var/tmp zfs noatime,nodev,nosuid 0 0
rpool/tmp /tmp zfs noatime,nodev,nosuid 0 0
Code: Select all
$ apt install --yes grub-efi-am64
$ grub-probe /
zfs
$ update-initramfs -u -k all
$ update-grub
$ grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debian-10 --recheck --no-floppy
... No error reported
$ ls /boot/grub/*/zfs.mod
/boot/grub/x86_64-efi/zfs.mod
Code: Select all
$ ls -l /boot/
total 32823
-rw-r--r-- 1 root root 206411 Jan 17 19:56 config-4.19.0-2-amd64
drwxr-xr-x 3 root root 4096 Jan 1 1970 efi
drwxr-xr-x 5 root root 9 Mar 18 09:59 grub
-rw-r--r-- 1 root root 27223819 Mar 18 08:49 initrd.img-4.19.0-2-amd64
-rw-r--r-- 1 root root 3345492 Jan 17 19:56 System.map-4.19.0-2-amd64
-rw-r--r-- 1 root root 5180704 Jan 17 19:56 vmlinuz-4.19.0-2-amd64
ls -l /boot/efi/EFI/debian-10
total 3772
-rwxr-xr-x 1 root root 72144 Mar 18 09:27 fbx64.efi
-rwxr-xr-x 1 root root 113 Mar 18 09:27 grub.cfg
-rwxr-xr-x 1 root root 1435040 Mar 18 09:27 grubx64.efi
-rwxr-xr-x 1 root root 1168464 Mar 18 09:27 mmx64.efi
-rwxr-xr-x 1 root root 1169528 Mar 18 09:27 shimx64.efi
$ ls -l /boot/grub/
total 1584
drwxr-xr-x 2 root root 3 Mar 15 12:40 fonts
-r--r--r-- 1 root root 5675 Mar 18 10:14 grub.cfg
-rw-r--r-- 1 root root 1024 Mar 15 12:40 grubenv
drwxr-xr-x 2 root root 40 Mar 18 09:27 locale
-rw-r--r-- 1 root root 2396122 Mar 15 12:40 unicode.pf2
drwxr-xr-x 2 root root 270 Mar 18 09:27 x86_64-efi
Code: Select all
$ cat /boot/grub/grub.cfg
...
menuentry 'Debian Buster GNU/Linux' --class debian --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-0d99d3724e04f532' {
load_video
insmod gzio
if [ x$grub_platform = xxen ]; then insmod xzio; insmod lzopio; fi
insmod part_gpt
insmod zfs
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root 0d99d3724e04f532
else
search --no-floppy --fs-uuid --set=root 0d99d3724e04f532
fi
echo 'Loading Linux 4.19.0-2-amd64 ...'
linux /ROOT/debian-10@/boot/vmlinuz-4.19.0-2-amd64 root=ZFS=rpool/ROOT/debian-10 ro
echo 'Loading initial ramdisk ...'
initrd /ROOT/debian-10@/boot/initrd.img-4.19.0-2-amd64
}
...
Code: Select all
search.fs_uuid 0d99d3724e04f532 root
set prefix=($root)'/ROOT/debian-10@/boot/grub'
configfile $prefix/grub.cfg
Which means grub was able to load but cannot locate the grub.cfg file...
Nevertheless, it is then quite possible to boot the system by typing one of the following sequences at the grub> prompt:
Code: Select all
grub> insmod part_gpt
grub> search --set --label rpool
grub> linux /ROOT/debian-10@/boot/vmlinuz-4.19.0-2-amd64 root=ZFS=rpool/ROOT/debian-10 ro
grub> initrd /ROOT/debian-10@/boot/initrd.img-4.19.0-2-amd64
grub> boot
Code: Select all
grub> search --label --set root rpool
grub> prefix=($root)'/ROOT/debian-10@/boot/grub'
grub> configfile $prefix/grub.cfg
I, obviously, tried to modify the /boot/efi/EFI/debian-10/grub.cfg file, inserting each of the above sequences, but to no avail
I read somewhere that this file was not used during the efi boot process, and that it was hardcoded into the sibling grubx64.efi executable. Which I was unable to confirm, even using GHex trying to explore it...
One thing I could determine, using efibootmgr, is that it is shimx64.efi that is called during the UEFI boot process:
Code: Select all
$ efibootmgr -v
BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000
Boot0000* debian-10 HD(3,GPT,581b4260-b5c1-4389-8e11-aa43f71d35b9,0x800,0x100000)/File(\EFI\debian-10\shimx64.efi)
I've parsed all /dev/disk/by-id, zpool / zfs get guid and blkid output but couldn't determine where the 0d99d3724e04f532 value used in both /boot/grub/grub.cfg and /boot/efi/EFI/debian-10/grub.cfg came from !
Thus, here I am, at least able to use the system although forced to type those grub commands each time I start it up... And, since this is supposed to become my day to day laptop I'd really like to find a way to have grub immediately locating its config file, which I think must be achievable, specially since it is doable from the grub command line !
But, once again, I haven't been able to find a way to do it... until maybe one of you reading this brings me the so much expected solution ?
Thank you.