mount zfs snapshots read-only

This commit is contained in:
Motiejus Jakštys 2023-07-26 15:36:11 +03:00
parent 936286a847
commit 8cecf18f43
1 changed files with 1 additions and 1 deletions

View File

@ -8,7 +8,7 @@
set -euo pipefail
${pkgs.util-linux}/bin/umount ${mountpoint}/.snapshot-latest &>/dev/null || :
mkdir -p ${mountpoint}/.snapshot-latest
${pkgs.util-linux}/bin/mount -t zfs $(${pkgs.zfs}/bin/zfs list -H -t snapshot -o name ${zfs_name} | sort | tail -1) ${mountpoint}/.snapshot-latest
${pkgs.util-linux}/bin/mount -t zfs -o ro $(${pkgs.zfs}/bin/zfs list -H -t snapshot -o name ${zfs_name} | sort | tail -1) ${mountpoint}/.snapshot-latest
'';
umountLatest = mountpoint: ''