How to automount additional EBS volume on instance reboot

The EBS volumes other than root volume will get unmounted during instance reboot.

This article explains the steps to enable automount for additional EBS volumes.

Step1: Login to the ec2 instance via ssh and switch to root user.

Step2: Get the device name that need to be mounted.

#lsblk

Step3: Open the configuration file "/etc/fstab"

#vi /etc/fstab

Step4: Add the device and mount-point details to this file.

device_name mount_point file_system_type fs_mntops fs_freq fs_passno

Here we need to replce the corresponding values accordingly.

For example,

/dev/nvme2n1      /mnt   ext4    defaults,nofail        0       0

Step5: Reload the configuration and check if any error.

#mount -a

If the above command not shows any error, everything if fine.

That's all…