Infomaniak Unmanaged Cloud Server increase partition size without data loss

I recently asked Infomaniak to increase size of allocated (available) disk space from 100 to 250GB.

But after reboot, on Ubuntu (16.04 Server) when I run df -h I see my volume still at 100GB size.

So what to do to expand my volume to new size but keeping data on it.


Solution 1:

I found the solution by myself and want to share it with you.

First of all, backup all data, before start this, we never know what could happen !

Step-by-step commands :

1) First you need to stop services depending on data of this volume, for me it was apache and mysql :

sudo service apache2 stop
sudo service mysql stop

2) After we unmount the /dev/vdb volume :

sudo umount /dev/vdb

3) Now we check the filesystem with fsck command :

sudo e2fsck -f /dev/vdb

4) Let's resize it with resize2fs :

sudo resize2fs /dev/vdb

5) Now the volume has the good size, we can re-mount it :

sudo mount /dev/vdb /your/mount/point

6) Restart service if you stopped them on 1) :

sudo service mysql start
sudo service apache2 start