How to extend xfs file system in Linux?

Use the xfs_growfs command to extend the size of an XFS file system. The XFS file system must be mounted and there must be available space to extend on the underlying logical volume.

The commands  that we  will use at this post;

  • vgdisplay
  • pvdisplay
  • pvs
  • vgs
  • lvs
  • lvdisplay
  • vgextend
  • lvextend
  • pvcreate
  • xfs_growfs

Check existing  configuration

#df  -h  /appdata

/dev/mapper/vgappdata-lvappdata  1,6G 2,3M 1,6G 1% /appdata



#vgdisplay  -v vgappdata



Add  new disk to Volume  Group

#pvcreate <disk_name>

#pvcreate  /dev/sdh

#vgextend  vgappdata /dev/sdh 


-Check free  pv  size

#vgdisplay vgappdata

-We  added  new  200  pv  to logical volume

#lvextend  -l  +200 /dev/mapper/vgappdata-lvappdata

#lvdisplay  /dev/mapper/vgappdata-lvappdata 

Extend  File System

#xfs_growfs  /appdata

Check File System

#df -h


I'm a IT Infrastructure and Operations Architect with extensive experience and administration skills and works for Turk Telekom. I provide hardware and software support for the IT Infrastructure and Operations tasks.

205 Total Posts
Follow Me