I just attached another ebs volume to running instance. But how do I access the volume? I can't find the /dev/sda
directory anywhere. Where should I look?
I just attached another ebs volume to running instance. But how do I access the volume? I can't find the /dev/sda
directory anywhere. Where should I look?
When you attach an EBS volume, you specify the device to attach it as. Under linux, these devices are
/dev/xvd*
- and are symlinked to/dev/sd*
In the AWS console, you can see your EBS volumes, what instances they are attached to, and the device each volume is attached as:
You can achieve the same thing from the CLI tools. Set the necessary environment variables:
Run the command on your current instance (otherwise, just specify the instance-id):
It is worth noting that in both cases above - the CLI and the AWS Console - the devices are described as being attached at
/dev/sd*
- this is not actually the case, however.Look at the contents of /dev:
The devices are actually
/dev/xvd*
- and the/dev/sd*
paths are symlinks.Another approach to check for the currently available devices is to use
fdisk -l
, or for a simpler output:If you need to determine which devices have been mounted use
mount
anddf
- and check/etc/fstab
to change the mount options.To use a EBS volume attached in the EC2, you need first mount the volume.
[ec2-user@ip-172-31-86-46 ~]$ lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT
xvda 202:0 0 8G 0 disk
└─xvda1 202:1 0 8G 0 part /
xvdb 202:16 0 8G 0 disk
xvdf 202:80 0 100G 0 disk
https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ebs-using-volumes.html