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?
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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With