1000 FAQs, 500 tutorials and explanatory videos. Here, there are only solutions!
Unmanaged cloud server: increasing the data storage volume (Linux)
This guide explains how to increase the storage volume of your unmanaged Cloud server once you’ve switched offer.
- 1 volume for the operating system of your choice (/dev/vda)
- 1 volume for your data storage (/dev/vdb): this is the one that will be increased
SSH commands to increase the storage volume
If you choose e.g. XFS, it’s necessary to install the appropriate tools (if they’re not already present):
sudo apt install xfsprogs
Then expand the volume with the following SSH commands:
sudo xfs_grow /dev/vdb
And if you choose EXT4:
sudo resize2fs /dev/vdb
Expanding the volume after an expansion of the storage volume
There are two possible scenarios once you’ve expanded the storage volume of your Linux cloud server. Note that no data is deleted when increasing the disk space by changing the offer of your unmanaged cloud.
First scenario:
Where the entire volume is used without partition, it’s not necessary to do a resizepart, as there’s no partition.
sudo umount /devdb
sudo fsck.ext4 -f /dev/vdb
sudo resize2fs /dev/vdb
Second scenario:
Where a volume contains a partition (/dev/vdb1), you must first stop the processes that use this volume and then unmount the partition.
sudo umount /dev/vdb1
You must then increase the size of the partition with parted which has the resizepart command, which is not the case with fdisk.
sudo umount /dev/db1
sudo parted /dev/vdb
GNU Parted 3.2
Using /dev/vdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) resizepart 1 100%
(parted) quit
sudo fsck.ext4 -f /dev/vdb1
sudo resize2fs /dev/vdb1