Block storage volumes attach to instances as additional disks. You must attach the volume to an instance before it can be used. Multiple volumes can be attached to a single instance, however you can only attach a volume to one instance at a time. When a volume is first created, it will be completely empty and will need to be partitioned and formatted within your instance's OS before it can be used by your instance.
Note: For Linux instances, you will need to remove the any references to the block storage volume from your
/etc/fstab
file before detaching to prevent system boot failure due to the OS waiting on a drive that no longer exists.
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,nofail 0 0 >> /etc/fstab
mount /mnt/blockstorage
The following steps are based on Windows Server 2016, however the basic process is very similar for all current versions of Windows.
You could earn up to $300 by adding new articles