Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

10.4: Move Users directory to another partition System 10.4
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.:
  • Boot partition: The partition where Mac OS and applications are installed.
  • Users partition: The new partition that the user directories will be moved to, i.e. /NewPartUsers. (The following examples detail one user account named marty.)
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.]
    •    
  • Currently 3.56 / 5
  You rated: 5 / 5 (9 votes cast)
 
[74,558 views]  

10.4: Move Users directory to another partition | 26 comments | Create New Account
Click here to return to the '10.4: Move Users directory to another partition' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
10.4: Move Users directory to another partition
Authored by: balthisar on Apr 16, '07 08:10:12AM

What's the benefit of this hint versus using fstab? I've been using something like this in my fstab files since Mac OS X 10.0 or 10.1:

LABEL=BigUsers /Users hfs rw 1 2

No messing about loading anything into Netinfo database; software updates work properly; applications work properly; and everything else I can think of just works properly.

Maybe I'm just incredibly lucky, or just happen not to use applications that get confused by this.

Oh, yeah: I *do* have to keep the volume name for the Users volume different on each computer, though, otherwise interesting things happen when I SMB-mount the other computers' Users volumes.

---
--Jim (me)



[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: Anonymous on Apr 16, '07 08:15:07AM

No, you're not lucky. I use exactly the same method with no problems. Not necessary even to create a symbolic link. Mind you, I do name my partition "Users".



[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: timcrawf on Apr 19, '07 07:51:57AM

how do I do this. Please give more details



[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: pinguru on Apr 20, '07 02:34:21AM

We need to do this for all our users for various reasons.

Provided I get the entries correct in fstab, it works just fine, and we still have root to login as if big problems happen.

The thing that's bugging me though is when I have

UUID=XXXX1234-XXXX-1234-XXXX-1234XXXX1234 /Users hfs rw,auto 0 0

or

LABEL=User-Homes /Users hfs rw,auto 0 0

in fstab, the volume 'User-Homes' still shows up on the desktop as well as being mounted at /Users. This doesn't half cause the users to get in a confused state rather quick. Does anybody know how to stop the volume from showing on the desktop and just mount as requested????

Cheers
Dan



[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: neuralstatic on Apr 16, '07 08:41:33AM

wouldn't step 6, then 7 on the second option delete the new partition copy of the users?

i think 7 should read marty.org



[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: martycastilla on Apr 23, '07 10:05:17AM
Yes you are correct, I missed adding the extension .org on step seven option #2.
sudo rm -dr /Users/marty.org


[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: FOOOD on Apr 16, '07 09:02:12AM

The way I've always done it (when changing my user folder to a different volume called Data) is to open Netinfo Manager & go to Users.
Then change the original from:

/Users/*yourusername*


To:

/Volumes/Data/*yourusername*



[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: Gigacorpse on Apr 17, '07 12:06:00PM

Personally, that is how I do it, as the only user on my computer is me. My normal everyday account is unprivledged and I keep my admin account's home directory on the system partition. I also store all my third party applications in ~/Applications, so that nothing is changed outside of my personal home directory.



[ Reply to This | # ]
10.4: An EASY way to move Users directory to another partition
Authored by: Cat2Mac on Apr 23, '07 02:14:25PM
I have experimented with most of the processes mentioned above, & have used the fstab/uuid method since 10.2 quite successfully. However, there has also been a problem with the "phantom /Users directory & associated drive." You may notice that /Users disapears from Finder; also, some disk utilities (such as iStat) don't see the drive (2nd internal SATA in my case). This had been a minor nuisance, but lately I wanted things simpler & more reliable:

1. First create 2 admin accounts, let's call them AA & BB.

2. Login to AA & open a Terminal window.

IMPORTANT: You must be completely logged out of BB... Busy files (in use by BB) will cause problems. Also, you must remove the "NewUser" partition from /etc/fstab (recommend deleting fstab)

3 cd /Users

4. sudo cp -Rp BB /Volumes/NewUsers/BB

5. sudo mv BB BB.old (#save the original for now)

6. sudo ln -s /Volumes/NewUsers/BB

7. Restart & login as BB ... DONE! No other settings need be modified. You should see /Users; plus, iStat & other apps will see all mounted drives.

You can leave AA in /Users, move it to the NewUsers volume (perform steps 2 - 6, login as BB & move AA), or delete as desired. Delete the /Users/BB.old folder once you are satisfied that everything is working OK...

NOTE: As of 10.4 "cp" is able to correctly handle resource forks.

I have found this process to be fast, simple to perform (steps 3 - 6 do the actual work), & uses the same techniques as OSX: look at /etc, /tmp, /var, they are all symbolic links into /private.

I hope this helps ...

Stan Lubiak

[ Reply to This | # ]
10.4: An EASY way to move Users directory to another partition
Authored by: martycastilla on Apr 23, '07 02:43:34PM

Any reason for not updating Netinfo with the change to the actual home directory path? I'm still trying to understand Netinfo so forgive my ignorance.

BTW: thanks for the tip on cp in 10.4



[ Reply to This | # ]
10.4: An EASY way to move Users directory to another partition
Authored by: Cat2Mac on Apr 24, '07 08:52:53AM

My experience is that Unix command line apps DON'T use netinfo.



[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: Fanglord on Apr 16, '07 10:10:46AM

One way to avoid the problem of not having access to an admin account with the second method is to keep the admin user folder on the main drive. You can't use the /Users folder, as it's really a symlink to the other partition, but you can set up another directory where this user folder is to be stored (the root user's home folder is located at /var/root, for example). You can use Netinfo Manager to specify the location for that user's folder.

That way, you always have a working admin user, but don't have to worry about CLI stuff when creating each new user.

PS I have run into problems with the fstab edits. I had a situation where the drive that contained the accounts didn't mount at startup, so the system created it's own directories at the location /Volumes/<drivename>/Users.

Once I rebooted, the new directories stayed, and my drive was named <drivename> 1. Needless to say, this was a pain to clean up (shutdown, disconnect the drive, boot, go in and delete the directories that were created, shutdown, reattach the drive and boot normally). I'd rather use a symlink.



[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: chucky23 on Apr 16, '07 11:42:33AM
Dan Frakes had the definite answer to this question back in 2002.

http://www.macworld.com/2002/06/secrets/osxsecrets/

His method is more simple than what is presented here, and is battle tested.

[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: blgrace on Apr 16, '07 06:14:32PM
FWIW: I used the following resources with success to move my Users directory to my other internal drive. The second link has pictures (using Netinfo Manager) to point back to your Users and home directory.

<a href="http://www.bombich.com/mactips/homedir.html">Bombich</a>;

<a href="http://maczealots.com/articles/home/">MacZealots</a>;

Hope it's helpful

[ Reply to This | # ]
10.4: Move Users directory to another partition
Authored by: blgrace on Apr 16, '07 06:17:33PM
10.4: Move Users directory to another partition
Authored by: martycastilla on Apr 23, '07 10:26:59AM

I wish I had run across Dan Frakes' article when I was searching, it would have saved me some work. I see his approach any "simpler". There are 4 basic steps in both of our procedures.

  • Copy the original users files with ditto
  • Change the Netinfo setting for the users home directory.
  • Remove the original users files with rm
  • Create the symbolic link with ln -s
  • The only difference I see are the examples used and the amount of verbosity. Granted I added the move command as a precaution. Thank you for the pointer to Mr Frakes article.



    [ Reply to This | # ]
    10.4: Move Users directory to another partition
    Authored by: BraindeadMac on Apr 16, '07 04:38:25PM

    Editing /etc/fstab works fine, and has worked well since 10.2.
    Use the "LABEL" directive

    Where I've "dittoed" the Users volume to drive "Space" as above, I edit /etc/fstab to this:

    LABEL=Space /Users hfs rw 1 2



    [ Reply to This | # ]
    10.4: Move Users directory to another partition
    Authored by: BraindeadMac on Apr 16, '07 07:44:35PM

    I spazzed. After 10.3, this changed to not being as reliable if you had more than one disk. I now use the UUID to identify each drive in /etc/fstab, in other words, the entry in /etc/fstab looks like this:

    UUID=3DD36DB0-A4C9-3138-B0B2-22A21FC9685D /Users hfs rw 1 2

    You can find the UUID easily in Disk Utility (Select the partition and get info).



    [ Reply to This | # ]
    10.4: Move Users directory to another partition
    Authored by: Gigacorpse on Apr 17, '07 12:07:20PM

    I seem to recall a hint here on using UUIDs with fstab.



    [ Reply to This | # ]
    10.4: Move Users directory to another partition
    Authored by: pinguru on Apr 20, '07 02:42:01AM

    A quick script I wrote for those too lazy to open Disk Utility or run diskutil...

    As usual, run at your own risk, don't use it if you don't understand it...

    # This script gets the UUID for a given volume name on OS X

    #!/bin/bash -
    # Get a list of all devices from diskutil, grep for the one we want
    # and pass to awk to print that column, assign the result to $DEVNAME
    DEVNAME=`diskutil list | grep $1 | awk '{print $6}'`

    # Get diskutil's info for DEVNAME, grep for the UUID and print it
    diskutil info $DEVNAME | grep UUID | awk '{print $2}'


    [ Reply to This | # ]
    10.4: Move Users directory to another partition
    Authored by: ScottRussell2 on May 02, '07 03:38:54PM

    This is exactly the way to do it. In fact, as part of every new machine I build for my clients, I include the following in the /etc/rc.local script (note that my 2nd partition is named "Data" by default):

    ### BEGIN CODE ###

    if [[ ! -e /etc/fstab ]] ; then
    logger "RC.LOCAL: /etc/fstab DOES NOT exist - creating to mount /Users as /Volumes/Data"

    DRIVE=`df`
    INDEX=1
    while [[ "$DRIVE" != *"/Volumes/Data"* && "$INDEX" -le 5 ]] ## get the device ID to pass to diskutil
    do
    sleep 2
    DRIVE=`df` && logger "RC.LOCAL: Get device ID of /Volumes/Data, Attempt # $INDEX"
    let INDEX+=1
    done

    DRIVE=`df | grep /Volumes/Data | /usr/bin/awk {'print $1'}` && logger "RC.LOCAL: Drive = ${DRIVE}"
    UUID=`diskutil info "${DRIVE}" | grep UUID | /usr/bin/awk {'print $2'}` ## this method is slightly faster
    echo "UUID=${UUID} /Users hfs rw 1 1" >> /etc/fstab ## create /etc/fstab with this line
    niload -m fstab / < /etc/fstab ## merge /etc/fstab into NetInfo database
    logger "RC.LOCAL: restarting computer for /etc/fstab import to complete"
    shutdown -r now ## RESTART THE COMPUTER SO THIS NEW /etc/fstab WORKS
    fi

    ### END CODE ###

    ---
    Best wishes,
    Scott



    [ Reply to This | # ]
    10.4: Move Users directory to another partition
    Authored by: martycastilla on Apr 23, '07 10:59:52AM

    I'm glad to see someone posted a reference to /etc/fstab using UUID over LABEL. Are there any drawbacks to the UUID approach? My Boot and User partitions are on the same drive with RAID 1 mirror. I had thought I tried the UUID approach and ran across a problem.



    [ Reply to This | # ]
    10.4: Move Users directory to another partition
    Authored by: Cat2Mac on Apr 24, '07 01:15:00PM

    Using LABEL is fine if you NEVER rename the drive. LABEL looks for the named disk. UUID NEVER changes (even if reformated)!



    [ Reply to This | # ]
    Related: FileVault
    Authored by: victory on Apr 19, '07 07:06:06AM

    Ok, this isn't a general solution to the o.p.'s situation, but it's an option to consider if you want to move your user homedirs off of the root filesystem onto another volume (partition).

    Use Filevault.

    When you enable FileVault for a specific user (say 'userone'), OSX will create a hidden dir in /Users named .userone . In that dir will be the encrypted disk image (userone.sparseimage) that normally gets mounted under /Users/userone when they first log in. The neat thing is that there's nothing to prevent you from logging in under another privileged account and creating a symlink from /Users/.userone to any directory anywhere on your system (yes, even on another volume/partition) that holds userone.sparseimage.

    I've been using this technique on my PowerBook ever since FileVault first appeared in (10.3?) until the present (10.4.9) with zero problems. Admittedly, I started using FileVault for the security benefits, but it turns out that having my userdir (as a FileVault disk image file) on a different partition makes it faster for me to do targeted backups on specific parts of the system (e.g. a system backup that only backs up the root partition, a users backup that backups up the location that contains all the FileVault user disk-image files, etc).

    Anyhow, just something to consider if you're already using FileVault (or are willing to consider using it despite some of the disadvantages (i.e. disk I/O performance, etc)



    [ Reply to This | # ]
    10.4: Move Users directory to another partition
    Authored by: martycastilla on Dec 04, '07 08:31:15PM

    I wanted to add that when I upgraded to 10.5 everything still worked.



    [ Reply to This | # ]
    10.4: Move Users directory to another partition
    Authored by: david-bo on May 15, '08 01:42:29AM

    I have always just used a soft link

    /Users -> /Volumes/2ndVol/Users

    Has never caused any problems.



    [ Reply to This | # ]