Moving users folder to another drive or partition

HyperLiteG4

Registered
I know I saw the question post a while back about moving the Users folder to another partition or drive. I always wanted to do that as well and then I found out how to do it easily....

this is from MacWorld Magazine:


Open Terminal and type the following commands:

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; volumename is the name of the new volume; and username is the name of your user folder.

If that last line returns errors in Terminal or doesn't work, go to your NetInfo Manager in the Utilities folder. Click the lock to allow changes, look in the /users/username folder and highlight your username. Down below in the properties list there is a property that is called home, highlight that one and change the value from /Users/username to /Volumes/volumename/Users/username

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) basically reassigns your home directory from the original location to the new location. (In fact, 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. If you're successful, open Terminal again and type the following commands:

sudo rm -dr "/Users/username/"

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

Here, the first command (sudo rm) deletes your original user folder. The second command (sudo ln) creates a symbolic link (similar to an alias in OS 9) 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, which you'll see 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.

I hope this works for you all, it works great for me. The article can be found at: http://www.macworld.com/2002/06/secrets/osxsecrets.html and it was in the June edition of MacWorld Magazine
 
ohh yah i have done it successfully
it did create a blank folder on the root of the osx drive that was an alias or symbolic link to the new users path
 
Thank HyperLite... I was trying to move to another volume but for got "/volumes/" in the path... was banging my head against the screen! Thank you.
 
Hi HyperLite,

Sorry to resurect this post but I am wanting to do something similar (albeit more granular) on Lion, and hope I can ask you a question or 2.

Note: I have an SSD and an HDD in my machine and I want to have all OS and App related stuff on the SSD and all the other stuff on the HDD (for obvious reasons :) )

1) Would this still be the way to do things on OSX Lion?
2) Can I pick and chose which /Users/username/"Folder" I want to move and,
3) any advice about what I shld and shldn't be moving to achieve what I want

THANKS!!!
 
Hi HyperLite,

Sorry to resurect this post but I am wanting to do something similar (albeit more granular) on Lion, and hope I can ask you a question or 2.

Note: I have an SSD and an HDD in my machine and I want to have all OS and App related stuff on the SSD and all the other stuff on the HDD (for obvious reasons :) )

1) Would this still be the way to do things on OSX Lion?
2) Can I pick and chose which /Users/username/"Folder" I want to move and,
3) any advice about what I shld and shldn't be moving to achieve what I want

THANKS!!!

Hi,

I'm facing the same issue - did you try or find another solution?

Thanks!
 
  1. Would this still be the way to do things on OSX Lion?
  2. Can I pick and chose which /Users/username/"Folder" I want to move and,
  3. any advice about what I should and shouldn't be moving to achieve what I want

  1. No - since 10.5 niutil has been removed from the system and replaced with dscl; and ditto preservers all of the hfs+ special functionality by default.
  2. Yes

You can move one or more users -or- all of them. Depending on which of these situations you want to implement, the details will vary.

Moving some users individually to another place using Terminal is done like this:
Code:
sudo /Users/username /Volumes/volumename/Users/username
sudo chown -R username:staff /Volumes/volumename/Users/username
sudo dscl . -create /Users/username NFSHomeDirectory /Volumes/volumename/Users/username
sudo rm -rf  /Users/username

Moving all users to another place using Terminal is done like this:
Code:
sudo ditto /Users /Volumes/volumename/Users
sudo rm -rf /Users
sudo ln /Volumes/volumename/Users /Users
cd /Volumes/volumename/Users
for user in *
do
    sudo chown -R ${user}:staff ${user}
done
There are ways of doing one or more of these steps in the GUI.
 
BjarneDM,

Will this also work for moving the Applications folder?

My situation: I have a 60GB SSD boot drive, and a 120GB "everything else" HDD. I need to install my copy of Logic, but there isn't enough room on the SSD, so it needs to be installed on the HDD. If I can move the Applications folder to the HDD, then OSX shouldn't have an issue installing Logic there...right?

I'd go ahead and just try it, but I don't want to mess anything up. Thank you for your help!
 
Back
Top