Friday, February 2, 2007

Yay, me (or, how to mount /Users on a second HD)

Got a new (as in, not so old) Mac yesterday. Voided the warranty in less than an hour, when I cracked the case to add a gig of RAM and a 250 GB hard drive. Part of the master plan is to mount the 250 as /Users. Figured it shouldn't be that hard, since it takes all of about two minutes in K/X/Ubuntu - just a quick edit of /etc/fstab. (What's that you say, about mice and men?)

I found the following instructions:
edit /etc/fstab.hd:
comment out all existing text (the instructions actually said to delete it all, but I'm a digital packrat.)
enter this line:
LABEL=Users /Users hfs rw 1 2
save & exit
transfer /Users to new drive:
sudo ditto -v -rsrcFork /Users Volumes/Users
reboot into single user mode & issue these commands:
cd /
mv Users Users-old
mkdir Users
chmod 755 Users

reboot & update Netinfo to recognize fstab:
sudo niload -m fstab / < /etc/fstab

All the commands took, the files were all copied over onto the new drive, but when I rebooted again, I was in a new, untouched home folder. After poking around some more, I came up with these instructions.

OtherPartition = "Users" and username should be obvious.

sudo ditto -rsrcFork /Users /Volumes/OtherPartition/Users
I'd already done almost this exact command, with the addition of the -v flag, so I ignored it.
sudo niutil -createprop / /users/username home /Volumes/OtherPartition/Users/username
note that sudo niutil through username is all one line
sudo rm -dr /Users
I've already backed up /Users as /Users-old, so I figured I could delete that whenever I felt like it. Thus I ignored this command, as well.
sudo ln -s /Volumes/OtherPartition/Users /Users

And this worked better, because home was now on the new drive, but it was still a new, untouched home folder, and my home folder is extremely touched. So, back to poking around some more. I'm sure some of you already know what I did wrong. The niutil and ln commands were written for separate partitions on the same drive, not on an entirely different drive. I logged back in as root, deleted /Users/Users and issued these commands:
sudo niutil -createprop / /users/username home /Volumes/Users/username
sudo ln -s /Volumes/Users /Users

Again, sudo niutil through username is all one line.

And now it works. Yippee. I'm not exactly sure precisely which steps are necessary, i.e. I'm not sure I need to dink with the fstab.hd and the symbolic link between /Users and /Volumes/Users, but I plan to find out later this weekend, when I add two more drives and set it up for dual boot between OS X and K/X/Ubuntu.

1 comment:

Dunja said...

Thanks for writing this.