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
vgname:vgappdata
lvname:lvappdata
#vgdisplay -v vgappdata #pvs #lvs
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