[Pkg-zfsonlinux-devel] Bug#1003528: zfsutils-linux: datasets with mountpoint=legacy defined in fstab prevent the system from booting

Louis Sautier sautier.louis at gmail.com
Tue Jan 11 12:11:36 GMT 2022


Package: zfsutils-linux
Version: 2.0.3-9
|Severity: important|

Hi,
Currently, creating a ZFS dataset with mountpoint=legacy and adding it to /etc/fstab as auto causes the system to hang at boot because the mount is attempted before the pool has been imported or the ZFS module loaded.
How to reproduce:
apt install zfsutils-linux
modprobe zfs
zpool create tank sdb
zfs set mountpoint=legacy tank
echo "tank /mnt zfs defaults 0 0" >> /etc/fstab
reboot

The boot process will hang because /mnt did not mount properly. "journalctl -b -u mnt.mount" shows the following (I don't know why the dates aren't sorted):
Jan 11 11:41:16 localhost mount[702]: The ZFS modules are not loaded.
Jan 11 11:41:16 localhost mount[702]: Try running '/sbin/modprobe zfs' as root to load them.
Jan 11 11:41:13 localhost systemd[1]: Mounting /mnt...
Jan 11 11:41:14 localhost systemd[1]: mnt.mount: Mount process exited, code=exited, status=2/INVALIDARGUMENT
Jan 11 11:41:14 localhost systemd[1]: mnt.mount: Failed with result 'exit-code'.
Jan 11 11:41:14 localhost systemd[1]: Failed to mount /mnt.

"journalctl -b -u zfs-load-module.service" shows that the module was loaded afterwards:
Jan 11 11:41:19 localhost systemd[1]: Starting Install ZFS kernel module...
Jan 11 11:41:19 localhost systemd[1]: Finished Install ZFS kernel module.

The same goes for "journalctl -b -u zfs-import-cache.service":
Jan 11 11:41:19 localhost systemd[1]: Starting Import ZFS pools by cache file...
Jan 11 11:41:19 localhost systemd[1]: Finished Import ZFS pools by cache file.


I worked around the problem by making sure the zfs-import.target (used by zfs-import-{cache,scan}.service) is active before mounts are attempted.
Contents of /etc/systemd/system/zfs-import.target.d/override.conf
[Unit]
Before=local-fs-pre.target

Should Debian edit /lib/systemd/system/zfs-import.target to include this? Should I report this bug upstream? Are there any dependency loop risks I might have overlooked?

Kind regards,

Louis

-------------- next part --------------
A non-text attachment was scrubbed...
Name: OpenPGP_signature
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://alioth-lists.debian.net/pipermail/pkg-zfsonlinux-devel/attachments/20220111/030d8370/attachment.sig>


More information about the Pkg-zfsonlinux-devel mailing list