Tag Archives: automount

sharing /home across Ubuntu and Mac OS X

I dual-boot between Ubuntu and Mac OS X on my MacBook Pro, and I like to have the setups parallel each other as much as possible. This means I can do things like share git repos and Android AVDs across OSes. One annoying detail is that the root of the home directories is different in each OS. In GNU/Linux, its /home. In Mac OS X, its /Users. That can be easily solved by using a symlink, i.e. ln -s /Users /home. But arg, Mac OS X’s NFS automounter gets in the way! It mounts /home and then if you use a networked home folder, it’ll mount it in /home. But who uses that on a laptop?


$ mount
/dev/disk0s2 on / (hfs, local, journaled)
devfs on /dev (devfs, local)
fdesc on /dev (fdesc, union)
map -hosts on /net (autofs, automounted)
map auto_home on /home (autofs, automounted)
/dev/disk0s3 on /Volumes/Ubuntu (fusefs_ext2, local, read-only, synchronous)
/dev/disk0s4 on /Volumes/Untitled (fusefs_ext2, local, read-only, synchronous)
/dev/disk0s5 on /Volumes/64-bit (fusefs_ext2, local, read-only, synchronous)
/dev/disk0s6 on /Volumes/share (hfs, local)

I say get rid of it! Luckily Apple hasn’t killed all the UNIXiness of Mac OS X, and you can still do useful things by editing simple text files. The NFS automounter is a good example, its settings are in /etc/auto_master and /etc/auto_home. So I edited /etc/auto_master as root and just commented out the line about automounting /home, then told the automounter to re-check its config, and voila! No more annoying /home mount! So in summary:


$ cd /
$ sudo emacs /etc/auto_master
$ sudo automount -vc
$ sudo umount /home
$ sudo rmdir /home
$ sudo ln -s /Users /home

automount on desktop machines with multiple users

I spent hours and hours trying to find out how to allow multiple users to be able to log into a server and use their automounted home directories. Normally, home dirs are automounted using AFP (rather than SMB or NFS). When one user logs in, it successfully automounts their home dir using AFP. But then the next person who logs in can only get guest access to their home dir, even tho the AFP automount has mounted the whole home root.

The answer was this: using normal logins, the AFP automount will only be accessible to the user who mounted it (by logging in). In order to allow multiple network users to be logged in at the same time, there are two options: NFS and AFP+Kerberos.

NFS is not very secure, and there isn’t a simple GUI way to set it up. But I did that and it works well. The better route in the long run is to get Kerberos working. But that is a massive undertaking on its own.