0

Migrated to a new machine, but due to some reasons I won't get into, I ended up copying a number of files over from a Time Machine backup directly (i.e. didn't "restore from time machine") to get them on to my new machine's disk. Everything seemed fine, but I realized that while I can read the files, I can't write to them unless I sudo.

While I've worked around the problem by just using a USB stick instead to transfer the files, I'm left curious why I have files which I can't write to unless I sudo.

For the record, I've observed:

  • The standard ls -l UNIX permission view shows that my user/group has proper 'rwx' permissions on the file.
  • From Finder "Get Info", it says that my user should have full Read/Write access.
  • From the xattr -l view of the file, I don't see anything that would suggest it would stop me from writing to the file. At best, I've seen one in regards to a time machine metadata referencing when the file was backed up.

Is there something else I could look at? As I said, I got around the issue with a new copy, but I'm just curious what else macOS could be considering that would make these files on my SSD read-only.

5
  • Did you look at man ls?
    – nohillside
    Sep 21, 2023 at 19:56
  • Does ls -l show an @ at the beginning of permissions?
    – Barmar
    Sep 21, 2023 at 22:55
  • @nohillside yes, and @Barmar yes. But the xattr command I noted does the same thing as ls -l@. Example xattr output: com.apple.timemachine.private.directorycompletiondate: 2023-09-14-233118,3,1013,376832,96,0,0,0
    – bjb
    Sep 22, 2023 at 0:18
  • Extended attributes are less important than ACLs when diagnosing permission issues.
    – nohillside
    Sep 22, 2023 at 4:51
  • Can you post the complete Terminal output for a file? Are you actually the owner of the file?
    – benwiggy
    Sep 22, 2023 at 6:58

1 Answer 1

0

Files copied directly from Time Machine usually come with some ACL (Access Control List) entries which may prevent deletion or overwriting.

  • To see the ACLs defined for a file, use ls -el FILE.
  • To manipulate them, use chmod with the appropriate options (details in man chmod).
1
  • This is what I was looking for; never dug into the chmod manipulation of ACLs. Found that Time Machine put a " 0: group:everyone deny add_file,delete,add_subdirectory,delete_child,writeattr,writeextattr,chown" ACL on everything, so removing it with chmod -a# 0 got rid of it!
    – bjb
    Sep 22, 2023 at 14:47

You must log in to answer this question.

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