2

I recently copied a bunch of data back from an NTFS drive I had used for backup, which had NTFS permissions of Everyone - Full Control. The copy was done using Linux Mint, with the 2 drives slaved and mounted. I had turned off Journalling on the Mac OSX HDD before the copy, and turned it back on afterwards.

Despite copying it into the Mac (admin) users' home directory, I've lost all access to most of the files.

System has Read/Write, whilst Everyone has no access, and the User isn't even listed on these files. The Locked checkbox also appears ticked.

I tried repair permissions from a LION recovery disk.

I tried the following from a top level directory:

sudo chmod -R u+rwx *

...and it said "Unable to change file mode on . . . Operation not permitted"

I also tried to give myself read/write permissions using the Finder:

Right-click the "cdstuff" folder, and "Get Info".
Under "Sharing & Permissions", click the lock icon to enable edits.
Now give "Read & Write" access to everyone.
Click on the little tool/widget icon, and select "Apply to enclosed items."

And it simply fails, leaving the sub directories as they are.

What's the OSX equivalent to Windows "take ownership" and then "assign full control and propagate to all enclosed items"?

Thanks for any help,

Dom


ok, output looks like this after Daniel's help below:

chmod: Unable to change file mode on iTunes/Previous iTunes Libraries/iTunes Library 2011-07-25.itl: Operation not permitted
Andrew-Jowetts-MacBook-Pro:music andrewjowett$ ls -le
total 0
drwxrwxrwx+  23 andrewjowett  staff   782 Dec 23  2010 Animal House (Soundtrack)
 0: group:everyone deny delete
drwxrwxrwx+  15 root          admin   510 Jan  1  2011 Aphex Twin - Selected Ambient Works 85-92 (1992) [AAC VBR]
 0: user:andrewjowett allow list,add_file,search,add_subdirectory,delete_child,readattr,writeattr,readextattr,writeextattr,readsecurity
drwx------    4 root          wheel   136 Jan  1  2011 Aphex Twin - Selected Ambient Works Volume II
drwx------   13 root          wheel   442 Jan 14  2011 Beck - Modern Guilt [mp3-320-2008]
drwx------   19 root          wheel   646 Dec 23  2010 Black Dub...Black Dub(2010)[FLAC]
drwx------   17 root          wheel   578 Dec 23  2010 Brian Eno
drwx------    6 root          wheel   204 Jan 15  2011 FLAC

drwx------   18 root          wheel   612 Jan 14  2011 UNKLE-Where_Did_The_Night_Fall-2010-SiRE
drwx------   15 root          wheel   510 Jan 14  2011 Unkle - Never, Never, Land (+Japan Bonus Track)
drwx------   16 root          wheel   544 Jan 14  2011 Unkle - Psyence Fiction
drwxrwxrwx+  12 andrewjowett  staff   408 Feb 27 16:18 iTunes
 0: group:everyone deny delete

The top Aphex twin files are now accessible after some messing around

i've no idea what the "wheel" entry refers to - it's not a group or user on this machine

Can I run that command on the whole directory? (there are lots more directories I need to fix...

Thanks again

0

1 Answer 1

0

It's possible the files are not owned by the correct user account (yours).

Use the following command to change ownership to you for the current working directory and everything in it, replacing yourusername with the output of the whoami command:

sudo chown -R yourusername:staff .

To set up default "data file" access permissions for all files and folders in the current working directory (owner can read and write, others can only read), use the following:

chmod -R u=rwX,go=rX .

Check whether access control lists exist for the files using ls -le. It looks similar to the following:

$ ls -led ~/Desktop/
drwx------+ 10 danielbeck  staff  340 28 Feb 21:54 /Users/danielbeck/Desktop/
 0: group:everyone deny delete

Remove them from all files and folders in the current working directory (never a Time Machine backup or your home folder, or any direct subdirectory of your home folder!) using chmod -R -N ..

More information on ACLs and how to change them in man chmod in the section ACL MANIPULATION OPTIONS.

3
  • sorry, I'm new tothe site and didn't realise I'd closed the question by hitting the "this helped" button! Daniel, can you please see edited original question for further comments? Thanks!
    – Dom
    Feb 29, 2012 at 21:19
  • @Dom You're not closing the question, but you're indicating that you're happy with what you got and aren't looking anymore. Others still can answer, but likely won't. See the new sections on taking ownership and setting default permissions, and the update to the one on ACLs.
    – Daniel Beck
    Feb 29, 2012 at 21:30
  • Hi, just to add to this In the end, i found a simple solutino to the remaining problem files and folders. 1. I copied all to the desktop. 2. I force deleted the original directories using sudo rm -rf and dragging folders to terminal window 3. I copied the directories back and they all now had correct permissions... Thanks for the help Daniel
    – Dom
    Mar 1, 2012 at 17:41

You must log in to answer this question.

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