[BUG] No /dev/zdX ZFS block devices for encrypted datasets after reboot
Step to reproduce:
- Download latest Extended Alpine https://dl-cdn.alpinelinux.org/alpine/v3.13/releases/x86_64/alpine-extended-3.13.2-x86_64.iso
- Copy all files from alpine iso to USB drive formatted as a single efi partition.
- Setup Alpine:
setup-alpine
apk add util-linux nano udev zfs
setup-udev
modprobe zfs
mount -o remount,rw /media/usb
dd if=/dev/random of=/media/usb/var.key bs=1 count=32
zpool create -f -o ashift=12 -o autotrim=on \
-O acltype=posixacl -O canmount=on -O compression=zstd -O dnodesize=auto -O normalization=formD -O relatime=on -O
zfs create -V 8G -b $(getconf PAGESIZE) -o compression=zle -o logbias=throughput -o sync=standard -o primarycache=metadata -o secondarycache=none -o com.sun:auto-snapshot=false -o encryption=aes-256-gcm -o keylocation=file:///media/usb/var.key -o keyformat=raw rpool/swap
udevadm trigger
#check zdX device with ls /dev/zd*
sed -i 's/MOUNT_EXTRA_OPTIONS=""/MOUNT_EXTRA_OPTIONS="-l"/' /etc/conf.d/zfs #load key on mount
rc-update add zfs-import sysinit
rc-update add zfs-mount sysinit
lbu ci && reboot
- after the reboot there is no zdX devices (check zdX device with ls
/dev/zd*
)
Sorry for offtopic but it can be related looks like it is mandatory to run zfs load-key -a
before encrypted, legacy-mountpoint dataset can be mounted by fstab. It will be nice if zfs load-key -a
can be configured by /etc/conf.d/zfs