OS X Yosemite – the strange case of /.MobileBackups.trash

Recently I noticed that my ten-month-old Retina MacBook Pro was sluggish. I’d read reports and heard anecdotal evidence that Yosemite was running slow for people, even on the latest hardware, so I figured I’d get to the bottom of it.

The immediate culprit was a process called UserEventAgent, which was chewing up more CPU than I would have liked.

Some quick research led me to relate it to the Time Machine backup process. I looked in Console at the system.log output and confirmed that the issue related to deleting /.MobileBackups.trash. Apple has reserved space on the drive for backups when you’re not connected to Time Machine, which is stored in this folder.

I followed the instructions from korsbakken on the Apple Support Communities site in this thread.

The first thing you are supposed to do is disable the local drive reservation with sudo tmutil disable local, and then manually erase the folder.

It turns out that CrashPlan, of all things, was preventing the clearing out of the folder, due to some weird flags it had set on the folder to make it system immutable.

The solution, by korsbakken, is to run this command:

sudo find /.MobileBackups.trash/ -flags +schg -exec chflags noschg {} \;

This effectively removes the flags from the folder and allows the removal of the folder, which I did.

To keep my Time Machine settings happy, I re-enabled the local storage.

The machine is behaving much better now.