How to add more space in AWS XFS file system - HaymonEdmur/DockerConfiguration GitHub Wiki

How to Add more space to xfs mounted file system?

  • You can use console or awscli to add more space to a volume of xfs file system
  • No need to umount the file system
  • Following command modifies file system data structure to add more space
# xfs_growfs -d  /var/DockerData 

systemd mount file to mount file system at reboot

  • The file name for mount file should specify mounting directory
  • If mounting directory is /A/B/C/database then file name should be A-B-C-database.mount
[root@ip-40-40-0-181 system]# pwd
/usr/lib/systemd/system

# ls -l var-DockerData.mount
-rw-r--r-- 1 root root 138 Oct 25 17:47 var-DockerData.mount

# cat var-DockerData.mount
[Unit]
Description=Docker Engine File System

[Mount]
What=/dev/xvdf
Where=/var/DockerData
Type=xfs

[Install]
WantedBy=multi-user.target

Device File

  • Detach/Attach may change device file.
  • Always confirm your device file by lsblk
# lsblk
NAME    MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda    202:0    0   8G  0 disk
└─xvda1 202:1    0   8G  0 part /
xvdf    202:80   0  10G  0 disk /var/DockerData
⚠️ **GitHub.com Fallback** ⚠️