reefland / ansible-zfs_on_root

Ansible ZFS on Root with device based zpool rules. For bare metal installs. ZFS Encryption, UEFI and Dropbear included.
7 stars 1 forks source link

Failed to mount /sysroot -- /ssdpool/ROOT/ubuntu cannot be mounted due to invalid option 'casesensitive' #3

Closed benwilks closed 6 months ago

benwilks commented 6 months ago

Describe the bug a clear and concise description of what the bug is.

Boot error Failed to mount /sysroot -- /rpool/ROOT/ubuntu cannot be mounted due to invalid option 'casesensitive'

What happened?

starting vmlinuz-2.3.0_1 using load options ' zbm.prefer=ssdpool zbm.import_policy=host id zbm.set_hostid zbm.timeout=20 ro loglevel=0 initrd=EFI\zfsbootmenu\initramfs-2.3.0_1.img EFI stub: Loaded initrd from command line option starting version 249.11-0ubuntu3.12

Finishes a variety of tasks up to:

Finished dracut pre-mount hook. Mounting /sysroot... Failed to mount /sysroot

which triggered Emergency Mode

systemctl status sysroot.mount yields Loaded: loaded (/proc/cmdline; generated) Drop-In: /run/systemd/generator/sysroot.mount.d --> zfs-enhancement.conf Active: failed (Result: exit-code) Where: /sysroot What: ssdpool/ROOT/ubuntu Docs: man:fstab(5) man:systemd-fstab-generator(8)

What you expected to happen?

Finish booting

How to reproduce it?

No response

Anything else we need to know?

No response

benwilks commented 6 months ago

/proc/mount which looks symlinked to /etc/mtab seems to have zfs commands with a "casesensitive" property which is not valid (sensitive|insensitive|mixed). Still trying to figure out how that command is generated.

benwilks commented 6 months ago

Documentation from OpenZFS suggests prop is casesensitivity -- sensitive https://github.com/search?q=repo%3Aopenzfs%2Fzfs+casesensitivity&type=code

but it looks like casesensitive property is used elsewhere too https://github.com/search?q=repo%3Aopenzfs%2Fzfs+casesensitive&type=code

reefland commented 6 months ago

I did bump into this with the Ubuntu HWE kernel. The source seems to be in a dynamically generated systemd file within the initramfs sysroot.mount.d/zfs-enhancement.conf which has an Options= under the [Mount] section. Not sure what makes it become an issue.

I use the ZFS Boot Menu to open a chroot and did a dracut --regenerate-all --force to rebuild the images and reboot which booted up fine after that. Feels like there is a hook missing that should trigger that as I've had to do this again after other kernel updates but haven't been able to track it down. The older 5.x kernels seem fine, just the 6.x kernels was doing this for me.

benwilks commented 6 months ago

Thanks for the quick response! I tried running dracut --regenerate-all --force but it looks like it still generates the "dracut: stored kernel commandline:", "dracut: rootfstype=zfs rootflags=rw,noatime,xattr,posixacl,casesensitive" with the problematic casesensitive option that seems to be preventing booting. Any idea how to override that?

benwilks commented 6 months ago

Ended up using a 22.04.1 ISO instead which worked smoothly!

reefland commented 6 months ago

Weird. Thanks for letting me know.