Attaching a block volume

Execute the following commands on your instance to begin utilizing the volume. Substitute <TARGET> with your volume's target identifier (such as vdb) and replace <DIR_NAME> with your preferred directory name for mounting.

Format volume (only needed once, e.g, if it's a new volume):

mkfs.ext4 /dev/<TARGET>

Create directory:

mkdir /mnt/<DIR_NAME>

Mount volume:

mount /dev/<TARGET> /mnt/<DIR_NAME>

Recommended: add volume to fstab (this will automatically mount the volume on every system startup):

echo "/dev/<TARGET> /mnt/<DIR_NAME> ext4 defaults,nofail 0 0" >> /etc/fstab

Last updated