• create VG
pvcreate /dev/mapper/...
vgcreate vg0 ...
lvcreate -L10G -nimagename vg0
  • extend the size of lv
lvextend -L +25GB /dev/vg0/some-disk
e2fsck -f /dev/vg0/some-disk
resize2fs /dev/vg0/some-disk
  • reduce size of lv
resize2fs /dev/myvg/homevol 524288
lvreduce -L -1G /dev/myvg/homevol
  • add hard disk to lvm
  1. Format the disk to an ext3 file system by running 'cfdisk /dev/(device identifier)'
  2. Run 'pvscan' to make sure you can see the new physical volume
  3. Run 'pvcreate /dev/(device)' to create the partition
  4. Use vgextend to add the new hard disk to the volume group (eg vgextend vg0 /dev/sdb1)
  5. Unmount the LVM (eg umount /dev/vg0)
  6. Extend the volume groups using lvextend for each machine (eg lvextend -L+10GB /dev/vg0/maze)
  7. Check the file systems using e2fsck (eg e2fsck -f /dev/vg0/maze)
  8. Resize the partition using resize2fs (eg resize2fs /dev/vg0/sorb-disk)
  9. Remount the volume group (eg mount /dev/vg0)
  10. pvcreate /dev/(device)
  11. vgextend vg0 /dev/(device)

  • Mount lvm partitions
    • create mapping
kpartx -a /dev/VolGroup01/hardy1-disk
    • device /dev/mapper/hardy1-disk1 will be created
    • delete mapping
kpartx -d /dev/VolGroup01/hardy1-disk
    • create an LVM snapshot
lvcreate -L 1G -s -n $SNAPSHOT $VMDISK
    • dd snapshot to a file
dd if=$SNAPSHOT 2>/dev/null|gzip > $BACKUPFILE 
    • restore the lvm from the file
gunzip -c snapshot.img.gz|dd of=/dev/vg0/destination-disk   
    • copy and restore with dd over ssh
dd if=/dev/vg0/source-lvm-disk | pv| gzip | ssh root@<targethost> 'gunzip | dd of=/dev/vg0/destination-lvm-disk'
    • or
ssh root@destination 'dd if=/dev/vg0/source-lvm-disk | gzip'  | gunzip | dd of=/dev/vg0/destination-lvm-disk
  • Merge Snapshots
    • take snapshot
lvcreate -L 5G -s -n $SNAPSHOT $VMDISK
    • restore back from the snapshot
lvconvert --merge $SNAPSHOT

  • fix broken VG
    • run, to determine which device is missing
vgdisplay --partial --verbose
multipath -ll
    • determine the latest lvm archive log
ls -latr /etc/lvm/archive/
    • recreate the metadata for missing disk
pvcreate --uuid "XUo7SJ-mbie-vMfI-9dqd-gaLf-UYp9-Jawvl7" --restorefile /etc/lvm/archive/vg0_00085.vg  /dev/mapper/mpath3
    • restart the lvm
/etc/init.d/lvm restart

Add new attachment

Only authorized users are allowed to upload new attachments.
« This page (revision-1) was last changed on 24-May-2017 15:30 by Hyve Support
G’day (anonymous guest) My Prefs
  • View Page Source
  • This clear IPSec security association,
    clear ipsec sa peer X.X.X.X

All Pages

Page views: 1650

Private Tomcat




SQL Server




Web Mail

Windows Plesk

Linux Plesk




Persits ASPUpload

Wiki Help

Referring Pages:

JSPWiki v2.8.1