I have a VPS running on Centos 7 and I have upgraded my VPS account from one with 20 GB of disk space to another with 40 GB, but they don't support extending the partition to the current bigger one.
As you can see, the space in the 20 GB partition currently and is almost full, so I cannot make a backup easily.
I need to be sure that I can extend this partition to 40 GB safely.
I have read on Internet the following steps, and I would like to confirm with the community if I am right and the process is safe or not 100% or 95% (I understand that accidents could happen, but I mean in normal conditions)
The steps are ...
- SSH inside your VPS: sudo growpart /dev/sda 1
- Resize your file system: sudo resize2fs /dev/sda1
- Verify: df -h
- sudo reboot
What do you think? Is it safe to do it and the partition will extend to 40 GB rightly? in normal conditions of course.
Let me know if you want me to do more shell commands before.
I have attached an image describing the current status of my partition and hard disk.
Thank you very much in advance, indeed.
sudo growpart -N /dev/sda 1
I get this. Seems is OK to do the remaining tasks.