...
- Login to the virtual machine.
The VM will now have an additional disk, typically named vd(SOME_LETTER) or sd(SOME_LETTER). We will assume the disk is named vdb, but it may be vdc, vdd, ... if the VM already had additional disks.
Check the attached disks by running
lsblk, which shows disks (e.g. vda, vdb) and partitions on the disks (vda1, vda2, etc for partitions 1 & 2 on vda).You should see something like this, showing vdb with no partition:
Code Block $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS vda 252:0 0 30G 0 disk └─vda1 252:1 0 30G 0 part / vdb 252:16 0 10G 0 disk
Create a single partition (number 1, so vdb1) filling the disk, labelled "data-1" here, and format it. You can use parted and mkfs.ext4:
Code Block sudo parted --script -- /dev/vdb mklabel gpt sudo parted --script --align optimal -- /dev/vdb mkpart primary ext4 0% 100% sudo mkfs.ext4 -L data-1 /dev/vdb1
Info You may partition the disk differently and use any other filesystem type. It is recommended to use the same name as the volume for the label (e.g.
data-1) of the new filesystem (here:data-1).- To have the disk automounted auto-mounted on start up, add an entry to your VM's
/etc/fstab,adapting the label to the name you chose earlier and setting a convenient path (e.g./mnt/data1):Code Block echo "LABEL=data-1 /mnt/data1 ext4 defaults 0 0" | sudo tee -a /etc/fstab > /dev/null Create the directory where you are mounting your filesystem. Make sure you use the same path as defined in in
fstabearlier:Code Block sudo mkdir /mnt/data1Mount the file system this first time around and check it's ok. It should be automatically mounted on future reboots (test this now if it's important).
Code Block sudo mount -av
- (Optional) Reboot the instance. Then verify the the disk was indeed automatically mounted after system reboot:
Code Block $ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS vda 252:0 0 30G 0 disk └─vda1 252:1 0 30G 0 part / vdb 252:16 0 256G 0 disk └─vdb1 252:17 0 256G 0 part /mnt/data1
| Warning | ||
|---|---|---|
| ||
Due to limitations in the underlying OpenStack infrastructure at ECMWF, a user cannot hot-plug more than 12-13 pci devices. If you need more than 12-13 volumes, the VM must be powered off, before more devices are added. |
...