7

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?

  • What happens if you just run sudo mount -vuwo noatime / from the command line? It might produce an informative error message. – Harald Hanche-Olsen Jul 28 '12 at 21:07
  • it gives no error, output shows noatime is enabled but it only lasts until the next restart, so it needs to be scheduled I guess. – Aram Kocharyan Jul 29 '12 at 12:06
  • 1
    Yeah, I knew it had to be scheduled. I asked because I wanted to know if it was the command that had failed. But as you found out, it was the scheduling that didn't work. – Harald Hanche-Olsen Jul 29 '12 at 13:24
  • It will work see my expanded answer > superuser.com/questions/487926/… – user35063 Nov 20 '12 at 18:20
7

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
| improve this answer | |
  • 1
    I think it's okay for you to accept your own answer. It won't give you any reputation, for obvious reason, but it marks the question as solved. – Harald Hanche-Olsen Jul 29 '12 at 10:12
  • says I have to wait till tomorrow, probably to ensure other answers are provided if the OP thinks they've got it when they don't – Aram Kocharyan Jul 29 '12 at 12:04
  • A small note, BTW: This runs the command with the v flag, but that just turns on verbosity. Which is hardly useful in a launchd-controlled job. I don't think it will even find its way into a log file? – Harald Hanche-Olsen Jul 29 '12 at 13:26
  • Yeah it puts it in the console, see my update – Aram Kocharyan Jul 29 '12 at 14:30
  • That console message is from sudo, run in your terminal. The output from the mount command run by launchd is what I was referring to. Does it show up too? – Harald Hanche-Olsen Jul 29 '12 at 16:01
2

The tool Chameleon SSD Optimizer will work for this and it also enables TRIM. I did a lot of research and most were directing to TRIM Enabler. Then, I read few but VERY good news about this one and opted for it as it seemed newer, more stable and with no or fewer bugs.

I installed did it on my iMac (2,5 GHz i5, 16GB Ram, OCZ Vertex3 120GB SSD [boot disk] + original 500GB HD) running OS X 10.7.5. Although it was already a nice fast machine, this made things feel even faster. I use my iMac for photo and video editing with Adobe Packages and everything's stable with this addition.

| improve this answer | |
1

I was having this same problem in ML. I followed the instructions you linked to and kept getting the same result as you.

Davids-MacBook-Pro:~ davidsilver$ mount | grep " / "
/dev/disk0s2 on / (hfs, local, journaled)

However, Harald Hanche-Olsen's recommendation to run sudo mount -vuwo noatime / seemed to correct the problem.

Davids-MacBook-Pro:~ davidsilver$ mount | grep " / "
/dev/disk0s2 on / (hfs, local, journaled, noatime)
| improve this answer | |
  • Ah! It worked but as I feared the flag is reset on restart. It seems the plist isn't getting executed at startup. You can apparently check for com.nullvision in the console if it runs. – Aram Kocharyan Jul 29 '12 at 3:39
  • See my answer... – Aram Kocharyan Jul 29 '12 at 5:03
  • I did as you said above, however I still get /dev/disk0s2 on / (hfs, local, journaled) – David Silver Jul 29 '12 at 21:00
0

I also had problems and had do to some additional steps

  • change the permission of /Library/LaunchDaemons to 777
  • copy an existant plist as com.nullvision.noatime.plist
  • edit it's content as mentioned above and save it
  • change the ownership and permission as mentioned above
  • run launchctl as mentioned above
  • change back the permission of /Library/LaunchDaemons to 755
  • reboot and check with mount | grep " / "
| improve this answer | |
  • Do NOT recommend escalated privileges of 0777. Files in LaunchDaemons should never be higher than 0644. The ownership of the file (with group) would be: root:wheel (something you actually don't list, but strangely reference). – user10355 Dec 21 '13 at 11:25

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .