9

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?

  • pkgutil --file-info /Volumes will give you the information that you need to set the permissions on the /Volumes directory – fd0 Apr 22 '16 at 19:23
  • Thanks @fd0. --file-info was hanging in terminal with no output so I tried --file-info-plist – Bleakley Apr 22 '16 at 19:39
  • I can't make much send of the output. – Bleakley Apr 22 '16 at 19:40
13

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
  • Thanks @bmike. I definitely need to mount the LTO to /Volumes. It is part an github script which requires that. – Bleakley Apr 22 '16 at 19:59
  • 1
    I had to do I had to do sudo chmod -RN; sudo chmod +a "myusername:allow:add_subdirectory,add_file" .. Which deletes the ACLs and creates new ones for this folder and all subfolders – Ray Foss Mar 6 at 23:10
0

The default permissions of the directory /Volumes are:

...
drwxrwxrwt@  4 root      admin  hidden  136 Apr 22 22:05 .
 0: group:everyone deny add_file,add_subdirectory,directory_inherit,only_inherit
...

I suggest to repair permissions either with Disk Utility/diskutil or a 3rd-party tool and/or modify the permissions manually.

  • Thanks @klanomath. How can I got about modifying the permissions manually? chmod 755 /Volumes is not getting it done. – Bleakley Apr 22 '16 at 20:20
  • @Blake sudo chmod 777 /Volumes. You may have to modify the ACL also with sudo chmod +a|=a ....depending on your ls -le0 ...result. – klanomath Apr 22 '16 at 20:25
  • Thanks. I did have to modify the ACL, which I'd never worked with before. – Bleakley Apr 26 '16 at 16:01

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .