Apple Time Machine is an attractive backup system for OS X, but I had a hard time fixing it after it recently stopped working for me after I accidentally unplugged my firewire backup disk during a backup operation. For subsequent backup attempts, I got the error message that the backup had failed because a "time machine error -- Unable to complete backup" had occurred. Not so helpful. (This is sometimes manifested as a message in the Console like Backup failed with error: 11.)
By running the Console application, I was able to look at the error messages from backupd. In my case, there were some files that could not be inspected leading to messages like this:
10/27/08 10:00:42 PM /System/Library/Frameworks/.../mdworker[13920] tar importer countered an error (512) scanning "/X/1/Scr/private.tar"
but there were not serious. Eventually a crash occurred though, as follows:
10/27/08 10:04:24 PM ReportCrash[14175] Formulating crash report for process backupd[14129]
10/27/08 10:04:25 PM com.apple.launchd[1] (com.apple.backupd[14129]) Exited abnormally: Segmentation fault
but there was no explanation as to why.
Well, I figured it might be attempting to continue the previous malfunctioning (somehow corrupted) backups. This was supported by the presence of a (hidden) directory
of the form
/Volumes/MyBook/Backups.backupdb/2008-10-27-075904.inProgress
found by typing "ls -ld thatfile" from the terminal.
I figured the solution was to dispose of the directory called 2008-10-27-075904.inProgress by either removing it (and its contents) or moving it elsewhere.
Unfortunately, the files in that directory use extended attributes and cannot be readily deleted. You can turn off these attributes (with xattr), but it needs to be done file-by-file and it's cryptic.
The solution is to use the command fsaclctl which disables extended attributes (and access control lists) for an entire volume at a time.
Thus, I used
cd /Volumes/MyBook/Backups.backupdb/
sudo fsaclctl -p /Volumes/MyBook/ -d
mv 2008-10-27-075904.inProgress ../hideme
sudo fsaclctl -p /Volumes/MyBook/ -e
After that, Time Machine backups worked again!