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