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


Click here to return to the 'Symlink Trick not 100%' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
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

aalegado,

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)?


Thanks,
Phil



[ 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

aalegado,

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,
Phil



[ Reply to This | # ]