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

go for it | 31 comments | Create New Account
Click here to return to the 'go for it' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
go for it
Authored by: robh on Mar 25, '01 02:02:01PM

I see no problem in moving /Users onto another disk. Unix doesn't care where you keep it.

First you'll need to move (backup) the existing /Users out of the way with "mv /Users /old_Users".

Now you can either rename the 2nd disk /Users or set a symbolic link (aka symlink or soft link) to it. I don't have a second disk to play with, but I believe you can get away with just renaming it, using "mv /Disk2 /Users". The symbolic link solution is to let OSX mount the disk and then use "ln -s /Disk2 /Users".

If you want to use the 2nd disk for /Users *and* other stuff then you could use the symbolic link method like this..

mkdir /Disk2/Users
ln -s /Disk2/Users /Users

Once you've done that you can move (or copy if you feel safer) your backup into place, e.g. "mv /old_Users/* /Users/". Make sure that the permissions/ownership on the new /Users directory is the same as the old one. My OSX beta's /Users perms are:
drwxrwxr-x 4 root admin 92 Jan 12 23:33 /Users
So you'd then need to "chown root:admin /Disk2 ; chmod 775 /Disk2" (replace /Disk2 with /Disk2/Users if that's the directory you used).

[ Reply to This | # ]
went for it, thanks!
Authored by: cichlisuite on Mar 25, '01 08:25:42PM
What a process, but I finally got it to work.

When I first attempted to back up the "Users" directory, I realized that I had to preform this operation logged in as root. I then also realized that I could not login as root. A message from the MacAddict forums (posted by iLuvMiMac) cleared up how to enable the root account. Here it is just in case:
Use the NetInfo Manager to do so, under domain, security, authenticate, then domain, security, enable root user.
Then I followed rob's directions for backing up the Users directory, making the new Users directory, creating a symbolic link and moving the contents of the backed up Users into the new Users directory.
One thing to note though for other Unix newbies wanting to try this. The directory path will look more like this:
Two other details... I am using OS X Retail and I did not need to change/set the permissions on the folder.

[ Reply to This | # ]
Symlink Trick not 100%
Authored by: aalegado on Mar 30, '01 04:52:24PM

I tried this and encountered problems where, upon login to the account that was moved, some items were not available. I expected the symlink to work but choose a different solution:

The better route I found was to use the NetInfo Utility and edit the User properties and actually change the "official" location of the home directory. On Linux I would just edit the /etc/passwd file but on OS X NetInfo is deriguer. So...

To do this, first I logged in as root and did "cp -Rp /Users/shortname /New/Location/shortname". This is a recursive copy that preserves ownership ("chown") settings. I copied my existing home directory to the new location. Then I used Netinfo to change the User home directory property from /Users/shortname to /New/Location/shortname .

Logging in as myself, everything works as expected. For clean-up purposes, I tarballed my old user directory and deleted the original folder. This gives me a back-up of the directory but not the directory itself which could cause confusion. The tar command I used was: "tar zcf shortname.tgz /Users/shortname" . This copies all the files and directories into the tar file and then gzips it. The converse is tar zxf shortname.tgz but the StuffIt Expander handles tgz files too.

My particular application was to move my home directory from my OS X boot partition to a large (50GB) general purpose partition.

[ Reply to This | # ]
Symlink Trick not 100%
Authored by: Anonymous on Apr 03, '01 12:47:23PM


Thank you for the very helpful information - I've been searching everywhere for this!

I followed your procedure and it worked fine to relocate the "User" directory. All of my desktop preferences appeared to transfer with it (as expected). However, when I attempted to run MS Explorer I got an error, and when I attempted to run Mail, it didn't find my settings. I assume that none of the other applications are pointed to the new location of the User directory either.

One detail: I used Netinfo to change the User home directory property to /Volumes/Drivename/shortname. Do I instead need to create a Users directory on the new drive so that the home directory property is /Volumes/Drivename/Users/shortname?

Also, is there a way to have a Drivename with a space in it (sorry for the newbie UNIX question)?


[ Reply to This | # ]
Symlink Trick not 100%
Authored by: aalegado on Apr 03, '01 02:29:58PM

What you're describing sounds like what happened to me when I used the symlink trick but it sounds like you have a permissions problem. When the apps launch they "know" who the current user is (whoever's logged in) and that where the app goes to find it's preferences. Specifically, they look in the Library folder of the logged-in user. If the preferences files have the wrong ownership or access rights, the app will fail to read it references. Since the app can't overwrite a file the logged-in user doesn't own, it'll most likely fail. That sounds like what's happening to you.

Both the symlink method and mine require that the original homedir's contents be copied somewhere else. How you do the copy _matters_ big time--specifically, are you copying everything (invisible files included) and are you preserving the file/folder ownership.

I don't trust the Finder to copy everything. Maybe it does but I haven't tested to find out. Since I'm comfortable at the command line, I did the copy there. However, you should move a user you're logged in as so you have to logout and login as someone else. The most convenient "someone" else is root. Being root means that you have to be careful how you copy the files...

* Definitely DO NOT copy in the Finder. A Finder copy as root creates root-owned files!!! Moreover, the Finder may omit certain files which doubles the potential problems.

* Use the 'p' switch at the command line to preserve ownership.
Ex. cp -Rp /Users/Old /Volumes/HD/New
The 'R' switch indicates a recursive copy which copies all files and folder from the specified directory down. With 'R' you will only copy files in the current directory and folders and their contents will be ignored.

You do not need to use a 'Users' folder. You can define your homedir as an entire volume or any designated folder on a volume. I used a 'User' folder just to build parallel to the default /Users which would still be used by the system were I to add another user. This is how I want to do things: The existing Users is still functional. All I've done is move one user's homedir elsewhere.

In my case, I created a /Users/aalegado folder on my big volume. I also moved some of my standard data folders (from my OS 9 environment) into my new homedir and while I was at it, I changed all the ownership to aalegado.wheel rather than the default aalegado.staff. To do that I used: cd ~aalegado/; chown -R aalegado.wheel *

That ~aalegado is worth explaining: ~username is shorthand for a user's home dir. Thus, on my system aalegado's homedir is /Volumes/Workspace/Users/aalegado (that's an absolute path BTW) which can be abbreviated to ~aalegado.

[ Reply to This | # ]
Symlink Trick not 100%
Authored by: Anonymous on Apr 03, '01 05:24:44PM


Thanks for the help. The only mistake that I made was that I tried to do everything while logged in as the same User that I was trying to move. Made all of the difference when I logged in as root.

Thanks again,

[ Reply to This | # ]
Breaks Apache?
Authored by: pcdoctor on Jul 02, '01 02:22:15PM

I have tried this to move on a user account which was a /~ type of web site, moving the users directory with NetInfo caused apache to break, would only give 404 errors. Put Netinfo back the way it was, works fine. Perms correct and everything.

[ Reply to This | # ]
Breaks Apache?
Authored by: byersra on Feb 16, '03 11:48:55PM

Apache doesn't break, it just doesn't know where to find the new Sites folder.

Login as root or execute "sudo -s" from the Terminal
Navigate to /etc/httpd/users

This directory contains text files for each user. Open the file and modify the path from "/Users/<username>/Sites" to your new directory. Then log out and back in. At this point, everything should be working.

[ Reply to This | # ]