How to split your home folder onto multiple drives

This post is part of my series on Clean Lion install for Ruby Development.

Firstly, as far as I know there is no perfect way to do this – ideally you could tell OS X where each directory in your home folder lives (or points to)… and this could have easily been achieved by simple sym links – but – OS X doesn’t allow some folders in your home folder to be deleted! So this is the next best thing – a sym link inside these folders:

  • Documents
  • Movies
  • Music
  • Pictures

And I recommend leaving the following where they are – because they will be used by the OS frequently:

  • Desktop
  • Library
  • Public (Drop box)
  • All other files, particularly hidden system files

Why not just move the location of the home folder?

OS X allows you to specifiy the location of your home folder – so it could be on the second hard disk, but, if like me, you have a SSD as your OS disk and a larger disk for your other files then IMO it makes sense to keep the OS related files on the SSD for maximum speed benefit – otherwise you will constantly need your other disk, which means the lag in wake-up time will always be there.

There probably is a way to delete undeletable files and folders, but I’d rather just do it this way to be on the safe side.

How to create the sym links

If you don’t know the paths to your folders, simply navigate to them in finder and then just drag the folder into a terminal window and it will show you the path.

To create sym links just;

ln -s /Volumes/DISK-NAME/YOUR-ACCOUNT-NAME/FOLDER-NAME ~/FOLDER-NAME

So for example, I would create a sym link to my Pictures folder like this:

ln -s /Volumes/DISK2/Aston/Pictures ~/Pictures

So the Pictures folder in my home directory will point to the Pictures folder on my second hard disk named DISK2 – although in this case, as the Pictures folder can’t be deleted or modified OS X will place the sym link inside it.

If you have a space in a name, you can use:

ln -s /Volumes/DISK2/Aston/Website\ Files ~/Website\ Files

Your home folder should end up looking something like this:

How to get additional drives indexed by spotlight

Finally, to get additional hard disks indexed by spotlight simply go to system prefs > spotlight > privacy

And then add your additional drive then remove it, and spotlight will start indexing it. That’s it!