How do I move /Users to a different partition?

JamesB

Registered
:confused:

Hello!

I'm struggling with what I believe will turn out to be a really simple problem....

How do I move my users home directory structure to a different partition?

....and also, (while I'm here!), what is the equivalent user to 'root'? I'm asking this because I have an admin account that can't see into other users' home directories.... is this normal?

TIA (and no laughing if this is a really simple solution!!)

J. :)
 
Here's how to run something as root in the terminal. (sorry dont know about your Users problem) The equivalent user to root... is root. To get started, type:

passwd root

then enter in a password (keep it secret!) to set your root password. Once you get out of that, you have two choices. To run just one command (like ls or ln or something) as root you can use the "sudo" command. Like this:

sudo ls /Users/someotheruser/

IT will ask you for your STANDARD login password, NOT your root password. OR...
you can type:

su (which is the same as typing su root... su just means switch user)

Then enter your root password that you set up in step 1. REMEMBER!!! GET OUT OF ROOT once you are done using it. ESPECIALLY IMPORTANT: NEVER use IRC as root. it is VERY bad. Generally, I just use "sudo" to escape that unless I will be running a long sequence of commands as root.
 
One little note:

If you don't want to activate the root account, you still can use:

sudo -s

to get a root shell, confirming with your own (admin account) password.
 
Not sure on the details, but:

Make the partition, either on another hard disk, or on your existing drive (which may require a reinstall). Call it 'Users'. The name doesn't really matter, its just to make things less confusing.

Get into the terminal, and make a symlink from /Volumes/Users to /Users
Then get to know chmod... you will have to get the privliges all straightened out. Don't forget, you gota remove or rename the origional /Users directory first.

This isn't a great way to do this, BTW. I'd recomend figuring out where Mac OS X stores hard disk mounting tables (in linux, its /etc/fstab, but this isn't the case in Mac OS X), and then just add something like:
/dev/sd0w /Users hfs rw
to it. Again, not at all sure where this file is or if its similar in structure.

You could do this all manually with the mount command, but this has to happen before you login on boot up.

My low confidense remarks didn't help, did they? LOL. sorry about that. But someone here will know how to do it!
 
Thanks for the 'root' info!!

As for the /Users problem, I don't think I'm that confident to go messing around trying to find the solution myself, but thanks for your help anyway! Hopefully someone will be able to say exactly how to do it!

Thanks again!
J.
 
Actually, I've just tried to do passwd root and get the message 'permission denied'. I'm trying this from my admin account.... any ideas?

Thanks!
 
First, to get the device name, run <tt>df</tt>
That'll give you the device name of the disk that's mounted at /Volumes/Users (or whatever). In my case, there is a line like this:

<tt>/dev/disk1s5 10020816 7491980 2528836 75% /Volumes/Faustus</tt>

So I could make a startupitem with a script that looked like:

umount /Volumes/Faustus
mount -w -t hfs /dev/disk1s5 /Users

This is still fairly hacky, and I don't even know if the permissions would get set right or not. Obviously, we should ideally learn where OS X decides to mount disks in the first place, and change that. Still, I hope this gives you something to start from.

I'd really like to get an nfs (or afp) server going, and then have the same /Users items on all computers...
 
Here's what worked for me:

I wanted to move my own home directory (not /Users, just /Users/mac), but the analogous actions should work for /Users.

I wanted to put my home on one of my OS 9 partitions so that wiping and installing new OS X's wouldn't keep nuking my prefs in OS X. Using OS X Finder to drag the folder of my home to the OS 9 partition didn't work, complaining about privileges (esp. login prefs). So, I rebooted into OS 9 and dragged the folder. On rebooting to X, I found that this drag had actually preserved the OS X owners, groups and privileges! (my OS X partition and OS 9 partitions were both HFS+).

My user name/home directory name is 'mac'. The name of the OS 9 volume (partition) to which I moved is 'Data'.

Then, I made sure that 'other' logins was enabled in the Login prefs (needed for OS X 10.1; might not apply to 10.0.4), and logged out (Apple menu). I selected 'other' for login and typed '>console' to drop the window server and get to a plain console. I logged in as myself (i.e. mac, with my password). This got me a shell, in which I did this:

cd .. (to get out of my home directory)
sudo -s (to get a shell with root privs)
mv mac oldmac (saved in case of problem)
ln -s /Volumes/Data/mac mac (creates symlink to copy of home)
exit (get rid of root shell)
cd (back to new home)
ls (shows all my stuff that I copied to the 'Data' volume)
exit (logs out, waits a bit, then window server/login window appear)

Log back in and you'll be using your copied home directory.

You might reboot at this point in case you have other processes accessing your 'old' home, e.g. if you have sharing enabled on OS X.
 
Back
Top