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.
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
This action requires the following IAM (Identity and Access Management) permissions:
- compute.blockStorage.update
- Linux
- Windows
Increase the size of a system volume in Linux
- Stop the VM.
- From the left-hand side menu, click Storage → Block Storage → Volumes.
- Select the system
volume. - Click Modify.
- In the "Size" field, enter the new size of the
volume. - Click Modify.
- Start the VM.
Increase the size of a secondary volume in Linux
Unmount the volume
- Connect to the VM.
- (optional) To obtain the device name corresponding to the
volumeyou want to unmount, run the following command to display the list of devices attached to the VM:$ lsblk - To unmount the
volume, run the following command:$ sudo umount /dev/DEVICE_NAME
Increase the size of the volume
- Detach the
volumefrom the VM. - Modify the size of the
volume. - Reattach the
volumeto the VM.
Configure the file system of the volume
- Inside the VM, to remount the
volumeon /MOUNT_POINT, run the following command:$ sudo mount /dev/DEVICE_NAME /MOUNT_POINT - 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 -hTcommand to view the sizes of your file systems.
The file system of the volume is configured.
Increase the size of a system volume in Windows
Increase the size of the volume
- Stop the VM.
- Modify the size of the
volume. - Start the VM.
Configure the file system of the volume
-
Connect to your VM.
-
Click the Start menu, type "diskmgmt.msc" and click the program that appears.
-
Right-click the
volumeand select Extend Volume.The Extend Volume Wizard appears.
-
Keep the default information and click Next.
-
Click Finish to confirm.
The
volumeis configured and its file system appears in the "Disk Management" list.
Increase the size of a secondary volume in Windows
Increase the size of the volume
- Connect to your VM.
- Click the Start menu, type "diskmgmt.msc" and click the program that appears.
- In the bottom left-hand panel, right-click the disk corresponding to the
volumeyou want to unmount, then click Offline. - Detach the
volumefrom the VM. - Modify the size of the
volume. - Reattach the
volumeto the VM. For more information, see Attach avolumeto a VM.
Configure the file system of the volume
-
Inside the VM, in the bottom left-hand panel, right-click the disk corresponding to the
volumeyou want to mount, then click Online. -
Right-click the
volumeand select Extend Volume.The Extend Volume Wizard appears.
-
Keep the default information and click Next.
-
Click Finish to confirm.
The
volumeis configured and its file system appears in the "Disk Management" list.