Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Permission denied when accessing new EBS volume

I'm new to AWS and EC2.

I just added a new EBS volume to my EC2 instance. I formatted and mounted it using instructions from another SO answer.

When I try to access the new volume I have permissions issues. cd /vol gives me

-bash: cd: /vol: Permission denied

Does anyone know why I can't cd into the new volume?

In case it's relevant, ls -l /vol gives me

ls: cannot access /data/lost+found: Permission denied
total 0
d????????? ? ? ? ?            ? lost+found

. sudo ls -l /vol returns

 total 16
 drwx------ 2 root root 16384 Sep 12 22:14 lost+found

What am I doing wrong?

like image 247
dB' Avatar asked Sep 14 '14 23:09

dB'


People also ask

How do you add new EBS volume?

To attach an EBS volume to an instance using the consoleOpen the Amazon EC2 console at https://console.aws.amazon.com/ec2/ . In the navigation pane, choose Volumes. Select the volume to attach and choose Actions, Attach volume. You can attach only volumes that are in the Available state.

How do I fix Permission denied in Linux terminal?

For solving this error, you need to add the correct permissions to the file to execute. However, you need to be a “root” user or have sudo access for changing the permission. For changing the permission, Linux offers a chmod command. The chmod stands for change mod.

How do I enable EBS?

Select 'Instance Settings' in the drop down menu, then select 'Change Instance Type'. You can then modify your instance type to the one that you prefer and click on EBS optimized. Some instance types are EBS optimized by default. For those instances, the checkbox is already enabled.


1 Answers

you need to have rights to access the volume.

You may also take ownership of the volume, by doing in the console:

sudo chown `whoami` /vol

you may also change the rights with chmod. You may check documentation on chown and chmod linux commands.

like image 103
unludo Avatar answered Oct 20 '22 06:10

unludo