configurable vol_opt (e.g. compression)
[sysadmin-cookbook] / recepies / ganeti / restore-to-zfs-vol.sh
index 91a9d83..5d2736f 100755 (executable)
@@ -2,15 +2,14 @@
 
 pool=workshop
 
-instance=koha.ffzg.hr
 size=60G
-instance=prod.vbz.ffzg.hr
-instance=bookreader.rot13.org
+vol_opt="-b 4k -s"
+#vol_opt="-b 4k -s -o compression=lz4"
 
 if [ -z "$1" ] ; then
        zfs list -r $pool/block
        echo
-       test -e "/mnt/*" && df -h /mnt/* | grep -v aufs
+       test ! -z "/mnt/*" && df -h /mnt/* | grep -v aufs
        echo
        du -hcs /$pool/ganeti/export/* | cut -d/ -f1,5
        exit 1
@@ -21,7 +20,7 @@ fi
 umount /mnt/$instance || true
 zfs destroy $pool/block/$instance || true
 
-zfs create -V $size -b 4k -s $pool/block/$instance
+zfs create -V $size $vol_opt $pool/block/$instance
 
 test -d /mnt/$instance || mkdir /mnt/$instance