Somehow I've managed to accumulate a bunch of files in Time Machine that don't seem to be capable of being copied out of Time Machine, citing "Unknown Error -22", like-so:

sudo cp /path/to/broken_file ~/Desktop/test
cp: broken_file: Unknown error: -22

Thing is, this only affects a tiny number of files (maybe five or six out of hundreds of thousands), and while it doesn't seem to be affecting Time Machine, it affects any other commands such as trying to rsync a Time Machine backup (which is useful since they're snapshots).

I can't find anything to explain why the files are doing this though; if I locate the original file in my user folder then it copies just fine, only the Time Machine version is affected. The files suffering the issue also don't seem related in any obvious way.

Does anyone have any idea what an error -22 is?

  • I just tried touching the offending files on my main volume, as this forces Time Machine to back them up again (verified with inode numbers) but they still get error -22 when trying to copy them, so there must be some offending property at fault somewhere. Is there a way to list all active flags on a file? – Haravikk May 8 '14 at 7:34
  • Try xattr or ls -l@ to see extended attributes. Man page. – thankyour May 8 '14 at 14:34

You must log in to answer this question.

Browse other questions tagged .