tus available
# open 2
LV Size 6.00 GiB
Current LE 1536
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:1
--- Logical volume ---
LV Path /dev/openeuler/root
LV Name root
VG Name openeuler
LV UUID i3ZktA-EN9t-HJB3-y1Ok-Or1X-z0uq-3ixcbG
LV Write Access read/write
LV Creation host, time O-Friday, 2023-03-05 10:52:54 +0800
LV Status available
# open 1
LV Size <92.00 GiB
Current LE 23551
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 8192
Block device 253:0
12. 删除VG
If there are no logical volumes associated with the volume group(VG) and if the VG is no longer required, then remove that as well.
[root@O-Friday ~]# vgchange -an vg01
0 logical volume(s) in volume group "vg01" now active
[root@O-Friday ~]# vgdisplay
--- Volume group ---
VG Name vg01
System ID
Format lvm2
Metadata Areas 2
Metadata Sequence No 11
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 0
Open LV 0
Max PV 0
Cur PV 2
Act PV 2
VG Size 19.99 GiB
PE Size 4.00 MiB
Total PE 5118
Alloc PE / Size 0 / 0
Free PE / Size 5118 / 19.99 GiB
VG UUID oAbeGg-j8U2-kCuO-tcmW-HQWv-MqbT-kQdipr
--- Volume group ---
VG Name openeuler
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <98.00 GiB
PE Size 4.00 MiB
Total PE 25087
Alloc PE / Size 25087 / <98.00 GiB
Free PE / Size 0 / 0
VG UUID I7kRIn-4XeX-0agf-OxRq-ehSi-hqJf-nvkmtU
[root@O-Friday ~]# vgremove vg01
Volume group "vg01" successfully removed
[root@O-Friday ~]# vgdisplay
--- Volume group ---
VG Name openeuler
System ID
Format lvm2
Metadata Areas 1
Metadata Sequence No 3
VG Access read/write
VG Status resizable
MAX LV 0
Cur LV 2
Open LV 2
Max PV 0
Cur PV 1
Act PV 1
VG Size <98.00 GiB
PE Size 4.00 MiB
Total PE 25087
Alloc PE / Size 25087 / <98.00 GiB
Free PE / Size 0 / 0
VG UUID I7kRIn-4XeX-0agf-OxRq-ehSi-hqJf-nvkmtU
13. 删除pv
Delete physical volumes used for volume group **“vg01”**:
[root@O-Friday ~]# pvremove /dev/sdb /dev/sdc
Labels on physical volume "/dev/sdb" successfully wiped.
Labels on physical volume "/dev/sdc" successfully wiped.
[root@O-Friday ~]# pvdisplay
--- Physical volume ---
PV Name /dev/sda2
VG Name openeuler
PV Size <98.00 GiB / not usable 3.00 MiB
Allocatable yes (but full)
PE Size 4.00 MiB
Total PE 25087
Free PE 0
Allocated PE 25087
PV UUID Yv3d0c-OjcH-8s93-MsfZ-1JUu-XwU3-NYyPYD
14. 缩减逻辑卷大小
如果已经挂载, 先umount
[root@O-Friday mapper]# resize2fs /dev/mapper/vg01-lv001 20G
resize2fs 1.46.4 (18-Aug-2021)
Please run 'e2fsck -f /dev/mapper/vg01-lv001' first.
[root@O-Friday mapper]# e2fsck -f /dev/mapper/vg01-lv001
e2fsck 1.46.4 (18-Aug-2021)
Pass 1: Checking inodes, blocks, and sizes
Pass 2: Checking directory structure
Pass 3: Checking directory connectivity
Pass 4: Checking reference counts
Pass 5: Checking group summary information
/dev/mapper/vg01-lv001: 11/1966080 files (0.0% non-contiguous), 167453/7861248 blocks
[root@O-Friday mapper]# resize2fs /dev/mapper/vg01-lv001 20G
resize2fs 1.46.4 (18-Aug-2021)
Resizing the filesystem on /dev/mapper/vg01-lv001 to 5242880 (4k) blocks.
The filesystem on /dev/mapper/vg01-lv001 is now 5242880 (4k) blocks long.
[root@O-Friday mapper]# lvreduce -L 20G /dev/mapper/vg01-lv001
WARNING: Reducing active logical volume to 20.