LVM hierarchy (bottom to top ):
Ext3-> lv (logical volumn)-> pv (physical volumn)-> vg (volumn group)
LVM creation steps (for example, creating LVM on/dev/sdb ):
1. format the hard disk: fdisk/dev/sdb
N: Create a new disk partition (which can be a primary partition or an extended partition)
T: Change the partition to the Linux LVM format. The format is 8e.
W: Write and modify the above operations
2. Create pv: pvcreate/dev/sdb1
3. Create vg: vgcreate testvg/dev/sdb1
4. Create lv: lvcreate-L20G-n testlv testvg
5. Format lv: mkfs. ext3/dev/testvg/testlv
6. Complete
It is not recommended to use the lvreduce command to narrow down the lv partition. After multiple attempts, errors often occur in e2fsck-f.
Use the lvextend command to expand the lv partition:
1. lvextend-L + 20G/dev/testvg/testlv
2. e2fsck-f/dev/testvg/testlv
3. resize2fs/dev/testvg/testlv