- Run the below command to check the current root disk capacity
# lsblk
You can see in the above output that the/is mounted on/dev/vda3and its size is247G. But the total disk is300Gin this server. - The first step you need to do to expand the disk space is to install the necessary tools. Run the below command to install cloud utils.
On Ubuntu / Debian system, run the below command:# apt -y install cloud-guest-utils gdiskOn CentOS system, run the below command:# yum -y install cloud-utils-growpart gdisk
- Now run the below command to extend your partition and it will resize partition
3on/dev/vda.# growpart /dev/vda 3
- Again, run the below command to Validate the changes and you can see here that
/dev/vda3is extended to297G.# lsblk
- Now run the below command to resize
/partition to fill all space.
For ext4 file system, run the below command:# resize2fs /dev/vda3For XFS file system, run the below command:# xfs_growfs /
- You can verify the new size using the below command.
# df -hT | grep /dev/vda