Monday, August 29, 2016

LVM

LVM Components:

Create in this order:
  • physical volumes
  • volume groups
  • logical volumes

Physical Volumes:
  • pvcreate <device>
  • pvscan -v
Volume Groups:
  •  vgcreate <volume_group_name> <physical_volume1><physical_volume2> ...
  • pvscan -v
Additional volume group commands:
  • vgexpand: add additional physical volumes to volume group
  • vgreduce: remove physical volume. Run pvmove first to move data to another physical volume
  • vgremove: delete volume group first, remove all logical volumes

Creating Logical Volumes:
  •  lvcreate -L <volume_size> -n <volume_name> <volume_group_name>
  • -->lvcreate -L 7G -n research Data

Additional logical volume management commands:
  • lvextend: increase size of logical volume. you must first add additional physical volume(s)
  • lvreduce: reduce size of logical volume
  • lvremove: remove logical volume. Use caution when using lvremove, you could chop off data  

No comments:

Post a Comment