I'm following this guide on my Ubuntu Azure hosted VM and need to make a directory in /mnt/
. For this question I'll just change the directory I want to create to "test". I keep getting the following error message when running sudo mkdir /mnt/test/
:
mkdir: cannot create directory ‘/mnt/test/’: Operation not permitted
I get a slightly different error message when I try to cd /mnt/
.
-bash: cd: /mnt/: Permission denied
My next step was look into the permissions of this directory so I ran sudo stat /mnt/
and got:
File: /mnt/
Size: 4096 Blocks: 8 IO Block: 4096 directory
Device: 801h/2049d Inode: 2 Links: 6
Access: (0444/dr--r--r--) Uid: ( 0/ root) Gid: ( 0/ root)
Access: 2021-02-17 14:19:48.658231668 +0000
Modify: 2021-02-08 12:34:19.906967600 +0000
Change: 2021-02-09 09:40:12.287101300 +0000
Birth: -
I saw that I don't have write permissions so ran sudo chmod 664 /mnt/
but received the error message below:
chmod: changing permissions of '/mnt/': Operation not permitted
I'm still new to Unix so unsure how to proceed. Would appreciate any further troubleshooting steps or solutions.
Responses to comments:
df /mnt
output:
Filesystem 1K-blocks Used Available Use% Mounted on
/dev/sda1 32894736 49192 31151544 1% /mnt
grep | '/mnt'
output with some redacted information:
/dev/sda1 on /mnt type ext4 (rw,relatime,x-systemd.requires=cloud-init.service)
/dev/sda1 on /mnt/sdc1 type ext4 (rw,relatime)
/dev/sdc on /mnt/sdc type ext4 (rw,relatime)
//<azure storage account name>.file.core.windows.net/sih-workspace on /mnt/sih-workspace type cifs (rw,relatime,vers=3.0,cache=strict,username=**********,uid=0,noforceuid,gid=0,noforcegid,addr=<azure data centre IP>,file_mode=0777,dir_mode=0777,soft,persistenthandles,nounix,serverino,mapposix,rsize=1048576,wsize=1048576,bsize=1048576,echo_interval=60,actimeo=1)
df /mnt
andmount | grep '/mnt'
please? Is it a remote drive perhaps? What is the system you are using? Is it a virtual machine? – terdon Feb 18 '21 at 13:10chmod 644
being wrong for a directory (chmod 755
or evenchmod u=rwx,go=rx
would be better), I think that you've probably got something already mounted on/mnt
. Please run the following command and add the result to your question,df /mnt
– Chris Davies Feb 18 '21 at 13:10chmod
s and both produced the same error message. Please see the output ofdf /mnt
in my question. – SocksSocksSocks Feb 18 '21 at 14:08/mnt
, which have now been hidden by another mount on/mnt
itself. You need to decide which ones you want and which you don't expect. My suggestion would be that the first action should be toumount /mnt
so that the others are exposed once more. But I am not familiar with the Azure filesystem utility you're using so this isn't a full answer – Chris Davies Feb 18 '21 at 14:48/mnt
, exposing the other mountpoints once more. – Chris Davies Feb 18 '21 at 16:05