For AI agents: the complete documentation index is available at https://docs.us.ovhcloud.com/en/llms.txt, the full documentation bundle is available at https://docs.us.ovhcloud.com/en/llms-full.txt, and this page is available as Markdown at https://docs.us.ovhcloud.com/en/storage-and-backup/block-storage/create-and-configure-an-additional-disk-on-an-instance.md.
  • English

How to create and configure an additional disk on an instance

View as Markdown

You can create additional disks for your Public Cloud instances. This can be useful in cases where:

  • You want to increase your storage capacity without changing the instance model.
  • You want to have highly available, high-performance storage.
  • You want to move your storage and data to another instance.
  • You want to prepare the environment if you want to use Terraform.

 

Requirements

  • A Public Cloud instance in your account
  • Administrative (sudo) access to your instance via SSH (Linux) or RDP (Windows)

OVHcloud Control Panel Access

 

Instructions

The different types of volumes

OVHcloud offers three types of Block Storage volumes, each tailored to specific needs in terms of performance, capacity, and cost. These solutions enable you to attach persistent storage volumes to your instances, guaranteeing a high level of reliability and availability.

For more information about the types of volumes, please visit our website.

Info

You can no longer order High Speed (Gen1) volumes via the OVHcloud Control Panel. They have been replaced by High Speed Gen2 volumes at the same price, with better performance for volumes above 100 GB. High Speed volumes remain available via the API, Terraform, and OpenStack.

Existing High Speed volumes remain supported. You can also change your Block Storage volume type to migrate them to Gen2.

Info

All volume types are also available in an encrypted version (LUKS). These volumes ensure data confidentiality without impacting performance. They are available through the OVHcloud Control Panel as well as via the tools presented in the next section, by specifying the types <volume_type>-luks.

 

Adding a new volume

Via the OVHcloud Control Panel
Via Terraform
Via the Horizon interface
Via the OpenStack CLI

Via the OVHcloud Control Panel

Open Block Storage in the left-hand menu under Storage and click Create a volume.

On the following screen, choose your configuration settings:

Select a region: Select the location for your block storage volume. For more information about Local Zones, see this guide.

Warning

NOTE: Your volume must be created in the same region as the instance to which you wish to attach it. If you create it in another region, you can delete it and recreate it in the correct region.

Volume type: Choose your volume type and select your encryption level. More information about the types of volumes is available on our website.

From here, complete your volume's configuration by selecting the Volume capacity and Volume name, and then clicking Create the volume.

Once your new disk is available, click the more options ... button to the right of the disk and select Attach to instance.

In the pop-up window, choose an available instance and click Confirm. If no instances are available it is because you do not have an instance in a region matching that of the additional disk.

The process may take a few minutes to complete.

Warning

NOTE: Navigating away from the page during creation may interrupt the process.

 

Configuring the new disk

The examples below presume you are logged in as a user with elevated permissions.

Using Linux
Using Windows

Using Linux

Establish an SSH connection to your instance, then use the command below to list the attached disks.

Info

sda in this example refers to the default disk of the instance. The additional disk will then be labeled sdb.

lsblk
NAME    MAJ:MIN  RM    SIZE  RO  TYPE  MOUNTPOINTS
sda       8:0     0     50G   0  disk 
└─sda1    8:1     0   49.9G   0  part  /
sdb       8:16    0     10G   0  disk

Create a partition on the additional disk using the commands below.

If your additional disk is less than 2TB:

sudo fdisk /dev/sdb
Welcome to fdisk (util-linux 2.25.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table.
Created a new DOS disklabel with disk identifier 0x95c4adcc.

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-20971519, default 2048):
Last sector, +sectors or +size{K,M,G,T,P} (2048-20971519, default 20971519):

Created a new partition 1 of type 'Linux' and of size 10 GiB.

Command (m for help): w

The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

If your additional disk is larger than 2TB:

sudo parted /dev/sdb
GNU Parted 3.5
Using /dev/sdb
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) help                                                             
  align-check TYPE N                       check partition N for TYPE(min|opt) alignment
  help [COMMAND]                           print general help, or help on COMMAND
  mklabel,mktable LABEL-TYPE               create a new disklabel (partition table)
  mkpart PART-TYPE [FS-TYPE] START END     make a partition
  name NUMBER NAME                         name partition NUMBER as NAME
  print [devices|free|list,all]            display the partition table, or available devices, or free space, or all found partitions
  quit                                     exit program
  rescue START END                         rescue a lost partition near START and END
  resizepart NUMBER END                    resize partition NUMBER
  rm NUMBER                                delete partition NUMBER
  select DEVICE                            choose the device to edit
  disk_set FLAG STATE                      change the FLAG on selected device
  disk_toggle [FLAG]                       toggle the state of FLAG on selected device
  set NUMBER FLAG STATE                    change the FLAG on partition NUMBER
  toggle [NUMBER [FLAG]]                   toggle the state of FLAG on partition NUMBER
  unit UNIT                                set the default unit to UNIT
  version                                  display the version number and copyright information of GNU Parted
(parted) mklabel gpt                                                      
(parted) mkpart primary 0 3750G                                           
Warning: The resulting partition is not properly aligned for best performance: 34s % 2048s != 0s
Ignore/Cancel? I                                                          
(parted) quit

Format partition sdb1:

sudo mkfs.ext4 /dev/sdb1
mke2fs 1.42.12 (29-Aug-2014)
Creating filesystem with 2621184 4k blocks and 655360 inodes
Filesystem UUID: 781be788-c4be-462b-b946-88429a43c0cf
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632

Allocating group tables: done
Writing inode tables: done
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done

Mount the partition:

sudo mkdir /mnt/disk
sudo mount /dev/sdb1 /mnt/disk/

Verify the mount point:

df -h
Filesystem Size Used Avail Use% Mounted on
/dev/sda1 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 9.8G 23M 9.2G 1% /mnt/disk
Info

The mount is not persistent after reboot. To automate  mounting, edit the fstab file.

Retrieve the UUID of the new volume:

sudo blkid
/dev/sda1: UUID="51ba13e7-398b-45f3-b5f3-fdfbe556f62c" TYPE="ext4" PARTUUID="000132ff-01"
/dev/sdb1: UUID="2e4a9012-bf0e-41ef-bf9a-fbf350803ac5" TYPE="ext4" PARTUUID="95c4adcc-01"

Open /etc/fstab:

sudo nano /etc/fstab

Add the line below, replacing the UUID with your own:

UUID=2e4a9012-bf0e-41ef-bf9a-fbf350803ac5 /mnt/disk ext4 nofail 0 0

Save and exit the editor. The disk will mount automatically after each reboot.

 

Detach a volume

Before detaching a volume, unmount in the operating system.

Warning

NOTE: An error message may appear if you have software or processes running on the additional disk. In this case, it is recommended to stop all processes before continuing.

Here is how to unmount the volume from the operating system before detaching it from the instance:

On Linux
On Windows

On Linux

Connect via SSH, then list the attached disks.

lsblk
NAME      MAJ:MIN RM  SIZE RO TYPE  MOUNTPOINT
sda       254:0   0   10G  0  disk
└─sda1    254:1   0   10G  0  part  /
sdb       8:0     0   10G  0  disk
└─sdb1    8:1     0   10G  0  part  /mnt/disk

Unmount the partition:

sudo umount /dev/sdb1

Remove the device ID from the fstab; otherwise the partition remounts after reboot.

sudo nano /etc/fstab

Save and exit the editor.

 

Finally, we will detach the volume from the instance:

Via OVHcloud Control Panel
Via Terraform

Via OVHcloud Control Panel

Open Block Storage in the left-hand menu under Storage.

Click the more options ... button next to the corresponding volume and select Detach from instance.

Warning

NOTE: You can also cancel your Block Storage volume using this menu.

Click Confirm in the pop-up window to start the process.

 

Go further

Browse all the Block Storage guides.

Browse the rest of the OVHcloud US documentation for guides on our other products and services.

Learn more about Block Storage on the OVHcloud US website.