Permission denied when accessing new EBS volume
Solution 1
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.
Solution 2
you need to change owner of the EBS volume.
Say you mounted the new EBS volume to xvdf_mountpoint
folder.
first run whoami
to get your account name
then switch to root: su root
type in the password. if password not set: https://aws.amazon.com/premiumsupport/knowledge-center/set-change-root-linux/
chown [account name] /dev/xvdf
then su [account name]
,then you have complete access to the newly mounted EBS volume.
Comments
-
dB' almost 2 years
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 mels: cannot access /data/lost+found: Permission denied total 0 d????????? ? ? ? ? ? lost+found
.
sudo ls -l /vol
returnstotal 16 drwx------ 2 root root 16384 Sep 12 22:14 lost+found
What am I doing wrong?