rc.d/mountcritlocal: Make sure zpools are imported for legacy ZFS

Legacy ZFS uses fstab to mount its datasets. In an attempt to fix
another problem 900bc02063 broke legacy ZFS in fstab(5). This
comit works around the problem by mountcritlocal scanning /etc/fstab
for zfs mountpoint and if any are found invoke /etc/rc.d/zpool start.

Reviewed by:		imp
Differential Revision:	https://reviews.freebsd.org/D50844
This commit is contained in:
Cy Schubert 2025-06-14 06:16:16 -07:00
parent 5e6e4f7528
commit b6e33f0cd5

View file

@ -27,6 +27,15 @@ mountcritlocal_start()
;;
esac
while read a b vfstype rest; do
if [ "$vfstype" = "zfs" -a "$a" != "#" ]; then
# zpool is needed for legacy ZFS
echo 'Importing zpools for legacy ZFS'
/etc/rc.d/zpool start
break
fi
done < /etc/fstab
# Mount everything except nfs filesystems.
startmsg -n 'Mounting local filesystems:'
mount_excludes='no'