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
EXT4resize2fs /dev/sdaX
XFSxfs_growfs /dev/sdaX
- Run
df -h
to determine if the resize is succesful
Updated on: 25/01/2022
Thank you!