Advertisement
42n4

XENDELETELSRLVMSMALLETTERS

Feb 6th, 2016
269
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.18 KB | None | 0 0
  1. #USE IT IN COMMAND LINE (without #):
  2. #curl http://pastebin.com/raw/kVmvNtZM > xendeletelocalsr.sh
  3. #tr -d "\015" < xendeletelocalsr.sh > xendeletelocalsrnew.sh
  4. #sh xendeletelocalsrnew.sh
  5. #uuid pbd http://blog.gluster.org/2012/
  6. sed -i -e "s/metadata_read_only = 1/metadata_read_only = 0/" /etc/lvm/lvm.conf
  7. hname=`hostname`
  8. #hname=`echo $hname | tr [:lower:] [:upper:]`
  9. sruuid=`xe sr-list host=$hname name-label=Local\ storage | cut -f20 -d" " | head -n 1`
  10. pbduid=`xe pbd-list sr-uuid=$sruuid | grep -E '^uuid' | cut -f2 -d":" | sed 's/\ //g'`
  11. xe pbd-unplug uuid=$pbduid
  12. xe sr-forget uuid=$sruuid
  13. #xe sr-destroy uuid=$sruuid
  14. vgremove `vgdisplay -C | tail -n1 | cut -f3 -d' '` -f
  15. dev4gfs=`pvdisplay -C | tail -n1 | cut -f3 -d' '`
  16. pvremove $dev4gfs -f
  17. pvcreate $dev4gfs
  18. vgname=lvm4gfs
  19. vgcreate $vgname $dev4gfs
  20. lvcreate -L 8G -n xen $vgname
  21. mkfs.ext4 -m 0 -j /dev/$vgname/xen
  22. mkdir -p /export/$hname-vol0
  23. #echo "/dev/$vgname/xen /export/$hname-vol0   ext4  rw,noatime,nodiratime,journal_checksum,data=journal,errors=panic,nodelalloc 1 2" >> /etc/fstab
  24. echo "/dev/$vgname/xen /export/$hname-vol0   ext4  rw,noatime,nodiratime,user_xattr,barrier=0,data=ordered 1 2" >> /etc/fstab
  25. mount -a
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement