LVM
How to reduce LVM Logical volume on production server.
While online enlarging is no problem, you have to umount for shrinking!
Perform a check of the filesystem...
Resize the filesystem first.
Then reduce the size of the logical volume.
After that you can shrink down the volume group if desired.
Warning: It is crucial that you use the exact amount of space. If
you reduce volume more than the filesytem you truncate the logical
volume and you risk data loss!
How to reduce LVM Logical volume on production server.
While online enlarging is no problem, you have to umount for shrinking!
Code:
# umount /dev/vg_blah/lv_blah
Code:
# e2fsck -f /dev/vg_blah/lv_blah
Code:
# resize2fs /dev/vg_blah/lv_blah 9G
Code:
# lvreduce -L -1G /dev/vg_blah/lv_blah
Code:
# vgreduce vg_blah /dev/sdxy
Resize LVMs
a. 'lvresize -L 6GB
/dev/volgroupvar/logvolvar'
b. 'resize2fs /dev/volgroupvar/logvolvar 6G'
c. 'lvresize -L 4GB
/dev/volgroupvar/logvolvar'
d. 'resize2fs /dev/volgroupvar/logvolvar 4G'
Note: Reductions
will likely return errors resulting in re-provisioning of the FS, LVM reduce should execute on run level 1/single user mode.
No comments:
Post a Comment