View Full Version : [ubuntu] Fixing permission issues in OSX

December 7th, 2012, 04:37 AM
I'm jotting down some notes for future reference as I work through fixing a bunch of file permission problems on my HFS+ partition. These are files that I've created while in Ubuntu - I store a lot of my data on the HFS+ partition on my Macbook, and edit files from either OS depending on particular needs. Most of the time this works flawlessly. But once in a while I get a bunch of files that are fine in Ubuntu but in OSX are locked, unchangeable, undelete-able, and which I can't do anything with even after unlocking them in the Finder, using sudo, etc.

Aside from the basic UID/GID matchup tricks, OSX apparently has a whole bagful of secret ways to make files inaccessible. These include ACL's, extended attributes, and "flags", all of which need different command line tools.


to see flags:

ls -lO

Handy ref:


chflags noopaque file
chflags nouappnd file

basically, if you see one listed, call chflags and add "no" before the flag name to remove it.

or just

chflags -R 0 *

recursively set flags to 0 on all files and subdirectories.

Extended Attributes:

this is garbage like com.apple.FinderInfo and the "quarantine" thing

list them:

ls -l@

kill it with fire:

xattr -d com.apple.FinderInfo *

supposedly -c will just clear them all, but on Snow Leopard I get invalid flag so have to do 'em all manually.