diff --git a/libexec/rc/rc.d/zfs b/libexec/rc/rc.d/zfs index 2d35f9b5464..5181fbbbb7f 100755 --- a/libexec/rc/rc.d/zfs +++ b/libexec/rc/rc.d/zfs @@ -25,7 +25,11 @@ zfs_start_jail() zfs_start_main() { - zfs mount -va + if checkyesno "${zfs_mount_encrypted}"; then + zfs mount -lav + else + zfs mount -va + fi zfs share -a if [ ! -r /etc/zfs/exports ]; then touch /etc/zfs/exports @@ -64,4 +68,6 @@ zfs_stop() } load_rc_config $name +: ${zfs_mount_encrypted:=no} run_rc_command "$1" + diff --git a/share/man/man5/rc.conf.5 b/share/man/man5/rc.conf.5 index 473406660b8..db036e20e8e 100644 --- a/share/man/man5/rc.conf.5 +++ b/share/man/man5/rc.conf.5 @@ -2007,6 +2007,15 @@ If set to .Pa /etc/rc.d/zfs will attempt to automatically mount ZFS file systems and initialize ZFS volumes (ZVOLs). +.It Va zfs_mount_encrypted +.Pq Vt bool +If set to +.Dq Li YES , +.Pa /etc/rc.d/zfs +will attempt to automatically load keys for encrypted ZFS file systems and +will include these encrypted file systems when mounting if +.Pa zfs_enable +is enabled. .It Va gptboot_enable .Pq Vt bool If set to