open.itworld.com
  Search  
Security Home Page Security Webcasts Security White Papers Security Newsletters Security News Open Topics Careers ITworld Voices ITwhirled The Security site of ITworld.com

Unix Tip: NFS mounts and Solaris 10 problem

ITworld.com 1/16/2007

Sandra Henry-Stocker, ITworld.com

Send in your Unix questions today! | See additional Unix tips and tricks

I hadn't seen a stale NFS file handle for more than a decade, so this mount error surprised me.

fermion:/ # mount boson:/cdrom/studio_9_solsparc /studio_9_solsparc nfs mount: mount: /studio_9_solsparc: Stale NFS file handle


I was trying to mount a CD ROM loaded on a remote system because the target system didn't have a CD ROM drive. This didn't seem like an unusual thing to do. In fact, I'd been doing the same thing only a few weeks earlier. I first tried using /cdrom as the mount point, then tried working with a new created directory. In both cases, the mount failed with the "Stale NFS file handle" error. It took me a while to realize that the problem related to the fact that boson, recently upgraded to Solaris 10, was running a newer version of NFS than fermion, a Solaris 9 server.

Solution: Thinking about NFS on my newly installed Solaris 10 server quickly drew my attention to the /etc/default/nfs file. Like other files in the /etc/default directory, this file sets configuration parameters for particular services. In this case, the file contains configuration information for both lockd and nfsd. The settable parameters for Solaris 10 include options which are new in Solaris 10 -- all those marked with an asterisk in the list below.

*GRACE_PERIOD=num
LOCKD_GRACE_PERIOD=num
LOCKD_LISTEN_BACKLOG=num
LOCKD_RETRANSMIT_TIMEOUT=num
LOCKD_SERVERS=num
NFSD_DEVICE=devname
NFSD_LISTEN_BACKLOG=num
NFSD_MAX_CONNECTIONS=num
NFSD_PROTOCOL=ALL
NFSD_SERVERS=num
*NFSMAPID_DOMAIN=domain-string
*NFS_CLIENT_VERSMAX=num
*NFS_CLIENT_VERSMIN=num
*NFS_SERVER_DELEGATION=on | off
*NFS_SERVER_VERSMAX=num
*NFS_SERVER_VERSMIN=num


Of these, the NFS_SERVER_VERSMIN and NFS_SERVER_VERSMAX parameters supposedly determine the NFS versions that the server will support. The defaults are 2 for NFS_SERVER_VERSMIN and 4 for NFS_SERVER_VERSMAX. A quick check with the man page confirmed this:

     NFS_SERVER_VERSMIN=num
     NFS_SERVER_VERSMAX=num

         The NFS server only  uses  NFS  versions  in  the  range
         specified  by  these variables. Valid values or versions
         are: 2, 3, and 4. As with the client, the default is  to
         leave  these  variables  commented  out  and the default
         minimum version is 2, while the default maximum  version
         is 4.


However, since the defaults didn't seem to be allowing my Solaris 10 server to accommodate my Solaris 9 client, I tried some other settings. I tried setting NFS_SERVER_VERSMIN explicitly to 2 and then 3, but I found that only setting NFS_SERVER_VERSMAX to 2 worked. Of course, this puts a damper on my use of NFS Version 4, but I needed this mount to solve an immediate problem and figure that, soon enough, my servers will all be migrating to Solaris 10 and I will no longer have to deal with this issue. To switch the NFS_SERVER_VERSMAX parameter on my Solaris 10 server, I changed this line: #NFS_SERVER_VERSMAX=4 to NFS_SERVER_VERSMAX=2 I then restarted NFS on my Solaris 10 server using the /etc/init.d/nfs.server stop and /etc/init.d/nfs.server start commands and reshared my CD ROM as shown below.


# /etc/init.d/nfs.server stop
# /etc/init.d/nfs.server start
# share -F nfs -o ro /cdrom/studio_9_solsparc

To confirm that my CD ROM was shared, I issued the share command by itself. 
# share
-               /cdrom/studio_9_solsparc   ro   ""

On my Solaris 9 NFS client, I then mounted my CD ROM and examined its contents to be sure that the mount had worked properly. 
fermion:/ # mount boson:/cdrom/studio_9_solsparc /studio_9_solsparc
fermion:/ # ls -l /studio_9_solsparc
total 259
dr-xr-xr-x   5 root     root        2048 Jul 28  2004 Documentation
dr-xr-xr-x   2 root     root        2048 Jul 29  2004 LICENSE_README
-r-xr-xr-x   1 root     root       14873 Aug  6  2004 batch_installer
-r-xr-xr-x   1 root     root       15507 Aug  6  2004 installer
dr-xr-xr-x   4 root     root        2048 Aug  6  2004 kits
-r--r--r--   1 root     root       34184 Jul 29  2004 release_notes_en.html
-r--r--r--   1 root     root       34130 Jul 30  2004 release_notes_ja.html
-r--r--r--   1 root     root       25159 Jul 30  2004 release_notes_zh.html
-r-xr-xr-x   1 root     root        1010 Aug  6  2004 volstart



Once the mount was working properly, I was able to proceed with my installation. This is probably a Solaris bug, but I was glad there was a way around the problem that involves only a configuration change and will be easy to reverse.

On this topic

 

Sandra Henry-Stocker has been administering Unix systems for more than 18 years. She describes herself as "USL" (Unix as a second language) but remembers enough English to write books and buy groceries. She currently works for TeleCommunication Systems, a wireless communications company, in Annapolis, Maryland, where no one else necessarily shares any of her opinions. She lives with her second family on a small farm on Maryland's Eastern Shore. Send comments and suggestions to bugfarm@gmail.com.




Sponsored Links

Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
Sun Microsystems' - FREE 60 DAY TRIAL OFFER!
Test Sun's Newest Servers BEFORE YOU BUY. Plug Them In With Access To Full Technical Support.
100% Web Based Help Desk Software
Easy to use, customizable to meet your needs, powerful and scalable. Free online demo. Try it today!
Sign up for a Microsoft Dynamics® CRM WEBCAST
Hear globally recognized leaders in customer strategy discuss the importance and evolution of CRM.
Used and Refurbished HP ProCurve Switches
Lifetime Warranties, Professional Testing & Shipping on all HP Equipment Purchases!
» Buy a link now

Advertisements
Sponsored links
Locate Hidden Software on business PCs with this free tool
Bring harmony to your mix of UNIX-Linux-Windows computing environments
Top 5 Reasons to Combine App Performance and Security
KODAK i1400 Series Scanners stand up to the challenge
 Home   Open source  Operating systems  Unix
www.itworld.com    open.itworld.com     security.itworld.com     smallbusiness.itworld.com
storage.itworld.com     utilitycomputing.itworld.com     wireless.itworld.com

 
Contact Us   About Us   Privacy Policy    Terms of Service   Reprints  

CIO   Computerworld   CSO   GamePro   Games.net   IDG Connect   IDG World Expo   Infoworld   ITworld   JavaWorld   LinuxWorld  MacUser   Macworld   Network World   PC World   Playlist  

Copyright © Computerworld, Inc. All rights reserved

Reproduction in whole or in part in any form or medium without express written permission of Computerworld Inc. is prohibited. Computerworld and Computerworld.com and the respective logos are trademarks of International Data Group Inc.