Filed under: Terminal Tips, TUAW Tips
TUAW Tip: Moving your home folder to another disk (or moving it back)
In ye olde times, with "Mack OSe 9," many users chose to keep their personal files, work, and documents on a different physical disk from their startup disk. It was a safety measure: If one disk goes down, at least the other won't. There was no structural reason to keep files in a particular disk location, other than keeping them out of the System Folder.
I visited a client yesterday whose drive scheme was set up exactly like this, and he wanted to be (finally) upgraded to Leopard. I wasn't sure how Leopard would handle the fact that his Users folder had been moved to a different drive, so (knowing I had backups of his entire system) I cautiously proceeded with the installation.
After the installer finished, Leopard had created a fresh, blank Users folder on the startup disk with a home folder bearing the same username. This wasn't exactly the answer I was looking for. I had to link, somehow, the new Users/hisname folder with his existing user folder on the other volume.
Turns out, Leopard handles this much better than previous versions of Mac OS X. Read on to find out how.
In fact, it's as easy as opening System Preferences, holding the Control key and clicking (or right-clicking) on the account you want to change, and selecting Advanced Options.

You can see that you can easily browse for the user's existing home folder by clicking Choose next to the Home Directory field. Restart the computer, and it's done and dusted. Thanks to our own Michael Rose for this tip.
Hopefully, when you log in, the user's old Desktop, Dock, and everything else is in its place. You can then safely delete /Users/fred in the Finder by throwing it in the Trash. Note that this only changes the path for Fred's home folder; any subsequent users that you create will get home folders in the usual /Users path on the startup disk.
Now, a word of caution. In the past, some security and software updates have been confused by the fact that a user's home folder isn't on the startup disk. While most of the time there shouldn't be a problem, this user's system configuration is now an edge case, and that's where problems crop up. That's why I don't really recommend setting up a client's computer this way. If you're comfortable with the risk, then go for it.
For the truly nerdcore among us, you can also do this via the Directory Services command-line utility: dscl. Note that dscl requires root privileges, so you'll need to preface the command with 'sudo' to get it to work.
When you run dscl, the next step is to navigate to the correct directory within the Directory Services hierarchy (not a literal directory on the disk, mind), and change the value for the user's home folder. In this example, the user's name is fred, the user's new, blank home folder that Leopard created is /Users/fred and his old (correct) home folder on another volume is /Volumes/External Drive/Users/fred. [Line wraps are marked with », that command should go on one line. -- Ed.]
sudo dscl localhost
cd /Local/Default/Users
change fred dsAttrTypeNative:home /Users/fred »
"/Volumes/External Drive/Users/fred"
exit
Restart the computer, and you're good to go. You can remove the empty user folder on the startup disk by dropping into Terminal and typing sudo rm -R /Users/fred and pressing return.
My client eventually wants to change this partition scheme back to a more traditional installation. He also wants to move his data onto one large physical disk instead of two small ones (now that he has Time Machine as his safety net). When we migrate his data onto one disk, we can run this command in reverse to point his username to his home folder on the new, large startup disk.
Also: OWC has a comprehensive walkthrough on this process, including copying your data, on their website. Thanks, @macsales!

![TUAW [Cafepress]](http://www.blogsmithmedia.com/www.tuaw.com/media/tuaw-cafepress-promo.png)


Reader Comments (Page 1 of 2)
huebs said 3:52PM on 5-14-2009
What happens if you try to log-in and it doesn't find a home folder at this location? Will it automatically look in the /Users folder?
This could be very useful if I could set up a home directory on a 16 or 32 GB flash drive and then be able to log-in to any computer i've set up with a user account linked to this home folder. Would this work? Has anyone tried this?
Reply
DanyG said 4:06PM on 5-14-2009
Hi,
This is exactly the way I set up my HDs.
My iMac has a 320GB HD, which I already knew would NEVER be sufficient for my large media library.
So, I bought two 750GB external Lacies and set up one as my Home Folder
and the other as a Time Machine HD.
The advantage of this configuration is that the internal 320GB HD has only Applications and the data concerning the iMac.
Everything else, which is MINE, is inside the external HD.
So it doesn't matter where I plug it, all my configurations, preferences, everything will be there, in a matter of seconds...
If my main computer goes down, i still have everything ....
BUT SOMETIMES, it already happened a couple of times, if your HD fails to mount on the restart of the computer, it resets the home folder to \macintosh hd\users\onono.
The first time it happened I didn't know what was going on, but all you have to do is reset the home folder path back to the external HD.
There is a post explaining this issue :
http://www.macosxhints.com/article.php?story=20080403131308961
Reply
mark said 4:25PM on 5-14-2009
Hmm that's a great idea. I've never thought of doing this.
Keith Smith said 4:12PM on 5-14-2009
Haven't tried this yet, but I plan to. A friend and I were discussing the perfect laptop, and he's got it in his head that a two-drive system would do it for him. I know there's no dual-drive Mac laptops, but there are ExpressCard Flash Drives (not true SSDs as they don't patch into the hard drive interfacing, they use ExpressCard's USB interfacing) which might allow for it. Here's the interesting question: could you install OSX on the ExpressCard/USB drive (say a 16GB unit) and point your home folder to say a 500GB physical hard drive in the laptop's hard drive bay? World's Biggest (FrontRow) iPod...
Reply
Michael Rose said 4:22PM on 5-14-2009
It's not advisable to install OS X on USB flash media for everyday use (as opposed to SSDs, which are fine) -- rewrites/erases on the virtual memory store will eventually cause the disk to crap out.
Paul Katzman said 9:33PM on 5-14-2009
I think a better solution would be to use something like an MCE Obptibay (http://www.mcetech.com/optibay/) to use either two HDDs, or one HDD and one SSD. Be faster than an ExpressCard, too, I believe.
Michael Clyne said 10:08PM on 5-14-2009
"I found some data from Mtron (one of the few SSD oems who do quote endurance in a way that non specialists can understand). In the data sheet for their 32G product - which incidentally has 5 million cycles write endurance - they quote the write endurance for the disk as "greater than 85 years assuming 100G / day erase/write cycles" - which involves overwriting the disk 3 times a day." -http://www.storagesearch.com/ssdmyths-endurance.html
SSD's now last alot longer than they used to!
Mikey said 2:47PM on 5-17-2009
Newer SSD ExpressCards (entering market now, introd this winter) use the ExpressCard interface when plugged into the computer directly, so they should be much faster. They still have a mini USB port so they can be used as external USB. This would be a great option for a user folder because it's truly portable, and USB2 is plenty fast for user folder uses which are of the "write once/read many" variety (just don't use it as a scratch disk for FCP)
Stan-O said 4:23PM on 5-14-2009
What's wrong with just removing /Users/fred and then
cd /Users/
ln -s "/Volumes/External Drive/Users/fred"
?
Reply
Michael Rose said 6:13PM on 5-14-2009
In principle, nothing -- the symbolic link should behave like the real folder. In practice, this tends to cause obscure issues and break things.
yagorob said 1:56PM on 5-15-2009
i'm going to set up my new machine like this. i did a test run and found that some programs just expect to find your home directory in /Users/homedir. so i think i'm going to do both the symlink and the dscl trick to cover my bases.
Zao said 4:42PM on 5-14-2009
So, in this way I could keep the pictures, movies, music, files, and etc. on a different drive than my boot-up disk while it would appear the same as in the normal sidebar?
Reply
Cronick said 4:34PM on 5-14-2009
What would be great is if my home folder could be mirrored to multiple machines/disks. I know I could buy an XServe or use DropBox (I have DB). But, it would be nice to all my Macs looking exactly the same all the time (i.e., MacMini home media server, MBPro work laptop and MBAir Travel/Den laptop). That way, switching laptops would be transparent, my media would always be instantly available from the media server and everything would be backed up.
I'm dreaming.
Reply
Stan-O said 5:00PM on 5-14-2009
Cronick -- Windows had the "remote profiles" for a while now, not sure if it worked exactly as you describe but the theory was that all the user data (read user home folder) was stored on a server and whichever Windows machine you logged on automatically fetched the profile and looked the same with same documents, etc.
Michael Rose said 6:14PM on 5-14-2009
Mac OS X Server allows you to do this with mobile or portable home folders. However, being logged in as the same user in two places at the same time will cause replication issues.
Cronick said 7:38PM on 5-14-2009
Stan-O. Yeah, the XServe does that (for $500). I don't want to pay $500 for it, and DropBox is $100/year. Oh, well.
Stan-O said 9:41PM on 5-14-2009
Michael, Cronick -- ah, I see, that's a great feature. Do I have to have an XServe to run Mac OS X Server? Can I not buy the license to run it on Mini or something? Does it have to be the Leopard Server? I bet there're deals to be had on the Tiger Servers right now.
Cronick said 2:36PM on 5-15-2009
I wouldn't buy till Snow Leopard, X.6.x, ships - most likely there will be no free upgrade if you buy now. The price is the price. $500 for OS X Server 10 users, $1000 for OS X Server unlimited users - no hardware. It will run on anything, just not necessarily very fast on slower machines. But that's overkill, at least for me. I don't need a Wiki server. LOL.
Robb said 4:50PM on 5-14-2009
Anyone tried this within an Active Directory environment?
Our Mac's internal drives are partitioned three ways with a boot drive, restore drive and a storage drive. I'd like to be able to have new users simply login to the Mac with their AD account and a new home folder would be created on the storage drive.
Prefs would be configured either with Open Directory or within the System/Library/User Templates folder.
I've been able to do this using a symbolic link to the /Users folder, but wondered if this was something that could be done in the Directory Services local file.
Reply
Michael Rose said 6:16PM on 5-14-2009
You can actually just redirect the home folder path within AD or OD to have this effect, although it may work better with the Apple schema extensions to AD, the 'golden triangle' or with a third-party tool like Centrify or ADmit Mac. afp548.com and macenterprise.org are good resources.