/[sysadmin-cookbook]/recepies/ganeti/restore-to-zfs-vol.sh
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /recepies/ganeti/restore-to-zfs-vol.sh

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 320 by dpavlin, Mon Jun 23 00:41:03 2014 UTC revision 321 by dpavlin, Mon Jun 23 09:50:59 2014 UTC
# Line 2  Line 2 
2    
3  pool=workshop  pool=workshop
4    
 instance=koha.ffzg.hr  
5  size=60G  size=60G
6  instance=prod.vbz.ffzg.hr  vol_opt="-b 4k -s"
7  instance=bookreader.rot13.org  #vol_opt="-b 4k -s -o compression=lz4"
8    
9  if [ -z "$1" ] ; then  if [ -z "$1" ] ; then
10          zfs list -r $pool/block          zfs list -r $pool/block
11          echo          echo
12          test -e "/mnt/*" && df -h /mnt/* | grep -v aufs          test ! -z "/mnt/*" && df -h /mnt/* | grep -v aufs
13          echo          echo
14          du -hcs /$pool/ganeti/export/* | cut -d/ -f1,5          du -hcs /$pool/ganeti/export/* | cut -d/ -f1,5
15          exit 1          exit 1
# Line 21  fi Line 20  fi
20  umount /mnt/$instance || true  umount /mnt/$instance || true
21  zfs destroy $pool/block/$instance || true  zfs destroy $pool/block/$instance || true
22    
23  zfs create -V $size -b 4k -s $pool/block/$instance  zfs create -V $size $vol_opt $pool/block/$instance
24    
25  test -d /mnt/$instance || mkdir /mnt/$instance  test -d /mnt/$instance || mkdir /mnt/$instance
26    

Legend:
Removed from v.320  
changed lines
  Added in v.321

  ViewVC Help
Powered by ViewVC 1.1.26