10.4: Move Users directory to another partition

Apr 16, '07 07:30:00AM

Contributed by: martycastilla

I spent quite a bit of time looking for information on how to move my Users directory to another partition or drive in 10.4. I'm used to Linux, where you would just edit the /etc/fstab file and you're done. Well, after reading a few articles, it was clear that it wasn't possible to use the fstab file without problems, though I did find a few good articles for part of what I wanted to do. I've put this hint together based on several postings and recommendations from macosxhints and other sites.

I basically wanted to move my Users directory to another partition without creating problems when adding applications or doing backups. The following is what I did to make it work with Tiger. After setting up your partition or RAID volumes, proceed with the following. Note that this setup assumes there are two partitions, Boot and Users. The second partition is for /NewPartUsers.:

Read on for two different ways to accomplish this task...

Option #1: Preferred solution, as this version has a "safety net"

As part of this solution, we will retain the original Users directory, and move only the individual users' home directories. The reason for this is so that we can create an Admin account and have it reside on the Boot partition and not on the Users partition. That way, if for some reason Apple changes something that breaks this, you can still login to the Admin account and fix the other user accounts.

  1. Set up all user accounts and restore user files if starting from a fresh disk drive, otherwise skip this step.
  2. Copy the user directories to the new partition with this command:
    	sudo ditto -rsrcFork -V /Users /Volumes/NewPartUsers
  3. Open NetInfo Manager and change the "home" path to the new path /Volumes » NewPartUsers » marty.
  4. Save your changes, log out, and log back in.
  5. If everything is working, rename the original user folder:
    	sudo mv /Users/marty /Users/marty.org
  6. Now create a symbolic link for each user's account, so that the NewPartUsers path works as it should:
    	sudo ln -s /Volumes/NewPartUsers/marty /Users
  7. If everything is working, remove the original user folder:
    	sudo rm -dr /Users/marty.org
For new accounts added later, you will still need to follow similar steps:
  1. Create the new user's account.
  2. Copy the user directories to the new partition with:
    	sudo ditto -rsrcFork -V /Users/newuser /Volumes/NewPartUsers/newuser
  3. Open NetInfo Manager and change the "home" path to the new path /Volumes » NewPartUsers » newuser.
  4. Save your changes, log out and log back in.
  5. Now create a symbolic link for each users account so that the NewPartUsers path works as it should:
    	sudo ln -s /Volumes/NewPartUsers/newuser /Users
  6. If everything is working, remove the original user's folder:
    	sudo rm -dr /Users/newuser
That's it for the first option...

Option #2:

If you don't want to do all of the command line work every time you add a user, and want a more transparent approach, do the following. You will be able to add users as normal, and only require the NetInfo update after creating the user account. However, you will lose the safety net of the admin account access in the event of a problem.
  1. Set up all user accounts and restore user files.
  2. Copy the user directories to the new partition with:
    	sudo ditto -rsrcFork -V /Users /Volumes/NewPartUsers
  3. Open NetInfo Manager and change the "home" path to the new path, /Volumes » NewPartUsers » marty.
  4. Save your changes, log out and log back in.
  5. If everything is working, rename the original users folder:
    	sudo mv /Users/marty /Users/marty.org
  6. Now create a symbolic link for each users account so that the NewPartUsers path works as it should:
    	sudo ln -s /Volumes/NewPartUsers /Users
  7. If everything is working, remove the original user's folder:
    	sudo rm -dr /Users/marty
For new accounts you will still need to follow similar steps:
  1. Create the new user's account.
  2. Open NetInfo Manager and change the "home" path to the new path, /Volumes » NewPartUsers » marty.
  3. Save your changes, log out and log back in.
That is it. This worked just fine on my Mac Pro. I've run backups, Apple software updates, and various other applications without problems.

[robg adds: We've run hints on moving the Users folder in the past, but I thought it might be time to revisit. If you have a different process, please share in the comments.]

Comments (26)


Mac OS X Hints
http://hints.macworld.com/article.php?story=2007041217125440