A third in fourths: An NFS potpourri

October 15, 2001, 12:38 PM —  Unix Insider — 

We've gently eased into the summer months (or
winter doldrums for our Southern readers) with a two-month discussion
of the automounter and its configuration. By now we hope that you can
build maps, install and customize them to your heart's content, and
perhaps you've justified the need to change every single
client configuration to reach administrative harmonic convergence.
Then again, if you're like the 99 percent of our readers who inhabit the real
world (we're convinced there are some 'bots who digest each month's
offering) you've run into some last little detail separating
automounted bliss from true nirvana.

In order to enable you with powers to perform the more spiritual
acts of system management -- those that actually elicit kind words from
impressed users -- we'll take this third pass through the automounter
and NFS. We'll start by getting stopped, looking at the various ways
the automounter can get stuck, and what you can do to repair the
situations. From automounters that don't work we'll move on to those
that work too well, giving root-enabled users access to home
directories and mail spools of unsuspecting users. We'll introduce NFS
authentication to get you started on the path to a solution and take a
peek at WebNFS, Sun's filesystem for the Internet. Our final section
deals with auto-sharing and automounting removable media like CD-ROMs.
Armed with a four-corner offensive arsenal of expert tricks, you should
be prepared for anything the NFS-ready masses throw your way.

Tracing the mystery: Debugging mount attempts

Any system with hidden moving parts is bound to break. Create some
complex automounter maps and you're likely to find unexpected behavior
or get unintended filesystem mounts showing up in less than desirable
places. The automounter has two debugging flags: -T and
-v, enabling request tracing and verbose mount requests,
respectively. When the -v flag is supplied on the
automountd command line, each request is sent to syslog. With a single
-T on the command line, you'll get significant information
about the inner workings of the automounter:

	MOUNT REQUEST: name=/var/mail map=auto.direct
	opts=ro,intr,nosuid path=/var/mail
  		PUSH /etc/auto.direct
  		POP /etc/auto.direct
  		mapname = auto.direct, key = /var/mail
     			(nfs,nfs) / 	-rw,intr,nosuid,actimeo=0	sunrise:/var/mail 
  		nfsmount: sunrise:/var/mail /var/mail rw,intr,nosuid,actimeo=0
  		ping sunrise OK
  		mount sunrise:/var/mail /var/mail (rw,intr,nosuid,actimeo=0)
  		mount sunrise:/var/mail OK
	MOUNT REPLY    : status=0

Supply a double trace flag (-T -T) and you get detail
targeted at those with source code.

Killing the automounter and restarting it with a plethora of flags
isn't conducive to rapid problem solving or user satisfaction. If you
have a variety of volumes mounted, it may be hard to kill the
automounter gracefully and have it start up again without side
effects. Fortunately, there's a back door into setting the debug
options. When the automounter sees a lookup request for a file name
starting with an equal sign (=), it parses the name to see if it
matches one of the following settings:

	=v	Toggle -v on/off
	=0	Turn off all tracing
	=1	Set -T (simple trace)
	=2	Set -T -T (advanced trace)

This trick only works for indirect mount points, where the
automounter would match the file name component to a map key.

I like it!
Post a comment
The content of this field is kept private and will not be shown publicly.
  • Allowed HTML tags: <a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • Lines and paragraphs break automatically.
Free stuff

Win an Amazon Kindle!
This month's giveaway gadget - Amazon's Kindle - will keep you entertained on the long trip home to visit family and friends over the holidays. Enter the drawing now!

Applied Security Visualization
By Raffael Marty
Published by Addison-Wesley Professional
Learn more!

 

IT Manager's Handbook
By Bill Holtsnider and Brian D. Jaffe
Published by Morgan Kaufmann
Learn more!

 

Windows Vista Resource Kit
By Mitch Tulloch, Tony Northrup, and Jerry Honeycutt
Published by Microsoft Press
Learn more!

Featured Sponsor

AISO founders envisioned a Web hosting company that was environmentally friendly. While the company employed energy-efficient innovations like solar panels, its infrastructure produced unacceptable power and cooling requirements. Find out how AISO leveraged AMD technology to overcome their challenge in this case study white paper.

In this whitepaper, Scalar explores the opportunity to change the landscape with respect to mission critical databases built around Oracle. Leveraging technologies such as Linux, high-end commodity processing power and Oracle RAC technology to architect, design, build and maintain database infrastructure that delivers maximum availability, reliability and performance at a fraction of traditional cost.

On a typical day, weather.com, the Web site for The Weather Channel in Atlanta, serves up between 15 million and 20 million page views. But in September 2004, when back-to-back hurricanes ransacked Florida, the peak traffic on one day more than tripled: over 70 million page views by more than 7 million unique visitors. Read the full success story now.

More Resources