The need of LVM extend is when we require extra disk space to store the raw data.
First we have to provide the storage or extra hardware to volume group.
Extend the Volume Group :-
# vgextend <vg name> <new pv>
# vgdisplay
Extend the LV size:-
# lvextend –size +1G /dev/vgname/lvname
extend the label size
# lvextend -l +<Label Amount> /dev/vgname/lvname
# resize2fs –f /dev/vgname/lvname
# lvdisplay
#df -h
Reduce the size of LVM
If you have extra space in LV and you don't want to pay extra money for your extra storage you can remove or reduce the extra space.
Follow the bellow mention steep:-
#umount /directoryname
# e2cfsck –f /dev/vgname/lvname
# resize2fs –f /dev/vgname/lvname 1G <Size you want to reduce>
# lvreduce –size 1G /dev/vgname/lvname or
# lvreduce -l <label amount> /dev/vgname/lvname
# mount
/dev/vgname/lvname /mountDIR
Removing the LV, VG, PV
First umount the mounting directory
#umount <lv path> <mountDIR>
# lvremove <lv name>
# vgremove <vg name>
# pvremove <pv name>
0 comments:
Post a Comment