How to increase logical volumes on RHEL/Centos 7

Assuming you have enough space on your volume group, just run the following:

lvextend /dev/VolGroupxx /dev/sdXXv

where VolGroupxx = volume group
and     /dev/sdXXv = device name/physical volume


lvextend /dev/VolGroup00/LogVol00 /dev/sdb

Next you want to resize the logical volume, and on Rhel/Centos 7 which uses xfs the resize2fs command wil spew the following error.

$ resize2fs /dev/mapper/centos_sql01-root
resize2fs 1.42.9 (28-Dec-2013)
resize2fs: Bad magic number in super-block while trying to open /dev/mapper/centos_sql01-root
Couldn't find valid filesystem superblock.

In this case, you should run below

$  xfs_growfs /dev/mapper/centos-root
meta-data=/dev/mapper/centos-root isize=256    agcount=4, agsize=1210880 blks
         =                       sectsz=512   attr=2, projid32bit=1
         =                       crc=0
data     =                       bsize=4096   blocks=4843520, imaxpct=25
         =                       sunit=0      swidth=0 blks
naming   =version 2              bsize=4096   ascii-ci=0 ftype=0
log      =internal               bsize=4096   blocks=2560, version=2
         =                       sectsz=512   sunit=0 blks, lazy-count=1
realtime =none                   extsz=4096   blocks=0, rtextents=0

Leave a Reply

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