Optimizing MacOS X Lion for SSD

April 1st, 2012 by Martin Leave a reply »

Approx. 18 months back I bought my first SSD (120GB OCZ Vertex 2) for my (then) new iMac. I am using it as the primary disk, while I kept the original 1TB HDD as the secondary one. So far I’ve been very happy with it and thanks to applying some tweaks the drive seems still healthy as new. Recently I bought another SSD – this time a 240GB Vertext 3 for my MacBook – that one I am using as the only drive in the laptop. And as I found out, with the new features in Lion, some additional tweaks need to be applied – especially in case of a laptop. So, I’ve decided to write this blog – for my own benefit (to keep track of what I did in case I have to re-apply it in the future) as well as for the benefit of others who may run into this blog entry. Here I am providing the list of things I found on various web sites or came up with myself to minimize the risk the SSD wears out too soon. Some of them you may already be aware of. So, here is a list of content in case you want to skip to particular sections:

DISCLAIMER: Applying any of these tweakss is at your own risk. Make sure you back up your computer before trying any of these.

Don’t run benchmarks on your new SSD
Use Trim Enabler
Turn off local Time Machine snapshots [laptops only]
Turn off hibernation [laptops only]
Set noatime flag
Move user home directories to HDD [SSD+HDD only]
Use RAM disk or HDD for temporary files
Turn off sudden motion sensor [SSD+HDD only]
Turn off hard drive sleep [SSD+HDD only]
References/Other tweaks

I’ll try keeping this list up to date. Let me know if any other tweaks work well for you.

Don’t run benchmarks on your new SSD

Some people, right after they buy a new SSD, want to enjoy the speed and are eager to find out how much faster exactly their new SSD is than the old HDD. So they get this cool idea of running some extensive benchmarks to see the amazing performance numbers. Benchmarks usually write a lot of data to the disk (to test the write speed), wearing it out. So it is the best way how you can ruin your SSD even before you start using it. Don’t do it.

Use Trim Enabler

TRIM support is essential for keeping the SSD healthy. Unfortunately, MacOS supports TRIM only for Apple-supplied SSD’s. If you bought a 3rd party one like I did, you have to tweak the system to be able to turn on the TRIM support. Trim Enabler is a simple utility that does this for you. You can read more here or go to the TrimEnabler web site directly.

Turn off local Time Machine snapshots [laptops only]

If you are using the SSD in a laptop, and you turned the Time Machine backups on, you should know that OS X Lion does local snapshots at times when your Time Machine disk is not available. This is quite common – you are typically connecting your external TM disk only once in a while or you are using Time Capsule at home but take your laptop to the office every day for 8+ hours. You can confirm if the local TM backups are on by opening Time Machine Preferences:
Time Machine Preferences pane showing local backups are enabled

There is no GUI switch to turn these local backups off, but it can easily be done on the command line. Just start Terminal.app and execute the following command:

sudo tmutil disablelocal

Once you do this, the TM Preferences panel will immediately reflect it – the text will change from “Time Machine keeps local snapshots as space permits, and:” to “Time Machine keeps:”. To turn it back on, you can simply run the following in the Terminal:

sudo tmutil enablelocal

Also note, this feature gets turned on automatically whenever you turn off and on the Time Machine – so don’t forget to turn the local backups back off again whenever you do that.

I found out about how to turn off the local backups from this article: http://osxdaily.com/2011/09/28/disable-time-machine-local-backups-in-mac-os-x-lion/

Turn off hibernation [laptops only]

Another feature of Mac OS turned on by default on laptops is, that it saves all the memory to disk when entering sleep mode. This is to ensure your laptop does not lose your work if it runs out of battery while “sleeping”. The more RAM you have, the more gigabytes it writes to the disk every time you close the lid/put it to sleep. I typically do this at least twice a day – when leaving the office and when going to sleep in the evening. If you are in a similar situation and you have 8GB of RAM, that means your MacBook writes 16 to 24 GB of hibernation data to your SSD every day. Here is how you can turn this off – it will not only make your SSD’s life longer, but also significantly speed up the time it takes for your laptop to enter the sleep mode:

sudo pmset -a hibernatemode 0

I found it in this article: http://news.metaparadigma.de/osx86-enable-and-disable-hibernation-57/. Reading the man pages for pmset sheds some more light on the factory defaults and meaning of the hibernatemode values:

We do not recommend modifying hibernation settings. Any changes you make are not supported. If you choose to do so anyway, we recommend using one of these three settings. For your sake and mine, please don’t use anything other 0, 3, or 25.

hibernatemode = 0 (binary 0000) by default on supported desktops. The system will not back memory up to persistent storage. The system must wake from the contents of memory; the system will lose context on power loss. This is, historically, plain old sleep.

hibernatemode = 3 (binary 0011) by default on supported portables. The system will store a copy of memory to persistent storage (the disk), and will power memory during sleep. The system will wake from memory, unless a power loss forces it to restore from disk image.

hibernatemode = 25 (binary 0001 1001) is only settable via pmset. The system will store a copy of memory to persistent storage (the disk), and will remove power to memory. The system will restore from disk image. If you want “hibernation” – slower sleeps, slower wakes, and better battery life, you should use this setting.

Once you turn off hibernation, you can also remove the sleep image file that will free up several GB of disk space (depending on how much RAM you have):

sudo rm /var/vm/sleepimage

Set noatime flag

MacOS (like other unix-based systems) by default records last access time for every file. I.e. every time you read a file, a write is made on the filesystem to record this action. There is no point in doing it and no side effects if you disable that by mounting the root filesystem with noatime flag set. To do that create a file named for example “com.nullvision.noatime.plist” (you can pick any other name you wish) in the directory /Library/LaunchDaemons with the following content:

<?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">

    
        Label
        com.nullvision.noatime
        ProgramArguments
        
            mount
            -vuwo
            noatime
            /
        
        RunAtLoad
        <true/>
    

And execute the following command in Terminal:

sudo chown root:wheel /Library/LaunchDaemons/com.nullvision.noatime.plist

Restart the machine.

You can verify that it worked by executing the following in Terminal:

mount | grep " / "

You should get the following output (i.e. see noatime in the list in parentheses):

/dev/disk0s2 on / (hfs, local, journaled, noatime)

This tweak was taken from blogs.nullvision.com, which seems to not be available anymore, but I found a mirror of the old content here: http://www.icyte.com/saved/blogs.nullvision.com/441781
And the same trick (inspired by the same blog) is here: http://blog.philippklaus.de/2011/04/ssd-optimizations-on-mac-os-x/

Move user home directories to HDD [SSD+HDD only]

This tweak is only useful if you have both SSD as well as HDD in your Mac. I’m using this in my iMac. I moved all the content of /Users folder to the HDD and created a symbolic link from the SSD to it (so that I don’t have to change the home folder location in the user settings, as I read some applications don’t like it and may not work correctly). To do that execute the following commands in Terminal:

sudo ditto /Users /Volumes/your_hdd_name/Users
sudo mv /Users /Users.bak
sudo ln -s /Volumes/your_hdd_name/Users /Users

UPDATE (5/22/2012): To be safe, you should also go to System Preferences, click on Users & Groups, click the lock icon to unlock advanced editing (password prompt will appear). Once unlocked, you should be able to right-click on each user account and choose Advanced Options from the pop-up menu. Once in the Advanced Options dialog, change the Home directory of the user from “/Users/user-name” to the new location (e.g. “/Volumes/HDD/Users/user-name”).

Now, check if your home folders are showing up correctly in Finder. If so, restart your computer.

Finally, delete the back-up of your Users folder on the SSD by typing the following into the Terminal:

sudo rm -rf /Users.bak

Use RAM disk or HDD for temporary files

If you have enough RAM, you can dedicate (typically around 256 to 512 MB) of RAM to a RAM disk. RAM disk is a virtual disk that only resides in memory, so is suitable for storing data that need to live only until you shut down your computer. Temporary files are ideal for this. You can create a RAM disk during the boot time and redirect all the temporary files there. To do that, create a file named “MoveTempFoldersToRamDisk.sh” in your home directory and put the following content in:
Now, run the following in the Terminal:

chmod 755 ~/MoveTempFoldersToRamDisk.sh
~/MoveTempFoldersToRamDisk.sh

This creates two RAM disks on startup – one 256MB large for /private/tmp (command “RAMDisk /private/tmp 256” in the middle of the above script) and another one 64MB large for /var/run. You can now delete ~/MoveTempFoldersToRamDisk.sh from your computer.
For the changes to take effect, you have to restart.

If you decide to undo this tweak in the future, you can do it simply by deleting /System/Library/StartupItems/RamFS directory from your Mac. E.g. by executing the following command in the Terminal:

sudo rm -rf /System/Library/StartupItems/RamFS

Again, restart is needed for this to take effect.

There are some small drawbacks to applying this tweak:

  • After applying it it takes a few seconds (2-3 on my machine) to shut down
  • It lowers the size of RAM usable for applications

If you are bothered by the above and have HDD in your Mac as well, you can consider moving the temporary files to HDD instead of the RAM disk. The steps are similar to moving the user home directories. E.g. to move /private/tmp, execute the following in the Terminal:

sudo ditto /private/tmp /Volumes/your_hdd_name/private/tmp
sudo rm -rf /private/tmp
sudo ln -s /Volumes/your_hdd_name/private/tmp /private/tmp

 
RAM disk portion of this tweak taken from here: http://blog.philippklaus.de/2011/04/ssd-optimizations-on-mac-os-x/
Originally suggested by blogs.nullvision.com (mirror at http://www.icyte.com/saved/blogs.nullvision.com/441781)

Turn off sudden motion sensor [no HDD only]

If SSD is the only drive in your Mac, there is no point in using the Sudden Motion Sensor. You can switch it off by executing the following in the Terminal:

sudo pmset -a sms 0

Taken from http://poller.se/2010/08/optimizing-mac-os-x-for-ssd-drives/

Turn off hard drive sleep [no HDD only]

Some websites mention SSD may freeze when the hard drive sleep feature is on, so it is recommended to turn it off. However, you probably don’t want to do this if you also have a HDD in your Mac. To switch the hard drive sleep off, go to System Preferences->Energy Saver and uncheck “Put the hard disk(s) to sleep when possible”.
Energy Saver preferences pane screeshot

 
Taken from http://poller.se/2010/08/optimizing-mac-os-x-for-ssd-drives/

References/Other tweaks

The tweaks that I presented are the tweaks that I thought are worth applying. None of them really limits any features. There are other tweaks, which I did not want to apply as I would be giving up on some functionality (such as disabling the Spotlight) or I was not comfortable with (e.g. disabling the swap files). You can find these and more on the following web sites:
http://poller.se/2010/08/optimizing-mac-os-x-for-ssd-drives/
http://blog.philippklaus.de/2011/04/ssd-optimizations-on-mac-os-x/
http://www.ocztechnologyforum.com/forum/showthread.php?62354

157 comments

  1. Marcus says:

    Thank you for the hints. Worked fine for me. If you use FireFox and got some RAM the following settings might make sence, too:
    go to :about:config an set:
    browser.cache.disk.enable = False
    browser.cache.memory.enable = True
    browser.cache.memory.capacity = 1048576

  2. Philippe Lagarrigue says:

    Hello Martin,

    thanks for this useful and well documented tips but what about system and application log files? I think it would be good to have them witten in an external disk too!

    Kind regards

    Philippe

  3. Jacky says:

    The ramdisk for on the /var/run will disappear after my laptop woke up.

    I found that the line “dev=`hdik -drivekey …` in /System/Library/StartupItems/RamFS/RamFS should be changed to “dev=`hdiutil attach -nomount ram://$rdsize`” in Lion or later.

  4. Fredo says:

    Hi,

    i have many problems of space with my SSD… I thus tried to move the users folder with terminal.

    – i dont can see the new “users” folder on my HDD
    – i cant delete the back-up “users” folder on my SSD and now, my SSD is very full!
    – i can see the backp-up folder “Volumes” (35 GB) with Disk Inventory X, but i cant delete it

    now, I dont know really any more what to make… Can you help me?

  5. me says:

    Thanks for this info. Can you help me get the script for moving temps? I can’t find “/System/Library/StartupItems”

  6. Marco says:

    I did the following trick to make the Time Machine disablelocal persistent:
    just get into crontab editing from Terminal with crontab -e, hit “i” to enable insert mode and paste the following line:
    */1 * * * * sudo sudo tmutil disablelocal >/dev/null 2>&1
    hit “ESC” to exit the insert mode, and exit and save with “:wq”(ENTER)

    This will make sure once a minute that local snapshots are disabled.
    This has to be done on a per user basis of course, as crontab on Unix are.

  7. Kenny Jenkins says:

    The advice regarding activating TRIM is terrible. With the Sandforce controller you do not need to enable TRIM in the Mac OS.

    I’d rather trust the folks at OWC than this amateur.

    Enjoy degrading your SSD.

  8. John says:

    I have been unable to make noatime work since updating to lion. I have followed the direction from the nullvision blog that i have used since 10.6.1, and I have followed the direction here to no avail. Does anyone have any suggestions? Thank you.

  9. Anders says:

    Hello Martin!

    Thanks for an easy understandable set of tweaks.

    I did the “Move user home directories to HDD” and “Use HDD for temporary files” but got some strange results.

    When I repair disk permissions I get:
    “Users” should be drwxr-xr-x ; they are lrwxr-xr-x
    “private/tmp” should be drwxrwxrwt; they are lrwxrwxrt
    “tmp” should be lrwxr-xr-x; they are drwxrwxrwt

    “Disk Utility” fixes them, but when I check again I get the exact same result.

    Are these permissions because the files are NOT on the system drive or is something wrong?

    Everything seems to work, but it is a little scary… not knowing exactly what is going on. And I cant seem to undo it.

    Thanks again

    Anders

    • Anders says:

      Turns out Ableton Live and Max (two programs I use a lot) couldn’t figure out what was going on when I moved the /private/tmp folder. I reversed the command line and they worked again. And the disk permission is alright again.

      But “User” and “tmp” still differ… should I be worried and why tmp? I must have written something wrong in the command line.

  10. Maria says:

    Hello from Spain,

    I have a doubt… I have read this article and I have a new iMac 27″ late 2012 i5 3,2GHz Fusion Drive 1Tb 8GB RAM and I would like to know if I must activate “noatime” in SSD part of the Fusion Drive or not?

    Could you help me with this doubt?

    Regards and thank you!

    Maria

  11. Dennis Ng says:

    My log using Plextor M5S and WD 1TB (replacing the internal optical drive) using a local internal mount under Mac OS X 10.8.2 and 2009 MacbookPro with a partial broken screen (inherited from my son who got a new 15in MBP), plus an upgrade from 2G to 8G memory.

    So far it works.

    I followed the web page (http://blog.alutam.com/2012/04/01/optimizing-macos-x-lion-for-ssd/ for the actual patch but use the other page http://digitaldj.net/2011/07/21/trim-enabler-for-lion/ as the main reference) except one major difference i.e. I am not using Trim Enabler and use the Trim Patch instead. Also, I used https://gist.github.com/clarencesong/3768688 as I have 10.8.2 i.e.

    sudo perl -pi -e ‘s|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x4D)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg’ /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage

    .

    Otherwise, it is mostly the same and in summary here … reboots here and theres not mentioned:

    1. sudo tmutil disablelocal

    it work (across reboot). But it may not be necessary as I TimeMachine is internal WD 1 TB drive.

    2. sudo pmset -a hibernatemode 0

    “sudo pmset -g” to check plus delete the private image file (but unlike the web page, I delete after I enable the trim).

    3. sudo chown root:wheel /Library/LaunchDaemons/com.nullvision.noatime.plist

    and “sudo mount” showed that it worked.

    4. move /Users to HDD

    sudo ditto /Users /Volumes/your_hdd_name/Users
    sudo mv /Users /Users.bak
    sudo ln -s /Volumes/your_hdd_name/Users /Users

    it worked

    5. move tmp file to HDD (and not ram file as suggested)

    sudo ditto /private/tmp /Volumes/your_hdd_name/private/tmp
    sudo rm -rf /private/tmp
    sudo ln -s /Volumes/your_hdd_name/private/tmp /private/tmp

    6. I do not turn off the sudden motion sensor and also not the hard drive, as I got an internal hard drive

    7. Time machine backup just in case the follow patch goes wrong

    8. Enable the trim patch as said above

    sudo cp /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage.original

    Patch — see above

    sudo touch /System/Library/Extensions/

    sudo kextcache -system-prelinked-kernel

    (got some system messages:

    / locked; waiting for lock.
    Lock acquired; proceeding.
    Kernel file /mach_kernel does not contain requested arch: i386

    hope it does not matter :-) !!!)

    sudo kextcache -system-caches

    Reboot

    9. Check system report (About apple …) and the Trim Support is enabled

    10. delete files

    sudo rm /var/vm/sleepimage
    sudo rm -rf /Users.bak

    It worked so far.

    Finger crossed.

  12. Sergey says:

    Привет! Хотелось бы спросить про создание Ram Disk у меня этот скрипт выдает ошибку
    /Users/sergeyza/MoveTempFoldersToRamDisk.sh: line 1: {rtf1ansiansicpg1251cocoartf1138cocoasubrtf510: command not found
    /Users/sergeyza/MoveTempFoldersToRamDisk.sh: line 2: {fonttblf0fnilfcharset0: command not found
    /Users/sergeyza/MoveTempFoldersToRamDisk.sh: line 2: f1fnilfcharset0: command not found
    /Users/sergeyza/MoveTempFoldersToRamDisk.sh: line 2: f2fnilfcharset0: command not found
    /Users/sergeyza/MoveTempFoldersToRamDisk.sh: line 3: syntax error near unexpected token `}’
    /Users/sergeyza/MoveTempFoldersToRamDisk.sh: line 3: `}’

  13. hiru says:

    Thank you.. this freed up 5 G on my 128 SSD!

  14. Bob says:

    When I follow your steps, I found that after two or three days(do not shutdown the computer), the “wired” memory would increase more and more, about 4 or 5 Gb. Meybe more.
    I don’t know what I have did is wrong. Could you help me?

  15. John Haas says:

    256M for /private/tmp is too small for MS office updates. I changed it to 512M. Don’t know the minimum size.

  16. Willings says:

    Good tips! Try later :D

  17. dan says:

    You’re a savior! fixed the power consumption issues I was having!

  18. Pirex says:

    For people with SSD + HDD , configure timemachine localsnapshots do your HDD is easy : please follow this easy steps :

    Original Link : http://apple.stackexchange.com/questions/80183/any-way-to-change-the-location-of-time-machine-local-backups-mobilebackups-t

  19. Henri says:

    Thanks for the very extensive list of advise ! This is very helpful. Replaced my DVD drive with an SSD and can’t believe how fast my old macbook pro got !

  20. Henri says:

    Thanks alot for the tipps ! With an SSD inside, using the mac makes so much more fun !

  21. kilaz says:

    I made your ramdisk tip, but maybe small with the 256MB.
    How can I resize the disk to a big amount like 1024MB?
    I have 16GB of RAM.
    Must i delete the disk and create again?

    • Lukas says:

      No, you don’t need to delete the RAM-Disk or anything like that. Since it is created new for every time the system boots up, and is only persistent ’till the system goes down, you just have to change the parameters in the script, and from the next startup on, the RAM-Disk will be bigger. Just replace any apperance of “256” with “1024” or anything like that, and it should work!

    • E7G says:

      download RAMDiskCreator. makes it a lot easier you don’t need any scripts to create ram disks

  22. Yosi says:

    Any problem when upgrading to mavericks?

    • Paul says:

      After upgrading to Mavericks (from Mountain Lion) I have the following problem with RamFS: when booting, “something” unmounts /private/var/run (while /private/tmp remains mounted OK).

      – system.log:

      Nov 10 09:45:56 smac kernel[0]: hfs: mounted :private:tmp on device disk2
      Nov 10 09:45:56 smac.local mds[84]: (Normal) Volume: volume:0x7fb7ce803600 ********** Bootstrapped Creating a default store:1 SpotLoc:(null) SpotVerLoc:(null) occlude:0 /private/tmp

      Nov 10 09:45:56 smac kernel[0]: hfs: mounted :private:var:run on device disk3
      Nov 10 09:45:56 smac.local mds[84]: (Normal) Volume: volume:0x7fb7cd04f000 ********** Bootstrapped Creating a default store:1 SpotLoc:(null) SpotVerLoc:(null) occlude:0 /private/var/run

      Nov 10 09:45:56 smac.local com.apple.SecurityServer[14]: Session 100005 created
      Nov 10 09:45:56 smac kernel[0]: hfs: unmount initiated on :private:var:run on device disk3

      – mount:

      /dev/disk2 on /private/tmp (hfs, local, union, noatime, nobrowse)

      – diskutil list:

      /dev/disk2
      #: TYPE NAME SIZE IDENTIFIER
      0: :private:tmp *536.9 MB disk2
      /dev/disk3
      #: TYPE NAME SIZE IDENTIFIER
      0: /private/var/run *67.1 MB disk3

      My version of RamFS (relevant parts only):

      RAMDisk() {
      mntpt=$1
      rdsize=$(($2*1024*1024/512))
      ConsoleMessage “Creating RamFS for $mntpt”
      # Create the RAM disk.
      dev=`hdik -drivekey system-image=yes -nomount ram://$rdsize`
      # Successfull creation…
      if [ $? -eq 0 ] ; then
      # Create HFS on the RAM volume.
      newfs_hfs -v “$mntpt” $dev
      # Store permissions from old mount point.
      eval `/usr/bin/stat -s $mntpt`
      # Mount the RAM disk to the target mount point.
      mount -t hfs -o noatime -o union -o nobrowse $dev $mntpt
      # Restore permissions like they were on old volume.
      chown $st_uid:$st_gid $mntpt
      chmod $st_mode $mntpt
      fi
      }

      StartService () {
      ConsoleMessage “Starting RamFS disks…”
      RAMDisk /private/tmp 512
      RAMDisk /private/var/run 64
      }

  23. Andi030 says:

    Hi i got a question:
    i did the step for “Move user home directories to HDD” unfortunatlly i want to change the appilcations folder back to the SSD. I tried to do it in reverse with
    sudo ditto /Volumes/Daten/Users /Users
    but the response is “ditto: /Users/MY_user_name: Not a directory”
    what to do?

  24. LexSchellings says:

    Hibernatemode and sleepimage is DIFFERENT in Mavericks : the Mavericks sleepimage is about 1.1GB and not the complete ramsize anymore. If the sleepimage is removed and hibernate set to 0, the sleepimage will be written anyway. If you set a zerosize locked sleepimage onstead a Swapfile will be written of the same size 1.1GB.
    It is not useful anymore to try hibernatemode/sleepimage optimizing.

    • Martin says:

      True, but one question.
      Maverics (Mountain Lion aswell) when sleeping, wakes after each 60 minutes to check updates (and maybe other serverices) and then goes back to sleep. When looking log, it takes up to 2 minutes to wake, check and go back to sleep. All logs end up with:

      14.02.14 9:19.34,000 kernel[0]: hibernate image path: /var/vm/sleepimage
      14.02.14 9:19.34,000 kernel[0]: efi pagecount 63
      14.02.14 9:19.34,000 kernel[0]: hibernate_page_list_setall(preflight 1) start 0xffffff80e3e42000, 0xffffff80e3ffa000
      14.02.14 9:19.34,000 kernel[0]: hibernate_page_list_setall time: 360 ms
      14.02.14 9:19.34,000 kernel[0]: pages 420413, wire 198499, act 152885, inact 12809, cleaned 0 spec 450, zf 226, throt 0, compr 47800, xpmapped 90424
      14.02.14 9:19.34,000 kernel[0]: could discard act 2446 inact 713 purgeable 2 spec 4583 cleaned 0
      14.02.14 9:19.34,000 kernel[0]: hibernate_page_list_setall preflight pageCount 198499 est comp 59 setfile 527880072 min 1073741824
      14.02.14 9:19.34,000 kernel[0]: [0x3394810000, 0x40000000]
      14.02.14 9:19.34,000 kernel[0]: [0x0, 0x0]
      14.02.14 9:19.34,000 kernel[0]: kern_open_file_for_direct_io(0) took 2 ms
      14.02.14 9:19.34,000 kernel[0]: Opened file /var/vm/sleepimage, size 1073741824, partition base 0x0, maxio 2000000 ssd 1
      14.02.14 9:19.34,000 kernel[0]: hibernate image major 1, minor 0, blocksize 4096, pollers 5

      Does it mean, that every sleep writes 1Gb data to sleepimage?

  25. Sandor says:

    Don’t worry about the data writes.. it will take years and years and you will have bought 5 SSDs already and this one will be so old and worthless…

  26. jorge says:

    does this work for mountain lion as well?

  27. John Cappa says:

    /dev/disk0s2 on / (hfs, local, journaled)
    was the result of the noatime plist test after rebooting

  28. Daniel says:

    Thanks for this helpful article. FYI: The Trim Enabler link is broken. Here is a newer working link: http://www.cindori.org/software/trimenabler/ maybe you want to update it :-)

  29. Linh1978 says:

    Thanks for this tutorial,
    I followed all the steps, but not being accustomed to shell script, I discovered a new App “RAMDisk Manager” we can easily move “T” and another folder to RAM Disk.
    http://www.macupdate.com/app/mac/51310/ramdisk-manager

  30. nandi says:

    Hi,
    ich habe Dein Script versucht in AppleScript abzuspeichern, er meckerte bei dem Befehl

    sudo mkdir RamFS (zweite Zeile) oder ist der Apple Script Editor hier falsch?

    Denn er wollte auch nicht in .sh abspeichern…

    Für einen Tipp wäre ich Dir sehr dankbar!

  31. You’re a savior! fixed the power consumption issues I was having!

  32. Jean Dean says:

    Is the thing with the Ram disk still working in OSX 10.8 and 10.9? And does it still make sense?

    I have got 24GB of DDR-Ram shouldn`t i increase the RAM-Disk to maybe 2GB?

  33. Aaron says:

    I’ve got no luck getting this to work with OS X Yosemite. Anything different with that update?

Leave a Reply