MacOS – permission denied mkdir /Volumes

macosmountpermission

I'm getting a permission denied when attempting to create or mount at /Volumes on my mac. I'm an admin and I can do both of those things with sudo, but I don't understand why I have to use sudo on this mac but not on other macs in my office.

/Volumes
> mkdir foo
mkdir: foo: Permission denied

My thoughts are to use chown/chmod but I'm hesitant to do so without asking first.

/Volumes
> ll
total 8
drwxr-xr-x@  4 root      admin   136B Apr 22 13:40 .
drwxr-xr-x  33 root      wheel   1.2K Mar 30 22:23 ..
drwxr-xr-x@ 11 medialab  staff   442B Apr 14 15:34 06b_SD_Video_BK
lrwxr-xr-x   1 root      admin     1B Apr 18 10:48 Macintosh_HD -> /

We mount LTO tapes to this machine and can currently only do so by using sudo. This was not always the case and I don't know why sudo is suddenly being required.

How do I go about changing the permissions on /Volumes?

Best Answer

There are access control restrictions on that directory. You can inspect those from the command line:

ls -lOe /

(That's a capital letter O and not a zero 0) I would suggest mounting your volume to another directory - either /tmp or $TMPDIR rather than messing with the restrictions that are designed to prevent what you have - an actual directory with actual files in /Volumes.

Without knowing your script and workflow, it's hard to guess/advise other than not changing things that Apple will change back next time you patch the system.

Your vendor of the LTO tapes should have software to handle mounting the volume in a manner that uses Apple's disk arbitration framework so you don't have to manage the mounts in a script.


You could add a user to have explicit write access in that directory if you're certain that's what will help:

sudo chmod +a "User 1:allow:add_subdirectory" /Volumes