Extend Logical Volume size on RHEL/CentOS

Scenario: Extend/Growing Logical Volume size for /opt on RHEL/CentOS.
System: CentOS/RHEL 6/7

Login as root then follow below steps:
1) Check free size in Volume Group (vgs). If still there free size then continue to step-2.
# vgs

2) Check the LV Path of /opt.
# lvdisplay |grep opt

3) Based on our need,select 1 from 3 example below:
a. Example added 100MB to /opt.
# lvextend -L+100M /dev/VolGroup/lv_opt

b. Example extend /opt to 5.5GB.
# lvextend -L5.5G /dev/VolGroup/lv_opt

C. Example extend all remaining free size to /opt
# lvextend -l +100%FREE /dev/VolGroup/lv_opt

4) Once done,we can view the new size by type one of these command
# df -aTh
# lvs
# lvdisplay

Related posts:

Leave a Reply

Your email address will not be published. Required fields are marked *