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

  1. Stop the VM. For more information, see Stopping and Starting VMs.

  2. 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.

  3. 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

  1. Connect to your VM. For more information, see Accessing Your VMs.

  2. (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
  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. For more information, see Detaching a Volume from a VM.

  2. 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.

  3. Reattach the volume to the VM. For more information, Attaching a Volume to a VM.

Configure the File System of the Volume

  1. Inside the VM, to remount the volume at /MOUNT_POINT, run the following command:

    $ sudo mount /dev/DEVICE_NAME /MOUNT_POINT
  2. Resize the file system of the volume:

    1. To resize an ext4 file system, run the following command:

      $ sudo resize2fs /dev/DEVICE_NAME
    2. To resize an XFS file system, run the following command:

      $ sudo xfs_growfs /dev/DEVICE_NAME
    3. (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

  1. Stop the VM. For more information, see Stopping and Starting VMs.

  2. 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.

  3. Start the VM. For more information, see Stopping and Starting VMs.

Configure the File System of the Volume

  1. Connect to your VM. For more information, see Accessing a Windows VM.

  2. Click the Start menu, type diskmgmt.msc, and click the program that appears.

  3. Right-click the volume and select Extend volume.
    The Extend Volume Wizard appears.

  4. Keep the default information and click Next.

  5. 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

  1. Connect to your VM. For more information, see Accessing a Windows VM.

  2. Click the Start menu, type diskmgmt.msc, and click the program that appears.

  3. In the bottom-left panel, right-click the disk corresponding to the volume you want to unmount, then click Offline.

  4. Detach the volume from the VM. For more information, see Detaching a Volume from a VM.

  5. 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.

  6. Reattach the volume to the VM. For more information, Attaching a Volume to a VM.

Configure the File System of the Volume

  1. Inside the VM, in the bottom-left panel, right-click the disk corresponding to the volume you want to mount, then click Online.

  2. Right-click the volume and select Extend volume.
    The Extend Volume Wizard appears.

  3. Keep the default information and click Next.

  4. Click Finish to validate.
    The volume is configured, and its file system appears in the Disk Management list.

Related Pages