I had a Linux LVM volume that was about 400 GB. I shrank it to 217 GB following the steps below.
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
And then I resized the physical volume to 260 GB with pvresize
. If I do pvdisplay
and lvdisplay
now, I get:
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
How can I revert these steps? That is, to resize the physical volume and the logical volume back to their original sizes.