Reversing an lvreduce of LVM to original size
- by praspa
On a RHEL system that uses LVM 2 with 4K blocks. Have been successful in reducing the LV, but trying to get steps to reverse the operation so that the LV returns to its original size.
Using these steps to reduce the LV by 1GB,
# umount /foo
# e2fsk -f /dev/mylvm/foo
# resize2fs /dev/mylvm/foo <Current LV Block count - 1GB/4K>
# lvreduce --size <Current # GB - 1GB> /dev/mylvm/foo
Then to reverse the reduction
# lvextend --size <Original #GB> /dev/mylvm/foo
# resize2fs /dev/mylvm/foo
The reversal gets close to the orignal size. A 'df -h' reports that it seems to be about ~ 0.1GB shy of the original size.
Using these utilities, is there a better procedure to shrink and grow the LV so that the original state can be recovered effectively?