Howto: Moving Home directory to another volume

After this guide, whenever you reinstall Mac OS X, you can erase your OS X partition and not have to worry about losing your data. It will all be located on a seperate volume or hard drive. When your new system is up and running, you can simply reconnect your Users directory and go your way.
Warning!
Your about to move your Users folder. This folder contains your (and maybe others) documents and information.
Make a backup before doing this procedure, in case something goes wrong!

The first thing we need to do is move our Users folder to the new hard drive. We accomplish this via the Terminal.
sudo ditto -rsrcFork -V /Users /Volumes/YourOtherPartition/Users

This command will copy everything from inside /Users on your system drive to the new drive while keeping any resource forks intact. This may take a while depending on how much data you have.
Once this is complete, we need to tell the NetInfo database that we have moved your home directory. This needs to be done for all user accounts you have created.

To do that open up NetInfo Manager. Click the lock in the bottom left corner to authenticate. Once completed, move to the user’s option and then click on your user name. Under the Property/Values table there will be a row called home. Presently it is pointed at /Users/yourname. Change that to equal the value you had for /Volumes/YourOtherPartition/Users/ and then append your short name to that. If you don’t know your short name, open System Preferences and go to the Accounts pane. You will be able to find your short name there. You can see my values in the screenshot below:

Netinfo Manager

Save your changes to the NetInfo database and then log out and try to log back in. This is very important. If this doesn’t work, you did something wrong. Reread the instructions and double check everything.

Assuming everything is ok, we can now delete your old Users directory and create a symbolic link to the new one. We have to use symbolic links instead of aliases because the Unix backend doesn’t understand the alias. From Terminal enter these commands with your values:

sudo rm -dr /Users  
sudo ln -s /Volumes/YourOtherPartition/Users /Users

So, let’s say that you actually did do a fresh install of Mac OS X and want to reconnect your home directory. It’s simple, just set the values in NetInfo Manager and create the symbolic link again.

When things go wrong

While I never have had trouble, sometimes new user accounts don’t create the home directory. This is a simple fix that can be accomplished with a few more Terminal commands.

sudo cp -R /System/Library/User\ Template/English.lproj  /Volumes/YourOtherPartition/Users/shortname

Then you need to jump into NetInfo Manager and set the home value to the new location. You should be good to go from there.

Comments (0)  Permalink

Comments

add a comment

This blog is gravatar enabled.
Your email adress will never be published.
Comment spam will be deleted!

Name*
E-Mail
For Spammers Only
URL
Comment*
Notify me via E-Mail when new comments are made to this entry
Remember me (needs cookies)