LVM Maintain¶
1. LVM Creation¶
- 1.1 Check the disk location
Check disk name and location
- 1.2 Create PV
PV: Physical Volum
- 1.3 Create VG
VG: Volum Group
- 1.4 Check the number of available PEs in the VG
PE:
- 1.5 Create LV and assign PEs
LV: Logical Volum
- 1.6 Format LVM partition
- 1.7 Mount LVM partition
Create mount point
Mount LVM to /data
Add mount point to
/etc/fstab(for automatically mount on startup)
grep -Fxq "/dev/vgdata/lvdata /data xfs defaults 0 0" /etc/fstab || echo "/dev/vgdata/lvdata /data xfs defaults 0 0" | sudo tee -a /etc/fstab
- 1.8 Check VG/LV
2. LVM Expansion¶
- 2.1 Add new disk and check the disk location
Check disk name and location
- 2.2 Create PV
- 2.3 Extend VG
Check VG/LV name, and LV location
Add new disk(PV) to existing VG
- 2.4 Extend LV
Confirm the remaining available space in the VG
Add the remaining available space to the LV
lvextend -l +2559 /dev/vgdata/lvdata
# parameter descrption:
# -l : add the specified number of PE
# -L : add the specified amount of space
- 2.5 Refresh LVM
Refresh the LVM partition
If the file system is ext, please use the following command to refresh the partition.
3. LVM Deletion¶
- 3.1 Check LVM and disk status
- 3.2 Umount the LVM file system
- 3.3 Remove the LV (you can view all LVs using
lvscanorlvdisplay)
- 3.4 Remove the "Active" lable of VG
- 3.5 Remove VG (you can view all VGs using
vgscanorvgdisplay)
- 3.6 Remove PG

