To: (Mac OS X for Users) Date: Mon, 9 Apr 2001 22:46:00 -0700 (PDT) From: Nick Subject: [X4U] Robust method for moving /Users etc to a different partitiion 1/2 I would like to relocate the standard installed folders to other partitions and disks, and have a working system which survives reboots. So here is how I did it: For the purposes of this example, I set up a disk with 3 partitions: X, Classic, Users. Their purpose should be clear! So I installed 9.1 on Classic and X on X, and set up a couple of users, Nick and (say) Bob. So the default situation is now that my user home dirs live in /Users/nick and /Users/Bob. My third ( Users ) partition is actually mounted as /Volumes/Users and is currently empty. You can see this with df -k in Terminal; the Finder does not make this clear. On the Desktop and in Finder windows you can see X, Classic, Users all sitting together. So, now I want my user accounts to live in my Users partition not in the /Users folder which lives on my X partition. Some have suggested symlinking. BUT lots of programs are broken bythe symlinks (including NetInfo manger, amongst others), so creating new users fails. Others have suggested changing the home directory in NI Manager. This is clunky for many users though, and you have to copy the home files across from one disk to another. And in any case this is not a general solution fro mounting things where you want. Others have suggested editing /etc/fstab. Well, as far as I can see, /etc/fstab is only even read in single user mode. Edits to this make no discernible difference. However, after much trial and error I think I have solved the problem. This method actually works, I have actually done it, it's not something that 'ought to work in unix'. It may not be elegant, and if anyone can improve on it, I would love to hear from you. But it does work. 1) Disable the automounter. The automounter mounts all filesystems at boot time and then hangs around waiting for you to put cds in or connect firewire disks. This is the bugger that's responsible for mounting under /Volumes. So switch it off to start with. Edit /etc/hostconfig (you'll need to be root) and set AUTODISKMOUNT to NO instead of REMOVABLE and AUTOMOUNT to NO instead of YES like this: AUTODISKMOUNT=-NO- #AUTODISKMOUNT=-REMOVABLE- AUTOMOUNT=-NO- # AUTOMOUNT=-YES- Ok, so if you rebooted now the machine would only mount X, or whatever partition you installed X on. So we have to get Classic to mount and Users to mount. 2) Create mountpoints for your other partitions. Make directories where you want the partitions to mount. I moved /Users to /Users1 temporarily (so I could copy my first two users back). and made an empty /Users And I made /Volumes/Classic (well, that was already there because automounter had made it for me. But I *could* have made /Classic, for example.) Also, do df -k in terminal or run DiskUtility so you can see what slices your partitions are on. (My /Users is on /dev/disk0s11). 3) Now, tell the system to mount your partitiions at boot time. I did this by going to /System/Library/StartupItems/Disks and editing a file called Disks. I put in the following lines at the end of the script: ---snip----- # I have switched automount off so this mounts my partitions echo 'Load /Users' mount -t hfs /dev/disk0s11 /Users echo 'Load /Volumes/Classic' mount -t hfs /dev/disk0s9 /Volumes/Classic echo 'Loaded' # Now I'll restart the automounter autodiskmount -a -v ________snip______ What does this do? Well, mount mounts filesystems from special devices (which you see in df -k readout) to nodes (directories) in the filesystem. '-t hfs' tells you I have hfs partitions. I'm mounting Users as /Users and Classic as /Volumes/Classic. I could mount these anywhere. You can try these commands from Terminal and check they work. You should be able to navigate the file systems via the command line. They'll even show up in the Finder if you restart its process. The last line of my script edits starts up automounter a bit later than it would have started if I hadn't fiddled. Since I'm now mounted, it won't remount me. But if I don't restart it, i can't insert CDs or even use .dmg files or .smi files and have them Just Work. That's it! Now, copy your user folders over to your new partition. Now you can delete /Users1 And reboot. Now, /Users is whatever disk you set it up as. So if you make new users, by default they go to the right place. And it works after reboot. Hooray! Nick