SSD Tweaks for Mac OS X
After installing a Samsung 470 SSD in my Macbook Pro 2011, I found a number of different suggestions for optimizing performance and disk space usage around the Internet. Here’s a quick list of the steps I took:
Disable the hard drive Sudden Motion Sensor
Since the SSD drive has no moving parts, we can disable this sensor
sudo pmset -a sms 0
Turn off Hibernate
Every time you close the lid on your Macbook, it writes out RAM to the SSD. Since my Macbook has 8 GB of RAM, this is a time consuming process, uses 8 GB of disk space and also contributes to the wear on the SSD drive. The downside to this setting is that if the Macbook loses power completely (for example, if the battery runs down completely), the current state will be lost (much like if you held down the power button to reset the mac).
I also made sure the drive wouldn’t sleep and disabled lidwake (not related to SSD, but it’s nice to disable automatic resume whenever the laptop is opened and has helped with some problems resuming from my Cinema display).
sudo pmset -a hibernatemode 0
sudo pmset -a disksleep 0
sudo pmset -a lidwake 0
sudo rm /var/vm/sleepimage
Confirm the settings with sudo pmset -g.
Disable file access time tracking
Normally the Mac will keep track of the last time any file was accessed. This contributes to the wear on the SSD drive, so it is helpful to disable it.
sudo touch /Library/LaunchDaemons/com.noatime.root.plist
Edit the file and paste 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">
Reboot and confirm the setting with:
mount | grep noatime
/dev/disk0s2 on / (hfs, local, journaled, noatime)
Adjust Spotlight settings
Spotlight is the Mac’s indexer and search tool. While a lot of people just disable this service (sudo mdutil -a -i off), I need Spotlight because Outlook 2011 uses it for searching my Outlook data.
To adjust this setting, go to System Preferences…Spotlight…Privacy. If you exclude directories that change frequently, you’ll save wear on your SSD. For example, I excluded:
/Library/Application Support/Riverbed/Steelhead Mobile/datastore
~/Documents/Parallels (where I store my VMs)
Although technically not supported by Apple, I used the Trim Enabled for Mac to turn on Trim for my SSD. There is some discussion that this reduces the initial performance of the disk, but improves the performance over the long haul.
Adjust Windows VMs (in Parallels or VMware)
To further reduce the wear on the SSD, I made some changes to my Windows VMs based on the VMware View Optimization Guide:
bcdedit /set BOOTUX disabled
vssadmin delete shadows /All /Quiet
Powershell disable-computerrestore -drive c:\
netsh advfirewall set allprofiles state off
powercfg -H OFF
net stop “sysmain”
fsutil behavior set DisableLastAccess 1
schtasks /change /TN “\Microsoft\Windows\Defrag\ScheduledDefrag” /Disable
schtasks /change /TN “\Microsoft\Windows\SystemRestore\SR” /Disable
schtasks /change /TN “\Microsoft\Windows\Registry\RegIdleBackup” /Disable
schtasks /change /TN “\Microsoft\Windows Defender\MPIdleTask” /Disable
schtasks /change /TN “\Microsoft\Windows Defender\MP Scheduled Scan” /Disable
schtasks /change /TN “\Microsoft\Windows\Maintenance\WinSAT” /Disable
Be sure to review the entire PDF for other VM optmizations (based on your own needs).
Reduce amount of space used by OS X
Since having more free space helps contribute to the life of the SSD, I removed a number of unnecessary files. Great directions for this here: Freeing space on your Mac OS X startup disk.