I've setup an EC2 instance and have 2 EBS volumes attached to it. I would like to view the contents of each volume. How do I view it via the terminal (cd /somePath)? I've already have a valid SSH connection to the EC2 instance.


From the AWS console, one of the volume is i-9167d3ff:/dev/sda1. I tried to do cd /dev/sda1 but I get the message -bash: cd: /dev/sda1: Not a directory


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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.