Skip to main content

Increase the size of a volume

You can increase the storage capacity of an existing volume without losing the data stored on it.

You can modify the size of any type of volume, whether it is a system volume on which the operating system of the VM (Virtual Machine) is installed, or a secondary volume of the VM.

info

For VM created from an Image, the cloud-init package automatically adjusts the file system of the system volume after its size has been modified. For more information, see the official cloud-init documentation (in English).

Permissions

info

This action requires the following IAM (Identity and Access Management) permissions:

  • compute.blockStorage.update

Increase the size of a system volume in Linux

  1. Stop the VM.
  2. From the left-hand side menu, click StorageBlock StorageVolumes.
  3. Select the system volume.
  4. Click Modify.
  5. In the "Size" field, enter the new size of the volume.
  6. Click Modify.
  7. Start the VM.

Increase the size of a secondary volume in Linux

Unmount the volume

  1. Connect to the VM.
  2. (optional) To obtain the device name corresponding to the volume you want to unmount, run the following command to display the list of devices attached to the VM:
    $ lsblk
  3. To unmount the volume, run the following command:
    $ sudo umount /dev/DEVICE_NAME

Increase the size of the volume

  1. Detach the volume from the VM.
  2. Modify the size of the volume.
  3. Reattach the volume to the VM.
Configure the file system of the volume
  1. Inside the VM, to remount the volume on /MOUNT_POINT, run the following command:
    $ sudo mount /dev/DEVICE_NAME /MOUNT_POINT
  2. Modify the size of the file system of the volume:
    • To modify the size of an ext4 file system, run the following command:
    $ sudo resize2fs /dev/DEVICE_NAME
    • To modify the size of an XFS file system, run the following command:
    $ sudo xfs_growfs /dev/DEVICE_NAME
    • (optional) Run the df -hT command to view the sizes of your file systems.

The file system of the volume is configured.