autmounts

Darin Perusich Darin.Perusich at cognigencorp.com
Tue Sep 30 13:37:07 EDT 2003


automounts are nfs mounted filesystems that are only mounted when the 
resource is requested, and unmounted after a period of inactivity. it 
can also be used for cd's, floppies, etc.

example, your home directory resides on nfsserver:/export/home/luser, 
when you login on server1 it makes a request for 
nfsserver:/export/home/luser which is mounted at server1:/home/luser. 
when you logoff after about 5 minutes server1:/home/luser umounts 
/home/luser.

automount's default config file is /etc/auto.master in linux. in solaris 
it's slightly different but i'm not going to get into that. the default 
might look like "/misc   /etc/auto.misc  --timeout=60". this means mount 
everthing listed in /etc/auto.misc under /misc, with a timeout of 60 
seconds.

currently linux automount does NOT support direct mount points, i.e. 
mount nfsserver:/export/share1 /share1. automount mounts is at 
/misc/share1, we can get around this little issue by using softlinks, 
"cd / && ln -s /misc/share1".

auto.misc might look like:
share1	nfs1:/export/share1
share2	nfs1:/export/share2	nfs2:/export/share2

this would mount share1 as /misc/share1 and share2 as /misc/share2. the 
share2 mount is an example of redundancy. if nfs1 fails to respond try 
nfs2, etc. this of course would require redundant systems attached to 
some type of external disk, dual-channel scsi array, SAN, cluter 
filesystems.

Joe, this is what i would do given your config. do this on a test 
machine before doing it on your webserver, especially if this is a 
work/production environment. you should also understand how it works 
before you implement it.

/etc/auto.master
	uncomment the line "/misc   /etc/auto.misc  --timeout=60"

/etc/auto.misc
	remove/comment unwanted entries. add the lines.
		(change IP to hostname)
	db	192.168.1.3:/nfs-srv/db
	isp	192.168.1.3:/nfs-srv/isp
	users	192.168.1.3:/nfs-srv/user

create softlinks
	cd / && ln -s /misc/db
	cd / && ln -s /misc/ips
	cd / && ln -s /misc/users

stop and start autofs (stop just to be safe)
	/etc/init.d/autofs stop && /etc/init.d/autofs start

did the filesystems mount as expected?

enjoy.

-- 
Darin Perusich
Unix Systems Administrator
Cognigen Corp.
darinper at cognigencorp.com





More information about the nflug mailing list