MacOS – How to set noatime for startup drive in Mountain Lion

macosssd

I've followed instructions to set the noatime flag in Lion so I can reduce SSD usage but it isn't working for me on Mountain Lion.

I'm still seeing this after restarting:

$ mount | grep " / "
/dev/disk0s2 on / (hfs, local, journaled)

Has anyone got any suggestions how to mount the startup drive with mount flag noatime?

Best Answer

Ok, I think I've got it working.

Add the file /Library/LaunchDaemons/com.nullvision.noatime.plist with contents:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" 
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
    <dict>
        <key>Label</key>
        <string>com.nullvision.noatime</string>
        <key>ProgramArguments</key>
        <array>
            <string>mount</string>
            <string>-vuwo</string>
            <string>noatime</string>
            <string>/</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
    </dict>
</plist>

Run these:

  • sudo chown root:wheel /Library/LaunchDaemons/com.nullvision.noatime.plist
  • sudo chmod 644 /Library/LaunchDaemons/com.nullvision.noatime.plist
  • sudo launchctl load -w /Library/LaunchDaemons/com.nullvision.noatime.plist

The permissions have to be set to that for launchctl not to complain.

Then you've got this on restart:

$ mount | grep " / "
/dev/disk0s2 on / (hfs, local, journaled, noatime)

You can check if it runs by looking in the console:

29/07/12 2:55:45.334 PM sudo[978]:     Aram : TTY=ttys000 ; PWD=/Library/LaunchDaemons ; USER=root ; COMMAND=/bin/launchctl load -w /Library/LaunchDaemons/com.nullvision.noatime.plist