RH134 - Chapter 7: Managing Logical Volumes
vgextend
Add the new physical volume to the volume group.
Logical volumes (LVs)
Are created from free physical extents in a volume group and provide the "storage" device used by applications, users, and the operating system. LVs are a collection of logical extents (LEs), which map to physical extents, the smallest storage chunk of a PV. By default, each LE maps to one PE. Setting specific LV options changes this mapping; for example, mirroring causes each LE to map to two PEs.
Volume groups (VGs)
Are storage pools made up of one or more physical volumes. This is the functional equivalent of a whole disk in basic storage. A PV can only be allocated to a single VG. A VG can consist of unused space and any number of logical volumes.
Physical devices
Are the storage devices used to save data stored in a logical volume. These are block devices and could be disk partitions, whole disks, RAID arrays, or SAN disks. A device must be initialized as an LVM physical volume in order to be used with LVM. The entire device will be used as a physical volume.
Physical volumes (PVs)
Are the underlying "physical" storage used with LVM. You must initialize a device as a physical volume before using it in an LVM system. LVM tools segment physical volumes into physical extents (PEs), which are small chunks of data that act as the smallest storage block on a physical volume.
vgcreate
Collects one or more physical volume into a volume group. Command-line consists of a volume group name followed by one or more physical volumes to allocate to this volume group.
pvcreate
Command divides the physical volume into physical extents (PEs) of a fixed size, for example 4 MiB blocks. Labels the partition (or other physical device) as a physical volume.
pvmove
Command to move data from extents on one physical volume to extents on other physical volumes in the volume group. In this way, a new disk can be added to an existing volume group, data can be moved from an older or slower disk to a new disk, and the old disk removed from the volume group. You can perform these actions while the logical volumes in the volume group are in use.
lvremove DEVICE_NAME
Command to remove a logical volume that is no longer needed. Unmount the LV file system before running this command.
vgremove VG_NAME
Command to remove a volume group that is no longer needed.
pvremove
Command to remove physical volumes that are no longer needed. Use a space-delimited list of PV devices to remove more than one at a time.
lvcreate
Creates a new logical volume from the available physical extents in a volume group.
lvdisplay
Displays information about logical volumes. If you provide no argument to the command, it displays information about all LVs; if you provide an LV device name as an argument, the command displays information about that specific device.
pvdisplay
Displays information about physical volumes. To list information about all physical volumes, use the command without arguments. To list information about a specific physical volume, pass that device name to the command.
vgdisplay
Displays information about volume groups. To list information about all volume groups, use the command without arguments. To list information about a specific volume group, pass that VG name to the command.
lvcreate -n
Set the LV name.
lvcreate -L
Set the LV size in bytes.
lvcreate -l
Set the LV size in extents, and the name of the volume group hosting this logical volume.
xfs_growfs mountpoint
To expand the file system to occupy the extended LV.
resize2fs /dev/vgname/lvname
To expand the file system to occupy the new extended LV.
lvextend LV_DEVICE_NAME
To extend the logical volume to a new size.
vgreduce VG_NAME PV_DEVICE_NAME
To remove a physical volume from a volume group.