Saturday, July 23, 2011

Optimizing an SSD for Lion

TRIM
First and foremost, the one thing you must do after installing Lion is run Trim Enabler. What this does is enable the trim feature for your SSD if it is a non-Apple certified one (e.g if you bought something like an OCZ or a Corsair drive). Without trim enabled, you will wear down your SSD faster because the SSD will have to re-write information a lot more. What trim does is when you delete a file it is completely removed from the memory block. However, without trim, the SSD will think the file is not in the memory block, even though it still is. That means that when a new file has to be written, the no trim SSD will have to delete the old file and write the new one, where the trim SSD just has to write the new one.

HIBERNATION OFF
When OS X goes to sleep normally, it uses hibernation mode. This is ok on a HDD as you have a ton of space. However, on an SSD you don't have a ton of space and every byte counts. When hibernation mode is enabled, your computer will write all the contents of your RAM to your SSD. That means if you have a total of 8 GB or RAM, it will be written to your SSD. That is a lot of space to lose to RAM. We want to turn this off, so go ahead and open up Terminal.
Note: The $ sign is not required as part of the code.
1. In Terminal type the following:

$ sudo pmset -a hibernatemode 0
This will then turn off hibernation.
2. Next we have to remove the old file (you may not have a file to remove if you just installed Lion and haven't put your computer to sleep yet). To remove the file type into Terminal the following:
$ sudo rm /var/vm/sleepimage
And that is it, you will now have no hibernation on your computer!

HARD DRIVE SLEEP
By default OS X enables the command to put your hard drive to sleep when inactive. However, SSDs don't need to be put to sleep. Some even are known to freeze up when put to sleep. To disable this, simply go to System Preferences->Energy Saver and disable it. If you are on a laptop, make sure to disable it for both with and without the power adapter.

SUDDEN MOTION SENSOR
Another feature that is Hard Drive specific. This feature prepares a HDD for impact if it detects the computer falling suddenly. The features will disengage the hard drive head and stops the disks from spinning. With an SSD however, there are no moving parts, so this command is useless. To turn it off, type the following code into Terminal:

sudo pmset -a sms 0

DISABLE SPOTLIGHT
If you don't search your computer a lot, then you have not reason to let spotlight index your computer. Simply turn it off by typing the following into Terminal:
sudo mdutil -a -i off

I hope these tips help you out there who wanted to optimize your SSD for Mac.

~Dave

2 comments:

  1. I don't think you should recommend a Snow Leopard TRIM tool for Lion (http://digitaldj.net/2011/07/21/trim-enabler-for-lion/).

    ReplyDelete
  2. Thanks Tim! I didn't know that. Guess I should use this fix now so I don't ruin the life span of my SSD

    ReplyDelete