Updated for Lion Dec 18th, 2011
If you aren’t running an SSD in your mac, you should be! The performance improvement is startling, boot times < 30 seconds, applications open instantly. SSDs lead to better battery life, and reduced chance of crashing hard drives due to shock or drops. This post consolidates the key tips & tricks to running an SSD in current Macs.
Why are SSDs Superior
Latency & Performance
SSDs don’t have to wait for a read/write head to be lined up in the right place above a spinning platter that also has to get to the correct rotational position to enable a sector to be read or written. It’s direct memory access, extremely fast. Latencies of a hard drive: 4-10ms, vs 0.1-0.2ms for a good SSD. This makes an incredible difference as random read and write operations tend to bog down hard drives and are very typical on a multi-tasking machine. A standard hard drive is limited in its throughput by rotational speed, SSDs are not, allowing an SSD to read/write 2-3 times the amount of data. For an illustration of this – check out a video made by JoshForceOne, a good friend of mine (who happens to be one of the most knowledgable folks out there on OS X86).
http://www.youtube.com/watch?v=pO8_o6mifW8
Power Consumption
No moving heads, no spinning platters at 5000-7200RPM means less power used. SSDs don’t incur any latency to “spin-up” so they can drop down to low power states and resume immediately. This can lead to a 10%+ increase in laptop battery life.
Durability
We’ve all had hard drives crash.. they’re moving parts that can be affected by all sorts of things and often fail in laptops due to being constantly moved around, dropped, bumped etc.
Recommended SSDs
Choosing an SSD is largly about choosing the right controller. Sandforce controllers have taken the market by storm and offer the best performance and durability out there. My two top picks are the OCZ Vertex 3, and drives by OWC. Apple SSD options are a bit overpriced, and may not use the latest & greatest controllers.
Overprovisioning
Different drives have different rates of over-provisioning - just about every SSD has more capacity than it is listed to have and the manufacturer will configure the drive to reserve a certain percentage of space for wear-leveling and such. Depending on your profile, consider this when buying an SSD as this is extremely valuable space. The OWC 200GB drive and 240GB drive are essentially the same thing, with different amounts of reserved space. One important reason for this is that if the drive will see an extreme amount of activity (say if it’s used in a server for a high performance database), and/or if it will be filled to capacity on a regular basis, you want extra space reserved for wear-leveling as this will increase the life of the drive.
General Rule: If you’re going to run the SSDs in a RAID set or on a heavily used server – go with the over-provisioned drives (i.e the 200GB instead of the 240GB). If not, get the version with extra usable space!
Drive Caddies
Mac Pro’s are built for 3.5″ drives, while most SSDs are 2.5″. Grab one of these Pro Sleds to perfectly fit an SSD and have it slide right into place in a Mac Pro. There are others around, like from OWC, but the Pro Sled I linked comes in versions for various series of Mac Pros back to 2006, the OWC ones only fit brand new models.
Macbook Pro’s are built for 2.5″ drives, but include a relic from the past couple decades – an optical drive. Grab an optical bay replacement mount to put a second 2.5″ drive into your laptop. The cheap route is to search Amazon for “optibay”, there you’ll find some $17 options. A higher-end route is to get one from OWC, or the real Optibay kit from MCE which includes a USB enclosure for your removed DVD drive (helpful if you need to re-install the OS).
Hybrid – SSD + HD
Using the optical bay replacement solutions listed above, you can choose to run a macbook pro with one standard hard drive, and one SSD. This gives the beneifit of SSD for speed and the hard drive for cost-effective storage. Her are a couple of tips if you go this route:
- Put your home directory on the SSD – too many things read/write from that location and it will keep your drive spinning all the time if you put it on the hard drive – bad for battery life.
- Get as big of an SSD as you possibly can afford, you’ll eventually want to put more and more things onto it. I ran a hybrid setup for a few months then decided to junk the spinning disk and go with two SSDs.
SSD Tweaks
SSDs are susceptible to wear over time (although this has been greatly reduced in newer drives running the Sandforce controllers), so here are a few tweaks to eliminate some needless writes to the drive.
Disable “last access time”
The default behavior of an HFS+ filesystem is to keep track of the last time any file was accessed. This is largely pointless, it’s important to know when a file was last updated, but who cares about access time!
Create a file called com.noatime.plist (actually you can name it anything you want, but use the extention .plist), containing the following:
<?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.my.noatime</string>
<key>ProgramArguments</key>
<array>
<string>mount</string>
<string>-vuwo</string>
<string>noatime</string>
<string>/</string>
</array>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
Place that file in the directory /Library/LaunchDaemons
Set the ownership of the file with the command
sudo chown root:wheel /Library/LaunchDaemons/com.noatime.plist
Delete /etc/rc.local if it exists
Restart the system
To verify, enter the command mount at a Terminal prompt. You should see “noatime” listed as an attribute of your filesystem.
NOTE: If you have multiple SSDs, see this post for details on how to set noatime on each of them.
Disable Hibernate
Computers today have a lot of RAM, every time you close the lid on a MacBook Pro (or otherwise put it to sleep) it will write out a hibernate file containing the contents of memory. This could be an 8GB file, written on a regular basis. Try an app called SmartSleep. Or just disable hibernate all-together with this command:
sudo pmset -a hibernatemode 0
Disable Sudden motion Sensor
Some folks say if you’re running an SSD with no physical hard drives at all that you can disable the Sudden Motion Sensor. I haven’t bothered to do this (as I haven’t seen evidence of it actually providing a performance improvement) but here’s the command:
sudo pmset -a sms 0
Backups
Yes you still need to back up an SSD, they can die just like any other piece of technology.
TRIM
Read up on SSD technology and you will inevitabely run into the term TRIM. There’s a great explanation of it here. In summary when you write data to a standard hard drive, there is no difference between writing to an empty block, and overwriting a block that already has data in it. On an SSD the block must be erased before being re-written, effectively causing a double-write operation if the block is not empty. TRIM is a way for the Operating System to tell the SSD “go ahead and delete this block” once it knows a file has been deleted and the underlying space can be freed. The SSD can then consider this a known empty block and when a new write operation comes along, it won’t have to erase the block first before writing. Some SSDs have a Garbage Collection feature in their firmware that attempts to figure out what blocks aren’t needed and proactively delete them during idle time. This is ok, but TRIM is really the superior solution.
TRIM support is built into OS X, however Apple has decided to enable it only for SSDs that are its own OEM models. This is easy enough to get around though. There was a GUI “TRIM Enabler” around that worked for 10.6, but don’t bother with it on Lion. Instead, use this method provided by Grant Pannell:
Step 1 – Backup the kext
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
Step 2 – Patch the kext to enable TRIM
sudo perl -pi -e 's|(\x52\x6F\x74\x61\x74\x69\x6F\x6E\x61\x6C\x00{1,20})[^\x00]{9}(\x00{1,20}\x51)|$1\x00\x00\x00\x00\x00\x00\x00\x00\x00$2|sg' /System/Library/Extensions/IOAHCIFamily.kext/Contents/PlugIns/IOAHCIBlockStorage.kext/Contents/MacOS/IOAHCIBlockStorage
Step 3 – Clear the kext cache
sudo kextcache -system-prelinked-kernel
sudo kextcache -system-caches
Step 4 – Reboot
Step 5 – Check that TRIM is enabled properly
Open “About This Mac”, then click “More Info…”, then “System Report…”. Under Hardware open Serial-ATA, then click on one of your SSDs – look for “TRIM Support: Yes”.

NOTE: If you do future system updates TRIM support may be disabled, easy enough just repeat this process.
Recent Comments