Increasing the size of an additional disk
Find out how to increase the size of an additional volume and enlarge its main partition
Objective
If you have reached the maximum capacity on your additional disk, you can add more storage by increasing its size.
This guide explains how to increase the size of an additional disk and extend the main partition accordingly.
Requirements
- A Public Cloud instance in your Public Cloud project
- An additional disk created in your project
- Administrative (sudo) access to your instance via SSH (Linux) or RDP (Windows)
OVHcloud Control Panel Access
- Direct link:
- Navigation path:
Public Cloud> Select your project
Instructions
These steps assume you have already configured an additional disk as described in Creating and configuring an additional disk on an instance.
Monitoring disk usage before resizing
We recommend that you always maintain 20% free space on your storage volumes. This ensures optimum performance and avoids the risk of system degradation or failure when the volume reaches its maximum capacity.
To resize your disk at the right time, monitor disk usage regularly. Below are quick tutorials for both Windows and Linux to help you track disk space and anticipate when an upgrade is needed.
Using Command Prompt
Open Command Prompt (Win + R → cmd → Enter).
Run the following command:
This will display the free space and total size of each disk.
Using PowerShell
Open PowerShell as Administrator.
Run the following command:
This will show the used and available disk space.
Before resizing, we recommend creating a snapshot of your volume to protect your data. If something goes wrong during the resize or partition extension, you can restore from the snapshot. See Creating a volume snapshot for instructions.
Modifying the size of the disk
In your Public Cloud project, click on Block Storage in the left-hand menu under Storage & backup.
If the volume is attached to a Windows instance, click on ... in the row of the volume and select Detach from instance.
Click on ... in the row of the volume and select Edit.
Volume resizing is irreversible. You can only increase the size of a volume, never decrease it. Make sure the new size is correct before confirming.
In the popup window, enter the new size for the volume and click on Modify the volume.
Extending the partition (Linux instance)
Establish an SSH connection to your instance to adjust the partition to the resized disk.
First, check the filesystem type:
The steps below apply to ext2/ext3/ext4 filesystems. Unlike ext4, XFS cannot be resized while unmounted — the xfs_growfs tool requires the filesystem to be mounted. If your filesystem is XFS, still unmount the disk and recreate the partition as described below, but skip the e2fsck and resize2fs steps: remount the disk instead, then run sudo xfs_growfs /mnt/disk.
Before unmounting, check the current partition layout:
Note the Start sector value (in this example, 2048). You must re-enter this exact value when recreating the partition in the next step. Using a different start sector will misalign the filesystem and cause data corruption or loss.
First, unmount the disk:
In our example:
Recreate the partition using the following command. This process only rewrites the partition table — your filesystem data is preserved, provided you re-enter the exact same start sector when prompted.
Type d to delete the partition:
Type n to recreate the partition:
Type p to select the primary partition type:
Type the partition number, in our example 1:
Enter the first sector value you noted earlier (2048), then accept the default last sector to extend the partition across all remaining available space on the disk:
To list the changes, type p again.
Next, type w to save the changes:
Check the partition (for ext2/ext3/ext4 filesystems):
Finally, re-mount and check the disk:
Once this is completed, detach the volume from the instance and reattach it to ensure the updated QoS settings (IOPS and bandwidth) are properly applied.
After reattaching, you can verify the updated volume configuration in your Public Cloud project under Block Storage.
Extending the partition (Windows instance)
Before proceeding, reattach the volume to the instance. Click on ... in the row of the volume and select Attach to instance.
Establish a remote desktop (RDP) connection to your Windows instance.
Once logged in, right-click on the Start Menu button and open Disk Management.
The extended disk now displays the additional capacity as unallocated space.
Right-click on the volume and select Extend Volume from the context menu.
In the "Extend Volume Wizard", click Next.
You can modify the disk space in this step to add less than the full amount to the partition. Click on Next.
Click on Finish to complete the process.
The resized volume now includes the additional disk space.
Once this is completed, detach the volume from the instance and reattach it to ensure the updated QoS settings (IOPS and bandwidth) are properly applied.
After reattaching, open Disk Management again to confirm the volume displays the correct total size. You can also verify the updated volume configuration in your Public Cloud project under Block Storage.
Go further
Creating and configuring an additional disk on an instance
Change your Block Storage volume type
Join our community of users.