Moving a user's directory

davidbrit2

Licensed Computer Geek
I want to move my home directory onto a different partition, but I need to know if this is a safe way of doing it.

Can I just move the directory to the other partition and make a symlink back to where OS X would expect the directory to be? For instance, I would just make /Users/dave point to /Volumes/Data/dave instead. I don't have the balls/patience to just try it without someone confirming that it works first.
 
You can do it using a sym link but depending on how you abuse it might not be the best idea. A better idea, and what i have done is the folowing

1. open the terminal
2. type 'df' and note the physical device address corresponding to your desired users drive (mine is /dev/disk0s3, yours will look similar).
3. type 'cd /etc'
4. type 'sudo pico fstab'
5. This will open a command line text editor. Enter the line:
'<device address> /Users defaults 1 0'.
My fstab file looks like this
'/dev/disk0s3 /Users defaults 1 0'.
6. press control-x to quit and save the file.
7. Exit out of the terminal.
8. Copy your home directory to the new partition.
9. Reboot.
10. Open up the terminal again and verify your new home directory by typing 'pwd'. If everything went well then it should return something like:
'/Volumes/NewPartition/UserDirectory'
rather than the prevoius=:
'/Users/UserDirectory'

What this will do is actually have your system mount the other partition as the Users directory, not just trick it into thinking the users directory is somewhere esle as with a sym link. If you just wanted *your* home directory to be on the other partition but leave other users directories whare they are you would change the second argument in the fstab file from '/Users' to '/Users/<username>'.

By doing this you avoid "tricking" your computer into thinking it is putting files in one place rather than another. Some installers may have a problem with sym links and many unix commands will also. Goood luck!

Tom
 
I would also have to say to mount the partition to your users home folder. I have an 80 gig disk in my imac and due to a firmware issue with my model imac i can only have a max partition of 8 gig as my boot disk. i mounted the other part of the 80gigger in /users with the fstab file and it works great. i tried to just make an alias and then tried to use a symlink and it did not work in all aspects. for example if i remember correctly the OS followed the symlink but apache would not. the os would not follow the alias when you logged in it gave you the default settings for everything. the only thing that i have noticed is that if the computer crashes (only had that happen a few times) or if you do a system update you have to restart the computer twice to make it read the fstab file and mount the partitions correctly. if you just do a normal restart you only have to start it up once, not twice.

jeffo
 
If you do decide to go the symlink route, be sure to update your user's NetInfo for where their home directory is. Open up the NetInfo Manager and find the entry for your user's home and fix it there.

I use the symlink/NetInfo method and it works fine. The only problem is that each user's home entry in NetInfo must be edited to reflect where the dir is.

Also, when you "copy your user directoy" to any new partition, make sure you use the "ditto -rsrc" command and not "cp".

Kent!
 
Back
Top