Thursday, December 1, 2011

Speeding-Up My Mac Pro

We love our Mac Pro. It's an early model from Apple; designated the MacPro1,1, it was built way back in November 2007. It has served us faithfully and reliably for several years now. However, the two 2.66 GHz Dual-Core Intel Xeon processors are getting a little old (from a technology age standpoint), and it no longer has the pep of a shiny, brand new machine. I considered the possibility of purchasing a new Mac Pro, but just cannot justify the expense at this time. So I decided to look for ways to breathe some new life into the box I already owned.

Although this blog specifically references the Mac Pro, the same changes could be made to other models of Apple computers that have more than one hard disk. Use the advice provided in this blog at your own risk. We are not responsible for any damage to your computer or loss of data that may occur!

The Mac Pro uses Serial-ATA (SATA) technology operating at a 3 Gigabit link speed to support its data storage devices. I've upgraded the drives a few times and currently have 5 Tb of hard disk storage provided by a combination of four SATA drives. One drive stores the OS X operating system, the second is used for local data storage, the third is used as a backup drive for the local data, and the fourth drive is used for Time Machine. I know there is a lot of backup storage here, but the two methods of archiving copies (plus occasional backup to external hard disks) has saved my rear end more than once.

As fast as the 3 Gigabit SATA hardware is, spinning magnetic disks remain a performance bottleneck. But all is not lost, because the beauty of the SATA hardware is that it can access multiple drives at the same time. What I discovered is that Apple's default method for locating folders does not take advantage of this capability, and herein lies my zero to low-cost method to improve the performance of your Mac Pro.

A few months ago I installed a nifty menu bar app named DiskLED. This app provides a disk activity monitor that can be customized to display an icon in the menu bar that changes color with disk activity (think traffic light with red, yellow, and green indicators). What I noticed right away was that the disk where OS X resided was constantly being hit, and hit hard. The corresponding icon was almost always colored red, while the disk with my local data was only sparingly used when files were loaded or saved.

When I viewed the folder structure of the main disk, I noticed that it not only contained the OS X files, but the Users folder as well. While I had already moved much of my data from the Users folder to my local data storage (i.e. the music, movie, and photo libraries), there was still a lot of other data in the Users folder. Specifically, there are a lot of user-specific application settings and support files that are located in hidden files and folders, and they are apparently accessed quite often as you use applications. If you would like to view these hidden files and folders, you must first tell Finder to reveal them. You can do this by opening the Terminal app and entering the following commands:

     defaults write com.apple.finder AppleShowAllFiles TRUE
     killall Finder

To return Finder to its default of keeping these certain files and folders hidden, enter the following commands in Terminal:

     defaults write com.apple.finder AppleShowAllFiles FALSE
     killall Finder

It was my hypothesis that an easy way to better leverage the speed and capability of the fast SATA devices was to separate the operating system and applications from the user data. However, it's not simply a matter of dragging the Users folder to the neighboring hard disk. Here is the process that is required.

1) Preparation

Start out by creating a backup of your hard disk that contains the operating system, applications, and users folders. It's better to be safe than sorry.

After you have successfully created the backup, it's a good opportunity to do some spring cleaning. Delete some of those old apps you have never used, delete user accounts that are no longer needed, clear your web browser(s) cache, and empty the Trash.

My final preparation step is to open the Disk Utility app and select the corresponding hard drive, and Repair File Permissions. This will help to make certain that the Users folder is in good order before it is moved.

2) Copy the User Folder

To copy all of the files and folders within the Users folder, including the hidden, locked, and system related files, you should use a backup or copy utility such as Synchronize! Pro X, SuperDuper, or Carbon Copy Cloner. These utilities are currently free to use on a limited basis, but we believe that these types of apps are invaluable for maintaining a scheduled backup of important files and folders. We recommend that you consider supporting the developers and purchase a copy.

Select as the source the operating system drive and the Users folder only. Then as the destination, the local data drive. Click on copy / clone and wait patiently for the data to be copied between hard drives. An example screen shot from Carbon Copy Cloner is shown below.


3) Link Each User Account to the New Users Folder Location

This is an important step. You must tell OS X to use the new location for the Users folder, otherwise it will continue to look for the folder in its original location. Open System Preferences, then select Users and Groups. Click the lock to enter your admin password to make changes. Now for each account, Control-Click the account name for access to Advanced Options. Then for the Home Directory entry, click on Choose to navigate to the new location of the Users folder. An example screen shot from the Users and Groups dialog is shown below.


You must repeat this linking process for each user account.

In order to activate the link to the new Users folder location, you must restart your computer. After restarting, you can verify that you have linked to the new location by navigating to the Home Directory, Control-Click on the "Home" icon and select Get Info. Here you will see the path to the folder, and it should designate the new drive location.

4) Delete the Old Users Folder

With the User folder successfully moved and linked to the new location, you can now delete the old User folder. After sending it to the Trash, empty the Trash.

5) Create a Symbolic Link to the New Users Folder

This last step may be the most important. Many applications (i.e. iTunes) will look for the Users folder on the same hard drive where OS X is installed. However, we have moved the folder, thereby "breaking" the application. We can fix that by creating a symbolic link to the new folder location.

Don't be fooled. A symbolic link is not the same thing as an alias. A symbolic link (symlink) is recognized by the OS X filesystem, whereas an alias is only used by Finder. The easiest way to create a symlink is to use a utility named Symbolic Linker. Download the utility and carefully follow the installation instructions. Then Control-Click on the Users folder and choose to Make Symbolic Link. You will now have a new folder named "Users symlink". While holding the Command key, drag and drop this folder to the same location as your original Users folder (that you have since deleted). Holding the Command key forces the folder to be moved instead of copied between hard drives. After you move "Users symlink", rename it to "Users". Now every application that looks for the Users folder will be redirected to the new location on your local data drive.

6) Enjoy the Improved Performance

That's it! You have successfully moved the Users folder. Now the Mac Pro will more effectively use the computer's fast SATA capability to access data from multiple drives simultaneously, essentially increasing the speed of the computer.

I have not completed benchmark speed tests to scientifically quantify the performance improvement, but anecdotally, applications do run faster. Observing the DiskLED icons, I can visually see that the OS X drive is no longer being accessed constantly since the files have been spread across two drives. This is most obvious when using disk intensive graphics applications like iPhoto or GIMP.

As a bonus, moving the Users folder will make it easier to transition the user data to a new computer because all of the data is installed on one drive. This also makes creating backups a more simple process; I no longer have to select specific folders from the OS X drive, I just backup the entire local data drive!