Articles on: Linux

How to resize partition in Linux

SSH to your server as root user

Run df -Th | grep "^/dev" to get the device name & also the filesystem type (ext4,XFS,etc)





Grow the partition by running growpart /dev/sda X (where X is the device name and with space)

Once done, use the following command according to your filesystem type to enlarge the partition

EXT4
resize2fs /dev/sdaX

XFS
xfs_growfs /dev/sdaX

Run df -h to determine if the resize is succesful

Updated on: 25/01/2022

Was this article helpful?

Share your feedback

Cancel

Thank you!