Attaching EBS volume to EC2 instance
- Create EC2 instance
- Create EBS volume and attach it to EC2 instance
- Ssh into EC2 instance. eg: ssh -i ~/.ssh/id_rsa ubuntu@public-dns-address
- Format EBS volume: sudo mkfs -t ext4 /dev/sdf
- Add a line to the /etc/fstab file on EC2 instance: /dev/sdf /vol ext4 defaults,noatime 1 1
- sudo mkdir /vol to create vol directory.
- sudo mount /dev/sdf to mount the EBS volume.
Written by Dhiren Bhatia
Related protips
2 Responses
Thanks.
over 1 year ago
·
It's good to add nobootwait to EBS volumes in fstab to make sure it doesn't hold up your instance in the boot process if it is detached in the future.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Ec2
Authors
Related Tags
#ec2
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#