Reversing an lvreduce of LVM to original size

Posted by praspa on Server Fault See other posts from Server Fault or by praspa
Published on 2012-11-19T13:27:36Z Indexed on 2012/11/20 5:01 UTC
Read the original article Hit count: 464

Filed under:
|
|

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?

© Server Fault or respective owner

Related posts about redhat

Related posts about lvm