Increasing the Size of a Volume
You can extend the storage capacity of an existing volume without losing the data stored on it.
You can resize any volume, whether it is the root device where the operating system of the virtual machine (VM) is installed, or a secondary volume of the VM.
Linux VM
Increasing the Size of a Root Device in Linux
-
Stop the VM. For more information, see Stopping and Starting VMs.
-
Update the size of the volume. For more information, see the UpdateVolume method in the documentation of the OUTSCALE API, which includes an OSC CLI command sample.
-
Start the VM. For more information, see Stopping and Starting VMs.
For VMs created from official OUTSCALE Machine Images (OMIs), the cloud-init package automatically adjusts the file system of the root device after it is resized. For more information, see the cloud-init official documentation. |
Increasing the Size of a Secondary Volume in Linux
Unmount the Volume
-
Connect to your VM. For more information, see Accessing Your VMs.
-
(optional) To get the device name of the volume you 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 volume from the VM. For more information, see Detaching a Volume from a VM.
-
Update the size of the volume. For more information, see the UpdateVolume method in the documentation of the OUTSCALE API, which includes an OSC CLI command sample.
-
Reattach the volume to the VM. For more information, Attaching a Volume to a VM.
Configure the File System of the Volume
-
Inside the VM, to remount the volume at /MOUNT_POINT, run the following command:
$ sudo mount /dev/DEVICE_NAME /MOUNT_POINT
-
Resize the file system of the volume:
-
To resize an ext4 file system, run the following command:
$ sudo resize2fs /dev/DEVICE_NAME
-
To resize 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.
-
Windows VM
Increasing the Size of a Root Device in Windows
Increase the Size of the Volume
-
Stop the VM. For more information, see Stopping and Starting VMs.
-
Update the size of the volume. For more information, see the UpdateVolume method in the documentation of the OUTSCALE API, which includes an OSC CLI command sample.
-
Start the VM. For more information, see Stopping and Starting VMs.
Configure the File System of the Volume
-
Connect to your VM. For more information, see Accessing a Windows VM.
-
Click the Start menu, type diskmgmt.msc, and click the program that appears.
-
Right-click the volume and select Extend volume.
The Extend Volume Wizard appears. -
Keep the default information and click Next.
-
Click Finish to validate.
The volume is configured, and its file system appears in the Disk Management list.
Increasing the Size of a Secondary Volume in Windows
Increase the Size of the Volume
-
Connect to your VM. For more information, see Accessing a Windows VM.
-
Click the Start menu, type diskmgmt.msc, and click the program that appears.
-
In the bottom-left panel, right-click the disk corresponding to the volume you want to unmount, then click Offline.
-
Detach the volume from the VM. For more information, see Detaching a Volume from a VM.
-
Update the size of the volume. For more information, see the UpdateVolume method in the documentation of the OUTSCALE API, which includes an OSC CLI command sample.
-
Reattach the volume to the VM. For more information, Attaching a Volume to a VM.
Configure the File System of the Volume
-
Inside the VM, in the bottom-left panel, right-click the disk corresponding to the volume you want to mount, then click Online.
-
Right-click the volume and select Extend volume.
The Extend Volume Wizard appears. -
Keep the default information and click Next.
-
Click Finish to validate.
The volume is configured, and its file system appears in the Disk Management list.
Related Pages