[comp.unix.questions] NFS question

drl@vuse.vanderbilt.edu (David R. Linn) (07/30/88)

I need to use a modified ftw to walk a directory tree
that contains softlinks and NFS mounted filesystems.
I know how to fix the softlink problem by changing
stat to lstat. How do I recognize a file as being on
a remote NFS filesystem?

Please reply directly to me as I am not sure that my
subscription request for this list ever reached the
list maintainer.

	 David Linn

David Linn, System Manager/Postmaster      |INET:
Vanderbilt University School of Engineering| drl@vuse.vanderbilt.edu
Post Office Box 1824, Station B            |Phone:
Nashville, TN, USA  37235                  | [USA] 615-322-7924

gwyn@brl-smoke.ARPA (Doug Gwyn ) (07/31/88)

In article <62172@sun.uucp> swilson@sun.UUCP (Scott Wilson) writes:
->How do I recognize a file as being on
->a remote NFS filesystem?
-Under SunOS 4.0 at least, I believe the easiest way to do
-this is to stat the file, then compare the st_dev value
-with the st_dev value gotten from stat'ing all the mount
-points.  Use the getmntent(3) family to examine /etc/mtab
-to find out what has been mounted where.  When the st_devs
-match you can determine whether the file is NFS or not.

Wouldn't it be easier to access the file then see whether
the access time had been updated?

guy@gorodish.Sun.COM (Guy Harris) (08/02/88)

> ->How do I recognize a file as being on
> ->a remote NFS filesystem?
> 
> Wouldn't it be easier to access the file then see whether
> the access time had been updated?

And thereby conclude that every read-only local file system is really an NFS
file system....

Depending on implementation characteristics such as this (or such as the major
device having the 8th bit set, or...) is not a good idea.

mchinni@pica.army.mil (Michael J. Chinni, SMCAR-CCS-E) (07/27/89)

Thanks to all who responded with help for my NFS question.  The consensus seems
to be that I need to create a /etc/exports file as per the man page for
exports.

While this did help a little (no more "permission denied" but now "server
timeout") only a few people pointed out that I could NOT use "dump" on an
NFS-mounted filesystem.

I think that I will end up using "tar" for my purpose (as suggested by Chris
Torek), w/o doing the NFS mounting.

	Thanks again to all that answered.

/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/
			    Michael J. Chinni
      Chief Scientist, Simulation Techniques and Workplace Automation Team
	 US Army Armament Research, Development, and Engineering Center
 User to skeleton sitting at cobweb   () Picatinny Arsenal, New Jersey  
    and dust covered workstation      () ARPA: mchinni@pica.army.mil
      "System been down long?"        () UUCP: ...!uunet!pica.army.mil!mchinni
/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/\/