Home Directories
================
One convention for home directories is to locate them in `/homes' so
user `jsp''s home directory is `/homes/jsp'. With more than a single
fileserver it is convenient to spread user files across several
machines. All that is required is a mount-map which converts login
names to an automounted directory.
Such a map might be started by the command:
amd /homes amd.homes
where the map `amd.homes' contained the entries:
/defaults type:=link # All the entries are of type:=link
jsp fs:=/home/charm/jsp
njw fs:=/home/dylan/dk5/njw
...
phjk fs:=/home/toytown/ai/phjk
sjv fs:=/home/ganymede/sjv
Whenever a login name is accessed in `/homes' a symbolic link
appears pointing to the real location of that user's home directory. In
this example, `/homes/jsp' would appear to be a symbolic link pointing
to `/home/charm/jsp'. Of course, `/home' would also be an automount
point.
This system causes an extra level of symbolic links to be used.
Although that turns out to be relatively inexpensive, an alternative is
to directly mount the required filesystems in the `/homes' map. The
required map is simple, but long, and its creation is best automated.
The entry for `jsp' could be:
jsp -sublink:=${key};rfs:=/home/charm \
host==charm;type:=ufs;dev:=/dev/xd0g \
host!=charm;type:=nfs;rhost:=charm
This map can become quite big if it contains a large number of
entries. By combining two other features of Amd it can be greatly
simplified.
First the UFS partitions should be mounted under the control of
`/etc/fstab', taking care that they are mounted in the same place that
Amd would have automounted them. In most cases this would be something
like `/a/"host"/home/"host"' and `/etc/fstab' on host `charm' would
have a line:
/dev/xy0g /a/charm/home/charm 4.2 rw,nosuid,grpid 1 5
The map can then be changed to:
/defaults type:=nfs;sublink:=${key};opts:=rw,intr,nosuid,grpid
jsp rhost:=charm;rfs:=/home/charm
njw rhost:=dylan;rfs:=/home/dylan/dk5
...
phjk rhost:=toytown;rfs:=/home/toytown;sublink:=ai/${key}
sjv rhost:=ganymede;rfs:=/home/ganymede
This map operates as usual on a remote machine (ie `${host}' not
equal to `${rhost}'). On the machine where the filesystem is stored
(ie `${host}' equal to `${rhost}'), Amd will construct a local
filesystem mount point which corresponds to the name of the locally
mounted UFS partition. If Amd is started with the `-r' option then
instead of attempting an NFS mount, Amd will simply inherit the UFS
mount (Note:Inheritance Filesystem). If `-r' is not used then a
loopback NFS mount will be made. This type of mount is known to cause
a deadlock on many systems.