Attach an EBS volume to EC2 instance

Some following steps will show you how to attach an EBS volume to EC2 instance on AWS.

1. Create a new volume via Console or Cmd.

2. Attach the volume to the EC2 instance.

3. Format volume.

$sudo mkfs -t ext4 /dev/xvdf

4. Create a mount point.

$sudo mkdir /data

5. Configure fstab file to mount volume at boot time automatically.

$sudo vi /etc/fstab
/dev/xvdf /data ext4 defaults,nofail 0 2

6. Mount volume.

$sudo mount -a

Be the first to comment

Leave a Reply