UNIX Hints & Hacks |
||||||||||||||||||||||
Chapter 2: Networking |
|
|||||||||||||||||||||
|
2.6 Talking NFS3 to NFS2
There are two versions of the Network File System protocol (NFS), NFS Version 2 and NFS Version 3. Here is how to get NFS3 to talk to NFS2.
Flavors: AT&T
Syntax:
mount [ -t nfs|nfs2 ] fsname dirname df [ -F nfs|nfs3 ] -k
Although it is always best to have NFS2 talking to NFS2 and NFS3 talking to NFS3, there are probably times when you need to have NFS3 talk to NFS2. NFS3 is supposed to drop down to NFS2 after it attempts to connect with NFS3 and timeouts. Network connectivity from the remotely mounted filesystem sometimes drops off the network, slowing down the system response time.
By passing the NFS type into the mount when it is initiated, the operating system does not have to worry about any confusion or a wait to timeout while trying to communicate between NFS3 to NFS2.
Here is what you do if you want to force NFS3 to talk to NFS2 from a UNIX shell:
# mount -t nfs2 rocket:/alt /alt # df -F nfs -k Filesystem Type kbytes use avail %use Mounted on rocket:/animate nfs 2051936 1915648 136288 94 /animate
# df -F nfs3 -k Filesystem Type kbytes use avail %use Mounted on shuttle:/model nfs3 1627996 1465936 162060 91 /model
On the system that is talking in NFS3, issue the mount command with a -t option, for type. This tells the system that you want talk to the remote system via NFS2.
Always verify that the command executed successfully with the df command. Your filesystem should reflect that the mount point has been made with NFS2, by being of type nfs. If an NFS version 3 mount point was made then you would see the type as nfs3.
After you have verified that the mount point was established properly, you can hard code it into the filesystem table. Depending on your specific flavor, use /etc/fstab or /etc/vfstab. Edit the appropriate filesystem table for your flavor to add the following entry:
#================================================================ # filesystem directory type options frequency pass #================================================================ rocket:/animate /animate nfs2 rw,bg,hard,intr 0 0
This entry allows the filesystem /animate on the remote system called rocket to be mounted to the local mount point called remote when the system boots up.
# mount /animate # df -F nfs -k Filesystem Type kbytes use avail %use Mounted on rocket:/animate nfs 2051936 1915648 136288 94 /animate
By issuing the mount command with the mount point /animate, you cause mount to read the filesystem table and mount the filesystem with the options defined in the filesystem table. Verify once again that the mount point took. Now every time you reboot or bring up the system, the mount point is established.
There is currently a mixed environment of different revisions of UNIX running on the same platform. The newer versions are shipping using NFS version 3. Many system administrators, however, are still supporting systems running with NFS version 2. Some vendors are not going to NFS version 3 yet for certain reasons: one is memory restraints and the other is that not all flavors are able to support backwards compatibility. The vendors are almost being forced to choose one or the other.
I think you will find that most of the systems that are cross-mounting NFS2 and NFS3 are doing so between servers and workstations. I have seen it in both directions. Many workstations run NFS3 with the server stuck back on NFS2; it's easier to upgrade the OS or a workstation that sells for $10,000-15,000 instead of a $200,000 server with production applications used by hundreds or thousands of users. In other instances, the user is stuck behind with slow 10Base-T workstations with NFS2, and along comes a fast new 100Base-T multiport Ethernet server running NFS3.
This might apply at the time the book is published, but it should be considered when any major event takes place that affects an entire computing environment. Companies are and will be placing a freeze on all operating systems to make them year-2000 compliant. They do not want to introduce any new problems into the equation. This makes it difficult, because while new systems are being purchased, older systems are being patched for Y2K and NFS2 cannot be upgraded to NFS3 on these systems.
Man pages:
df, fstab, mount, nfs, vfstab
World Wide Web:
RFC 1813 NFS Version 3 --http://www.cis.ohio-state.edu/htbin/rfc/rfc1813.html
UNIX Hints & Hacks |
||||||||||||||||||||||
Chapter 2: Networking |
|
|||||||||||||||||||||
|
© Copyright Macmillan USA. All rights reserved.