{"id":76,"date":"2013-01-16T18:35:03","date_gmt":"2013-01-16T06:35:03","guid":{"rendered":"http:\/\/collingwood.me.uk\/blog\/?p=76"},"modified":"2013-01-16T19:14:46","modified_gmt":"2013-01-16T07:14:46","slug":"os-x-on-ssds","status":"publish","type":"post","link":"https:\/\/collingwood.me.uk\/blog\/index.php\/os-x-on-ssds\/","title":{"rendered":"OS X on SSDs"},"content":{"rendered":"
I recently replaced the boot drives of my 17″ MacBook Pro, 15″ MacBook Pro and Hackintosh with SSDs. I have replaced the Superdrives on both MacBooks with cradles holding 750GB 7200RPM SATA HDDs, so I wasn’t too worried about having giant-capacity SSDs, I basically just needed enough to hold the OS and Applications. Consequently, a good balance of price and capacity at the time (Dec 2012) was 128GB Sandisk SATA 3 drives. Yes, the MacBooks are not SATA 3, but my Hackintosh is.<\/p>\n
I am a great fan of partitioning, coming from a Solaris background (Back when Sun was good), and consequently, partitioned both the SSD boot drive and the HDD, as follows:<\/p>\n
SSD:<\/p>\n
Boot – 60GB
\nApplications – 50GB
\nFastAccess – 18GB<\/p>\n
HDD:<\/p>\n
Swap – 24GB (MacBook Pro) 72GB (Hackintosh) (3 X amount of RAM)
\nUsers – Remainder of disk<\/p>\n
The reason the swap partition is so high will become apparent later<\/p>\n
So….<\/p>\n
Build the OS in the usual way, onto the Boot partition on the SSD.<\/p>\n
Move Applications.<\/strong><\/p>\n There is no real need to move the applications, I just prefer to in order to compartmentalise things<\/p>\n When all is complete, and you have rebooted, move the applications to the Applications partition:<\/p>\n Next, make sure that the Applications partition mounts on \/Applications at boot. First find the GUID of the Applications partition. Open Disk Utility, highlight the Applications partition, and click File -> Get info. Highlight the value of the Universal Unique Identifier parameter, and hit Command-c to copy it to the clipboard.<\/p>\n Add the following line to \/etc\/fstab (“sudo vifs” will open it for editing):<\/p>\n Empty the \/Applications directory, so that it works correctly as a mount point:<\/p>\n Reboot. Run Software Update, and update everything. The first part is now complete.<\/p>\n In part 2, we move users, swapfile, sleepimage and tmp files off the SSD, add TRIM support and switch off access time recording for files on SSD partitions<\/p>\n Move Users.<\/strong><\/p>\n Run the following command:<\/p>\n Then open System Preferences, click on Users and Groups, Unlock to make changes, right click on each user to open Advanced Options, and change the Home Directory to the correct path<\/p>\n Reboot<\/p>\n Move Swapfile.<\/strong><\/p>\n The swapfiles are usually located in \/var\/vm. Obviously, we want them off the SSD, so we’ll put them in the Swap partition we created on the spinny disk<\/p>\n Run the following commands:<\/p>\n Edit com.apple.dynamic_pager.plist. Replace<\/p>\n with<\/p>\n Reboot<\/p>\n Move sleepimage<\/strong><\/p>\n When the system hibernates, it saves the contents of memory to disk. The size of this file varies, but can be up to the the size of system RAM. This is why the Swap partition is so big – we’re going to put this file there (Usual location is \/var\/vm)<\/p>\n Run the following command:<\/p>\n Reboot<\/p>\n Move tmp files<\/strong><\/p>\n tmp files live until reboot. we don’t really want them on the SSD, they can also go on the spinny drive.<\/p>\n Run the following commands:<\/p>\n Reboot<\/p>\n Add TRIM Support<\/strong><\/p>\n Download Trim Enabler<\/a><\/p>\n Install it<\/p>\n Switch it on.<\/p>\n Reboot<\/p>\n Switch off File Access Time Recording<\/strong><\/p>\n In \/Library\/LaunchDaemons, create the following files:<\/p>\n com.apple.noatime1.plist<\/p>\n com.apple.noatime2.plist<\/p>\n com.apple.noatime3.plist<\/p>\n Reboot<\/p>\n DONE!<\/strong><\/p>\n","protected":false},"excerpt":{"rendered":" I recently replaced the boot drives of my 17″ MacBook Pro, 15″ MacBook Pro and Hackintosh with SSDs. I have replaced the Superdrives on both MacBooks with cradles holding 750GB 7200RPM SATA HDDs, so I wasn’t too worried about having … Continue reading cd \/Volumes\/Applications\r\nsudo ditto \/Applications .<\/pre>\n
UUID=<Universal Unique Identifier from above<\/em>> \/Applications hfs rw 0 2<\/pre>\n
cd \/Applications\r\n sudo rm -rf *<\/pre>\n
sudo ditto \/Users \/Volumes\/Users<\/pre>\n
cd \/System\/Library\/LaunchDaemons\r\n sudo cp com.apple.dynamic_pager.plist com.apple.dynamic_pager.plist.bak\r\n sudo plutil -convert xml1 com.apple.dynamic_pager.plist<\/pre>\n
<string>\/sbin\/dynamic_pager<\/string>\r\n <string>-F<\/string>\r\n <string>\/private\/var\/vm\/swapfile<\/string><\/pre>\n
<string>\/bin\/bash<\/string>\r\n <string>-c<\/string>\r\n <string>\/bin\/wait4path \/Volumes\/Swap\/ && \/sbin\/dynamic_pager -F \/Volumes\/Swap\/swapfile<\/string><\/pre>\n
sudo pmset -a hibernatefile \/Volumes\/Swap<\/pre>\n
sudo ditto \/private\/tmp \/Volumes\/Users\/tmp\r\n sudo rm -rf \/private\/tmp\r\n sudo ln -s \/Volumes\/Users\/tmp \/private\/tmp<\/pre>\n
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <!DOCTYPE plist PUBLIC \"-\/\/Apple\/\/DTD PLIST 1.0\/\/EN\"\r\n \"http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\">\r\n <plist version=\"1.0\">\r\n\u00a0\u00a0 <dict>\r\n\u00a0\u00a0\u00a0\u00a0 <key>Label<\/key>\r\n\u00a0\u00a0\u00a0\u00a0 <string>com.apple.noatime1<\/string>\r\n\u00a0\u00a0\u00a0\u00a0 <key>ProgramArguments<\/key>\r\n\u00a0\u00a0\u00a0\u00a0 <array>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>mount<\/string>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>-vuwo<\/string>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>noatime<\/string>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>\/<\/string>\r\n\u00a0\u00a0\u00a0\u00a0 <\/array>\r\n\u00a0\u00a0\u00a0\u00a0 <key>RunAtLoad<\/key>\r\n\u00a0\u00a0\u00a0 <true\/>\r\n\u00a0\u00a0 <\/dict>\r\n <\/plist><\/pre>\n
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <!DOCTYPE plist PUBLIC \"-\/\/Apple\/\/DTD PLIST 1.0\/\/EN\"\r\n \"http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\">\r\n <plist version=\"1.0\">\r\n\u00a0\u00a0 <dict>\r\n\u00a0\u00a0\u00a0\u00a0 <key>Label<\/key>\r\n\u00a0\u00a0\u00a0\u00a0 <string>com.apple.noatime2<\/string>\r\n\u00a0\u00a0\u00a0\u00a0 <key>ProgramArguments<\/key>\r\n\u00a0\u00a0\u00a0\u00a0 <array>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>mount<\/string>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>-vuwo<\/string>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>noatime<\/string>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>\/Applications<\/string>\r\n\u00a0\u00a0\u00a0\u00a0 <\/array>\r\n\u00a0\u00a0\u00a0\u00a0 <key>RunAtLoad<\/key>\r\n\u00a0\u00a0\u00a0 <true\/>\r\n\u00a0\u00a0 <\/dict>\r\n <\/plist><\/pre>\n
<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n <!DOCTYPE plist PUBLIC \"-\/\/Apple\/\/DTD PLIST 1.0\/\/EN\"\r\n \"http:\/\/www.apple.com\/DTDs\/PropertyList-1.0.dtd\">\r\n <plist version=\"1.0\">\r\n\u00a0\u00a0 <dict>\r\n\u00a0\u00a0\u00a0\u00a0 <key>Label<\/key>\r\n\u00a0\u00a0\u00a0\u00a0 <string>com.apple.noatime3<\/string>\r\n\u00a0\u00a0\u00a0\u00a0 <key>ProgramArguments<\/key>\r\n\u00a0\u00a0\u00a0\u00a0 <array>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>mount<\/string>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>-vuwo<\/string>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>noatime<\/string>\r\n\u00a0\u00a0\u00a0\u00a0\u00a0\u00a0 <string>\/Volumes\/FastAccess<\/string>\r\n\u00a0\u00a0\u00a0\u00a0 <\/array>\r\n\u00a0\u00a0\u00a0\u00a0 <key>RunAtLoad<\/key>\r\n\u00a0\u00a0\u00a0 <true\/>\r\n\u00a0\u00a0 <\/dict>\r\n <\/plist><\/pre>\n