LVM Volume Group (vg)
commands related to managing Volume Groups (VGs) in LVM (Logical Volume Manager). Here's an overview of commands related to managing Volume Groups (vg) in LVM:
Volume Groups (VGs) in LVM manage one or more physical volumes (PVs) and provide logical storage units for Logical Volumes (LVs).
Basic Commands
Creating a Volume Group:
vgcreate [options] vg_name /dev/sdX /dev/sdY ...Creates a new volume group named
vg_nameusing physical volumes/dev/sdX,/dev/sdY, etc.Displaying Volume Group Information:
vgdisplay [vg_name]Displays information about all volume groups or a specific
vg_name.Adding Physical Volumes to a Volume Group:
vgextend vg_name /dev/sdZAdds
/dev/sdZto the existing volume groupvg_name.Removing Physical Volumes from a Volume Group:
vgreduce vg_name /dev/sdZRemoves
/dev/sdZfrom the volume groupvg_name.Renaming a Volume Group:
vgrename old_vg_name new_vg_nameRenames
old_vg_nametonew_vg_name.Removing a Volume Group:
vgremove vg_nameRemoves the volume group
vg_name.Resizing a Volume Group:
vgextend vg_name /dev/sdXIncreases the size of the volume group
vg_nameby adding/dev/sdX.
Advanced Commands
Moving Physical Extents (PEs):
pvmove /dev/sdXMoves allocated physical extents from
/dev/sdXto other physical volumes in the volume group.Changing Volume Group Attributes:
vgchange -a y vg_nameActivates (mounts) a volume group (
-a y) or deactivates (-a n) it.Listing Physical Volumes in a Volume Group:
pvdisplay -mLists detailed information about physical volumes and their mappings to logical volumes.
Conclusion
The vg commands in LVM (vgcreate, vgdisplay, vgextend, etc.) are essential for managing volume groups and the logical storage they provide. They allow administrators to efficiently allocate and manage disk space, resize volumes, and ensure data integrity through advanced features like mirroring and striping. For more detailed information and options, refer to the respective manual pages (man vgcreate, man vgdisplay, etc.) or the LVM documentation.
Last updated