Adding block storage

Preparing the volume - Linux
Linux will see the first block storage volume as /dev/vdb. If you attach additional volumes, they will appear as /dev/vdc, /dev/vdd, etc.

The following series of commands will format the volume with EXT4 and mount it under /mnt/blockstorage. If you wish to have another filesystem type or mount point, then you will need to modify the commands accordingly.

Create partitions.

parted -s /dev/vdb mklabel gpt
parted -s /dev/vdb unit mib mkpart primary 0% 100%
Create EXT4 filesystem.

mkfs.ext4 /dev/vdb1
Mount block storage.

mkdir /mnt/blockstorage
echo >> /etc/fstab
echo /dev/vdb1 /mnt/blockstorage ext4 defaults,noatime 0 0 >> /etc/fstab
mount /mnt/blockstorage
  last edited: Sun, 12 Nov 2017 23:29:40 +0100  
Carte blanche