我有一个大约 400 GB 的 Linux LVM 卷。我按照以下步骤将其缩小到 217 GB。
umount /local
e2fsck -f /dev/mapper/vg00-lvol2
resize2fs /dev/mapper/vg00-lvol2 217G
lvresize -L 217G /dev/mapper/vg00-lvol2
lvdisplay /dev/mapper/vg00-lvol2
mount /local
然后我用 将物理卷的大小调整为 260 GB pvresize
。如果我这样做,pvdisplay
现在lvdisplay
我得到:
lvm> pvdisplay
--- Physical volume ---
PV Name /dev/sda3
VG Name vg00
PV Size 260.00 GB / not usable 31.81 MB
Allocatable yes
PE Size (KByte) 32768
Total PE 8319
Free PE 250
Allocated PE 8069
PV UUID 6itmL0-3HAd-tmhA-a3u3-ketO-H7OO-MahFc7
lvm> lvdisplay
--- Logical volume ---
LV Name /dev/vg00/lvol1
VG Name vg00
LV UUID JFATdC-lqxK-wsBc-VgL1-33Xv-PUfb-Y28fk2
LV Write Access read/write
LV Status available
# open 1
LV Size 35.16 GB
Current LE 1125
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:0
--- Logical volume ---
LV Name /dev/vg00/lvol2
VG Name vg00
LV UUID F81eoe-xokM-Jqwr-NXND-VujX-BwN6-Kh0zZa
LV Write Access read/write
LV Status available
# open 1
LV Size 217.00 GB
Current LE 6944
Segments 1
Allocation inherit
Read ahead sectors auto
- currently set to 256
Block device 253:1
我如何恢复这些步骤?也就是说,将物理卷和逻辑卷的大小调整回其原始大小。
答案1
我建议您颠倒一下顺序:
pvresize
lvresize
resize2fs
我这里遗漏了什么吗?