Sudo Voodoo

You can move your personal User folder to another volume with a few simple commands in OS X’s Terminal application.

First, make sure that on the new volume, the “Ignore ownership on this volume” setting—in the volume’s Get Info window—is not checked. Second, back up—you should never do serious things like this without having a good backup. Then launch Terminal and type the following commands.

(Note: Because each command is one unbroken line, and spacing is important, I’ve put the commands in scrolling boxes. You can copy and paste the commands into Terminal, replacing the appropriate values as noted below.)

	sudo ditto -rsrc "/Users/
	username
	" "/Volumes/
	volumename
	/Users/
	username
	"
	

	sudo niutil -createprop / "/users/
	username
	" home "/Volumes/
	volumename
	/Users/
	username
	"
	

Sudo
asks for your password to provide temporary root access, which is necessary for this exercise; in the above commands, volumename is the name of the new volume, and username is the name of your user folder.

The first command (

sudo ditto
) copies your complete user folder, including all invisible files, to a new user folder on the volume volumename ; the
-rsrc
option ensures that all resource forks are copied. The second command (
sudo niutil
) reassigns your home directory from the original location to the new location. (This Terminal command does exactly the same thing as using the NetInfo Manager utility to change the location of the property home for your user profile.)

At this point you should log out and then log back in to make sure your user folder was copied properly to the new volume and your home folder was properly reassigned. (To check this, open your home folder in the Finder and then Command-click the icon in the title bar of the Finder window; the resulting pop-up display should show computername / volumename /Users/ username .) If this was successful, open Terminal again and type the following commands:

	sudo rm -dr "/Users/
	username
	/"
	

	sudo ln -s "/Volumes/
	volumename
	/Users/username" "/Users/
	username
	"
	

(Where, again, volumename is the name of the new volume, and username is the name of your user folder.) Here, the first command (

sudo rm
) deletes your original user folder. The second command (
sudo ln
) creates a symbolic link (similar to a Mac alias) from the main Users directory on the boot volume to your new user folder on the new volume (mainly so that it’s easier to find your personal user folder—its alias will appear in the standard Users directory on the boot volume).

If you want to use this technique to move all user folders, remove

/username
from the first two commands above. However, you should remove (using the
rm
command) and link (using the
ln
command) each user folder individually, and leave the main Users folder and the Users/Shared folder alone, because some applications require you to have the Shared folder inside the Users folder on the boot volume.

1 2 Page 1
Page 1 of 2
Shop Tech Products at Amazon