Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Eureka! I have your mousetrap at last!' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Eureka! I have your mousetrap at last!
Authored by: Anonymous on Apr 09, '01 07:59:52PM

I, too, would like to relocate the standard installed folders to other partitions and disks, and have a working system which survives reboots. This is pretty standard stuff for most Unixes.

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 eb 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.
Since I'm now mounted, it won't remount me. But if I don't do this, 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!



Hope this helps

Nick




[ Reply to This | # ]
Eureka! I have your mousetrap at last!
Authored by: theolog on Oct 11, '01 03:01:49PM

This solution worked GREAT for my "unsupported" 10.0.4 setup on a 7300, but when I upgraded to 10.1, it stopped working! YIKES! Any ideas why (I've tried repeating the steps b/c some config files were overwritten, but to no avail!)



[ Reply to This | # ]
Eureka! I have your mousetrap at last!
Authored by: theolog on Oct 11, '01 03:15:35PM

MY BAD!!! This solution works like a champ!! I had a typo (of course) in my script!



[ Reply to This | # ]
Eureka! I have your mousetrap at last!
Authored by: cookdj on Jan 07, '02 08:14:16PM

I have tried this and have not been able to get it to work.

The bit that confuses me is where you say "I moved /Users to /Users1 temporarily (so I could copy my first two users back).
and made an empty /Users."

Do you mean that you made an empty Users folder in your OSX partition or your Users partition? I took it as meaning the OSX partition.

Anyway at the end of it all, I end up with an empty Users folder in my OSX partition, that doesn't seem to be pointing to my Users partition. In fact if I run Netinfo Manager, under Config->SharePoints, the Users sharepoint is no longer there. So any newly created user has <No Valid Sharepoint Selected> as their Share Point.

Any ideas.
Thanks in advance.
Daniel.



[ Reply to This | # ]
Eureka! I have your mousetrap at last!
Authored by: cookdj on Apr 09, '02 03:14:43AM

Ahh ... I worked it out. You have to SHARE out the Users Partition, using the Sharing Module in Server Admin, so it appears as a Share Point. Works fine now.



[ Reply to This | # ]
X reverting back to /Volumes mount point
Authored by: bjd14 on Feb 19, '02 02:43:50PM

Sometimes when I reboot X reverts to the old mounting scheme. Of course, I can eject the disk and remount it on the /Users point or whatever. But it's annoying.

I've found that it helps if you alter the permissions of your custom mount points to be identical to that of the standard mount points (ie, /Volumes/<your disk>).

For me,:
% ls -l
at the /Volumes directory gives me:
drwxrwxrwx 1 ben wheel 16384 Dec 31 1979 ZIP-100

so, i ran chmod on the /Users directory which i'm using as a mount point for my disk with the user directories on it.
chmod a+rwx /Users

i also did a chgrp for good measure:
chgrp wheel /Users

of course, all this after su'ing.



[ Reply to This | # ]
X reverting back to /Volumes mount point
Authored by: artgeek on Aug 30, '02 06:27:22PM

Me too. I applied your suggestions as to volume perms, but still sporadically get what should be my /Users volume mounted to /Volumes when rebooting. Haven't found the problem yet, still researching. Anyone else...?



[ Reply to This | # ]