Automounting ebs volume in linux-Ec2 instance using cloud formation?

Question:

Wrote one CFT to create redhat instance with two ebs volume attached. And need automount or formatted the ebs volume from the cft itself.

CFT:

Need to mount “DeviceName” : “/dev/sdm”, this volume automatically.

Answer:

You will need to add a small script to the UserData property of your instance or launch configuration that this BlockDeviceMappings is associated with. UserData is executed the first time the instance boots. The devices will automatically be remounted when the instance reboots using /etc/fstab.

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

Leave a Reply