Learn how to increase the size of an additional disk and extend the main partition accordingly.
If you have reached the maximum capacity on your additional disk, you can add more storage by increasing its size.
Requirements
- a Public Cloud instance in your Public Cloud project
- an additional disk created in your project
- access to the OVHcloud Control Panel
- administrative (root) access to your instance via SSH (Linux) or RDP (Windows)
Instructions
Modifying the size of the disk
Log in to the OVHcloud Control Panel and open your Public Cloud
project. Then click on Block Storage
in the left-hand menu.
...
in the row of the volume and select Detach from instance
.Click on ...
in the row of the volume and select Edit
.
In the pop-up window, enter the new size for the volume and click on Modify the volume
.
Ensure that the volume is attached to your instance before continuing. If not, click on ...
in the row of the volume and select Attach to instance
.
Extending the partition (Linux instance)
Establish an SSH connection to your instance in order to adjust the partition to the resized disk.
Unmount the disk first by using this command:
admin@server:~$ sudo umount /mnt/disk
Recreate the partition:
admin@server:~$ sudo fdisk /dev/sdb
Welcome to fdisk (util-linux 2.38.1). Changes will remain in memory only, until you decide to write them. Be careful before using the write command
Command (m for help): d Selected partition 1 Partition 1 has been deleted.
Command (m for help): n Partition type p primary (0 primary, 0 extended, 4 free) e extended (container for logical partitions) Select (default p):
Using default response p. Partition number (1-4, default 1): First sector (2048-146800639, default 2048): Last sector, +sectors or +size{K,M,G,T,P} (2048-146800639, default 146800639): Created a new partition 1 of type 'Linux' and of size 70 GiB.
Command (m for help): w The partition table has been altered. Calling ioctl() to re-read partition table. Syncing disks.
Verify and check the partition:
admin@server:~$ sudo e2fsck -f /dev/sdb1 e2fsck 1.42.12 (29-Aug-2014) Pass 1: Checking inodes, blocks, and sizes Pass 2: Checking directory structure Pass 3: Checking directory connectivity Pass 4: Checking reference counts Pass 5: Checking group summary information /dev/sdb1: 12/3276800 files (0.0% non-contiguous), 251700/13107200 blocks
admin@server:~$ sudo resize2fs /dev/sdb1 resize2fs 1.42.12 (29-Aug-2014) Resizing the filesystem on /dev/sdb to 18350080 (4k) blocks. The filesystem on /dev/sdb is now 18350080 (4k) blocks long.
Finally, re-mount and check the disk:
admin@server:~$ sudo mount /dev/sdb1 /mnt/disk/
admin@server:~$ df -h
Filesystem Size Used Avail Use% Mounted on
/dev/vda1 9.8G 840M 8.6G 9% /
udev 10M 0 10M 0% /dev
tmpfs 393M 5.2M 388M 2% /run
tmpfs 982M 0 982M 0% /dev/shm
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 982M 0 982M 0% /sys/fs/cgroup
/dev/sdb1 69G 52M 66G 1% /mnt/disk
Extending the partition (Windows 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 on Next
to proceed.
You can modify the disk space in this step if you want to add less than the entire amount to the partition. Click on Next
.
Click on Finish
to complete the process.
The resized volume now includes the additional disk space.
Go further
For more information and tutorials, please see our other Public Cloud support guides or explore the guides for other OVHcloud products and services.