How to view contents of an EBS volume attached to an EC2 instance via Terminal?

Items in the dev directory are devices, so you can't view them directly. This in effect is the disk for the EBS volume in question. Typically this is mounted on a specific directory, such as /mnt/volumename.

If they volumes are already mounted, you can run the 'df' command to list them. This will show you the device name and the mount point. You can then view the contents of the mount point.

If they are not already mounted, then you would need to configure /etc/fstab with the correct places to mount your volumes. They will then be mounted at boot time, or by running the mount command.


After you have attached the EBS volumes to your EC2 machine. You will have to mount these devices. You can see the attached devices using one of the following commands:

ls /dev
sudo parted -l

You will see many devices, including some named sda, xvda. Now create a subdirectory in the /media directory.

mkdir /media/new
mount /dev/sda /media/new   //mounts /dev/sda at mount point /media/new

You can list the mounted partitions using df -T. Browse your partition through the mount point; e.g., cd /media/new.