increase / expand xfs filesystem in centos 7

increase / expand xfs filesystem in centos 7

To see the info of your block device, use xfs_info.

$ xfs_info /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

Once the volume group/logical volume has been extended , you can expand the partition using xfs_growfs.

$  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

The increase will happen in near-realtime and probably won’t take more than a few seconds.

Using just xfs_growfs, the filesystem will be increased to its maximum available size. If you want to only increase for a couple of blocks, use the -D option.

One Response so far.

  1. Hi,
    xfs_growfs /dev/mapper/centos-root command should be xfs_growfs /

Leave a Reply

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

9 − eight =

This site uses Akismet to reduce spam. Learn how your comment data is processed.