3

I have a MacBook Pro with an external USB hard drive. A program I wrote is having trouble reading the files in Backups.backupdb so I look at the permissions:

> pwd
/Volumes/G-DRIVE
> ls -led Backups.backupdb 
drwxr-xr-x+ 7 rob  staff  238 Feb 10  2012 Backups.backupdb
 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown

This is an older drive. I no longer use it for Time Machine backups, so I don't care if I clear out permissions that used to protect this folder

But I can't clear them:

> sudo chmod -N Backups.backupdb
> chmod: Failed to clear ACL on file Backups.backupdb: Operation not permitted

Attempts to find some hidden attribute that might be preventing the chmod:

> ls -ldO Backups.backupdb 
> drwxr-xr-x+ 7 rob  staff  - 238 Feb 10  2012 Backups.backupdb
> xattr Backups.backupdb 
[nothing]

Why is the operation not permitted?

I just used Disk Utility to look at the drive. It didn't find any problems.

2 Answers 2

8

I found an answer to my own question.

I don't know if this is new to macOS 11 Big Sur. I had to go to System Preferences → Security & Privacy → the Privacy tab. Then select "Full Disk Access" in the list on the left, and enable the checkbox for Terminal. It restarted Terminal and then I was able to run the usual commands to chmod, as well as view the directory contents.

3
  • Ahh, you didn't mention you were running Big Sur. Indeed, "Full Disk Access" is not an option on Catalina. Glad the mystery is resolved. Oct 9, 2020 at 2:07
  • "Full Disk Access" actually is an option in Catalina. Feb 22, 2021 at 21:37
  • Works on Monterey as well. I suggest suggesting this as the accepted answer.
    – Anthony
    Feb 20, 2022 at 19:25
1

Being unable to do operations even with sudo is usually caused by System Integrity Protection. This answer describes a similar issue, and also describes how to disable SIP (and re-enable it when you're done).

3
  • I don't think it's SIP. If it were, I should see that rootless attr when I run xattr, but there's nothing there.
    – Rob N
    Oct 5, 2020 at 20:27
  • Perhaps. Have you investigated chflags ? Here's an answer that describes another similar issue: stackoverflow.com/a/7545798/6423998 Oct 5, 2020 at 20:50
  • That ls -ldO command that I show in my question shows there are no flags on the directory.
    – Rob N
    Oct 5, 2020 at 21:49

You must log in to answer this question.

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