Automatically mount an EBS volume upon starting an Amazon EC2 Linux instance

user560494 picture user560494 · May 15, 2011 · Viewed 39.5k times · Source

I have an EBS volume (e.g. /dev/sdf) that has been attached to an EC2 instance (which boots from a different EBS volume), and I have mounted the volume (through mount /dev/sdf /data). When I stop and start again the instance, the volume is still attached but no longer mounted, and I have to manually mount it again.

Is there a way to make the volume /dev/sdf automatically mounted to /data upon starting the instance?

Answer

chrismarx picture chrismarx · Jul 2, 2014

It would seem that the official ec2 documentation now recommends plain old fstab entries with nofail -

/dev/xvdf       /data   ext4    defaults,nofail        0       2

ref - http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html