[comp.sys.sun] Using automount and File System Org under NFS

berger@gaia@mbunix.mitre.org (Bob Berger) (02/08/89)

[[ Followups were directed at comp.unix.wizards, but I think answers would
be appropriate for this group as well.  --wnl ]]

It looks to me that the automount capability that comes with SunOS 4.0 is
THE way to organize and control the mounting of stuff across an NFS
environment. Here is what I'm planning to do, tell me if I'm crazy or if
there is a better way and if there are answers to the questions that I
have:

Use the /etc/fstab of each diskful system to just mount the actual drives
that are physically controlled by each CPU (ie don't have any nfs mounts
in any of the server or client's /etc/fstab):

	/dev/sd0a / 4.2 rw 1 1
	/dev/sd0g /usr 4.2 rw 1 2
	/dev/sd0h /home 4.2 rw 1 3
	/dev/sd0f /var 4.2 rw 1 4
	/dev/sd0e /export/swap 4.2 rw 1 5
	/dev/sd0d /export/root 4.2 rw 1 6

I can then have a generic dynamic mounting of all the server's exported
file systems by having all servers and clients execute the following
command in their rc.local:
	automount /net -hosts

Then have all the home directories mounted in /homes by using the
following automount command on each computer:
	automount /homes -passwd

Now the manual page for automount says that the passwd entries must be
in the form of:
	/dir/server/username

I am not yet clear how to set this up. I have the following questions:
	- Where does the actual physical home directory live?
	- Is that different than what is in the passwd entry?
	- Is "/dir" magical or should it be the dir (first argument, /homes)
	  of the automount command?

I've tried several combinations and can not make it work.

Finally I want to use a yellow pages map as kind of a network wide
/etc/fstab for mounting shared files and packages at particular mount
points. Things like /usr/lib/news, news spoolers, mail spoolers, emacs
lib, sources, man pages, homes of various tools (framemaker, CASE, etc) to
be mounted in nice places like /usr or /usr/local on all machines, but
they may actually live at some arbitrary path on arbitrary servers. I
figure for some critical packages I can have a few servers and use the
feature of automount where you can give it a list of servers and it will
mount the one that responds first. This would give the network a bit of
fault tolerance.

Now the automount man page says this can be done by making a yellow pages
map. Its not clear what the source format should be and exactly how to
install it as a yellow pages map.

Any tips, suggestions, experiences? The only documentation I can find on
this is the man page for automount!

Please email replies, I will summarize.

	Bob Berger 

Datacube Inc. Systems / Software Group	4 Dearborn Rd. Peabody, Ma 01960
VOICE:	508-535-6644;	FAX: (508) 535-5643;  TWX: (710) 347-0125
UUCP:	berger@datacube.COM,  uunet!datacube!berger rutgers!datacube!berger

dwight@ee.ecn.purdue.edu (Dwight D. McKay) (02/22/89)

I've worked up a method for using automount here at ECN which gives us
access to all our user file systems from any Sun as well as manual page
service from the least loaded manual page server.

It works like this:

According to the automount source (the only "true" reference :-)), the
automounter reads the "auto.master" YP map to get it's options.  Ours
looks like this:

# ECN wide configuration map for automounter
/net auto.net -rw,hard

This has automount use /net to mount things from a list contained in the
YP map auto.net.  I created auto.net myself and added it to the YP
makefile, etc.

Part of our auto.net looks like this:

# DON'T TOUCH IT
# ECN-wide automounter configuration file.
# This file is kept in /usr/src/etc and is both RCS'd and rdist'd.
# first we list *the* source server
SRC             -soft,ro        orchestra:/usr/src
# next we list the manual page servers
MAN             -soft,ro \
        aquarium:/usr/man \
        author:/usr/man \
        bank:/usr/man \
        cidmac:/usr/man \
        eadsbridge:/usr/man \
        gus:/usr/man \
        iies:/usr/man \
        molecules:/usr/man \
        orchestra:/usr/man \
        rvl3:/usr/man \
        spectrum:/usr/man \
        stable:/usr/man \
        zoo:/usr/man
# next come the /home's on the network's file servers
ampere          -hard,intr,rw   ampere:/home/ampere
ampere2         -hard,intr,rw   ampere:/home/ampere2
aquarium        -hard,intr,rw   aquarium:/home/aquarium
aquarium2       -hard,intr,rw   aquarium:/home/aquarium2
atoms           -hard,intr,rw   atoms:/home/atoms
atoms2          -hard,intr,rw   atoms:/home/atoms2
author          -hard,intr,rw   author:/home/author
author2         -hard,intr,rw   author:/home/author2
bank            -hard,intr,rw   bank:/home/bank
bank2           -hard,intr,rw   bank:/home/bank2
cidmac          -hard,intr,rw   cidmac:/home/cidmac

There are more file servers, but that should give you the basic idea.
This shows three basic catagories of automount use.  Let me explain each
one:

Sources:

Our local source pool is on a single source machine.  On ALL our other
Suns there's a sym-link:

	/usr/src -> /net/SRC

Whenever a user needs to look at sources which are available for him to
look at he just does something like: "more /usr/src/ecn/foo.c"; automount
kicks in, and he gets what he needs.  This gives wide access to a single
filesystem without the penlty of being "hung" if the source server goes
down and you're not using the sources.

Manual Pages:

This entry in auto.net shows off a really nifty automount feature,
multiple sourcing.  What is says is: get /usr/man from the first of these
machines to respond.  It works by sending a packet to each of those
machines and picking the machine which gets an answer back first.  We use
a sym-link as above to trigger the whole thing:

	/usr/man -> /net/MAN

It works pretty well, giving users manual page service even if one or more
of the possible manual page servers is down.  Furthermore, heavily used
servers don't get futher bogged down with manual page service.

User Files:

This is pretty straight forward.  Our /home holds mostly sym-links to
/net.  Stuff like:

	/home/aquarium -> /net/aquarium
	/home/cidmac -> /net/cidmac

I wrote a short sed script which we run build the sym-links we need from
the auto.net YP map.  It gets run by cron and we use rdist to send out
auto.net.  The result is automatic filesystem availability when new file
servers get installed.

Automount is really nifty!  It deserves better documentation.  I hope my
example has helped in that regard.

--Dwight D. McKay
--Engineering Computer Network, Purdue University
--Work: mckay@harbor.ecn.purdue.edu, (317) 494-3561
--Home: ...rutgers!pur-ee!mckay!dwight