Monday, September 7, 2009

Volume Group

Create a VG:
# vgcreate vg00 /dev/hda1 /dev/hdb1

Create a VG by mentioning the PE size:
# vgcreate -s 10M vg01 /dev/hda1 /dev/hdb1

To display all the VGs:
# vgdisplay

To display more info on a particular VG:
# vgdisplay -v vgname

To display only active VGs:
# vgdisplay -A

Activate a VG :
# vgchange -a y vgname

De-activate a VG:
# vgchange -a n vgname

Extend a VG:
# vgextend vgname /dev/hdb1 /dev/hdc2

Reduce a VG:
# vgreduce vgname /dev/hdc2

Remove a VG:
# vgremove vgname

Import a VG into a system:
# vgimport vgname

Export a VG from a system:
# vgexport vgname

To learn new VGs:
# vgscan

To backup VGDA to /etc/lvm/backup/vg_name:
# vgcfgbackup vgname

To restore VG meta data from /etc/lvm/backup/vg_name or a file to the disk
# vgcfgrestore -f filename -n vgname vgname

To recreate VG directory and logical volume special files:
# vgmknodes vgname

No comments: