How to keep the find comand from traversing NFS mounts?

How to keep the find comand from traversing NFS mounts?

Post by Randall P. Johnso » Wed, 11 Nov 1998 04:00:00



Hi,
I'd like to stop the find command from traversing NFS mounted filesystems
on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to do
the trick. Does anyone know how?

Thanks!
--
Randall P. Johnson

work  (916) 649-6174
fax   (916) 649-6062

 
 
 

How to keep the find comand from traversing NFS mounts?

Post by and.. » Thu, 12 Nov 1998 04:00:00




Quote:>Hi,
>I'd like to stop the find command from traversing NFS mounted filesystems
>on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to do
>the trick. Does anyone know how?

I think the nearest you can do is specify -mount and list
all the local filesystems.

-local merely stops matches in remote filesystems from
being further processed, but they are still traced as
it might be that a local filesystem is mounted somewhere
inside a remote one and/or some earlier command line
switches might still be applicable to remote files.

Try some refinement based on...

find `awk '$3=="ufs" {print $2}' /etc/mnttab` -mount .....

--
Andrew Gabriel
Consultant Software Engineer

 
 
 

How to keep the find comand from traversing NFS mounts?

Post by Sheldon T. Ha » Thu, 12 Nov 1998 04:00:00


On Tue, 10 Nov 1998 15:47:16 -0800, "Randall P. Johnson"


>Hi,
>I'd like to stop the find command from traversing NFS mounted filesystems
>on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to do
>the trick. Does anyone know how?

I don't have any NFS file systems, so I can't test this, but O'Reilly's
"Unix Power Tools" suggests the "-o -fstype nfs -prune" clause.  The "-o"
may be unnecessary, the example isn't very clear.

-Shel

--
 Sheldon T. Hall

 This message sold by weight, not by volume;
 Content may settle during shipment.

 
 
 

How to keep the find comand from traversing NFS mounts?

Post by Katherine Hosc » Thu, 12 Nov 1998 04:00:00



> Hi,
> I'd like to stop the find command from traversing NFS mounted filesystems
> on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to do
> the trick. Does anyone know how?

Can't you just do a "find -fstype  ufs ...." ?

-- katherine


Department of Computer Science                          504-280-7190
University of New Orleans                               504-280-7228 (fax)
New Orleans, LA  70148                                  504-723-6953 (pcs)

-- "I read, much of the night, and go south in winter."

 
 
 

How to keep the find comand from traversing NFS mounts?

Post by James Denni » Fri, 13 Nov 1998 04:00:00


When I have wanted to do this in the past, I've used something like

find / -name junk.out ! -fstype nfs -print

the ! means don't go there.

Jamie



>> Hi,
>> I'd like to stop the find command from traversing NFS mounted filesystems
>> on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to
do
>> the trick. Does anyone know how?

>Can't you just do a "find -fstype  ufs ...." ?

>-- katherine


>Department of Computer Science                          504-280-7190
>University of New Orleans                               504-280-7228 (fax)
>New Orleans, LA  70148                                  504-723-6953 (pcs)

>-- "I read, much of the night, and go south in winter."

 
 
 

How to keep the find comand from traversing NFS mounts?

Post by John Kotche » Fri, 13 Nov 1998 04:00:00



> When I have wanted to do this in the past, I've used something like

> find / -name junk.out ! -fstype nfs -print

> the ! means don't go there.

> Jamie

Isn't -local also an appropriate (and much shorter)solution?

Let's see what "man find" says

-local         True if the file system type is not a  remote
               file   system   type   as   defined   in  the
               /etc/dfs/fstypes file.  nfs is  used  as  the
               default   remote   filesystem   type  if  the
               /etc/dfs/fstypes file is not present.

Many times a simple way is provided :-)

Cheers everyone.



> >> Hi,
> >> I'd like to stop the find command from traversing NFS mounted filesystems
> >> on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to
> do
> >> the trick. Does anyone know how?

> >Can't you just do a "find -fstype  ufs ...." ?

> >-- katherine


> >Department of Computer Science                          504-280-7190
> >University of New Orleans                               504-280-7228 (fax)
> >New Orleans, LA  70148                                  504-723-6953 (pcs)

> >-- "I read, much of the night, and go south in winter."

--
************************************************************
* A goofy Unix SA working for a large computer equipment   *
* manufacturer and  services provider.  Opinions expressed *

************************************************************
 
 
 

How to keep the find comand from traversing NFS mounts?

Post by Casper H.S. Dik - Network Security Engine » Fri, 13 Nov 1998 04:00:00


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]



>> Hi,
>> I'd like to stop the find command from traversing NFS mounted filesystems
>> on solaris 2.5, 2.5.1, and 2.6 hosts. The "-local" switch doesn't seem to do
>> the trick. Does anyone know how?
>Can't you just do a "find -fstype  ufs ...." ?

No.  That command will examine only files on ufs filesystems, but it
will a lso traverse nfs mounts looking for them.  (It's just like -type f;
it looks at all files)

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

How to keep the find comand from traversing NFS mounts?

Post by Casper H.S. Dik - Network Security Engine » Fri, 13 Nov 1998 04:00:00


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


>When I have wanted to do this in the past, I've used something like
>find / -name junk.out ! -fstype nfs -print
>the ! means don't go there.

No, it means "ignore the file if it's not an nfs file".

It will still look at all nfs files.

You need to use -xdev, -local or -fstype nfs -prune -o ...

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

How to keep the find comand from traversing NFS mounts?

Post by Dean Neuman » Sun, 15 Nov 1998 04:00:00




> > When I have wanted to do this in the past, I've used something like

> > find / -name junk.out ! -fstype nfs -print

> > the ! means don't go there.

> > Jamie

> Isn't -local also an appropriate (and much shorter)solution?

> Let's see what "man find" says

> -local         True if the file system type is not a  remote
>                file   system   type   as   defined   in  the
>                /etc/dfs/fstypes file.  nfs is  used  as  the
>                default   remote   filesystem   type  if  the
>                /etc/dfs/fstypes file is not present.

> Many times a simple way is provided :-)

> Cheers everyone.

I believe -local only solves half the problem: it may prune nfs
filesystems, but find stiff traverses loopback mounts, so you could
potentially get multiple matches reported for the same file.

Something like
        find / ! -fstype ufs -prune
should, I believe, prune all non-ufs paths, including lofs mounts.

Casper, is this correct?

--

Neumann & Associates Information Systems Inc.

Note: Remember to delete the ".delete-this-part"
portion of the return address before replying.

 
 
 

How to keep the find comand from traversing NFS mounts?

Post by Richard L. Hamilt » Mon, 16 Nov 1998 04:00:00


I just played around with that a bit as follows:
(where /var is a ufs filesystem)
 mount -F lofs /var/tmp /mnt

find /mnt -fstype lofs -print   (only finds directories)
find /mnt -fstype ufs -print    (finds everything other than directories)

System info:
SunOS mindwarp 5.6 Generic_105181-09 sun4m sparc SUNW,SPARCstation-10

This is definitely not what I would have expected!  However, the "BUGS"
section of lofs(7fs) somewhat explains what's happening:

Quote:>BUGS
>     (1) Files can be modified on a  read-only  loopback  mounted
>     file  system  and  (2) a loopback mounted file system can be
>     unmounted even if there is an open regular file on that file
>     system.   The loopback file system works by shadowing direc-
>     tories of the underlying file system.  Because no other file
>     types are shadowed, the loopback file system can not enforce
>     read-only access to non-directory files located on  a  read-
>     only  mounted  loopback  file system.  Thus, write access to
>     regular files located on a loopback mounted file  system  is
>     determined  by the underlying file system.  In addition, the
>     loopback file system can not correctly determine  whether  a
>     loopback  mounted  file  system can be unmounted or not.  It
>     can only detect when a directory is active or not, not  when
>     a  file  within  a  directory  is  active.  Thus, a loopback
>     mounted file system may be unmounted if there are no  active
>     directories on the file system, even if there are open files
>     on the file system.



- Show quoted text -



>> > When I have wanted to do this in the past, I've used something like

>> > find / -name junk.out ! -fstype nfs -print

>> > the ! means don't go there.

>> > Jamie

>> Isn't -local also an appropriate (and much shorter)solution?

>> Let's see what "man find" says

>> -local         True if the file system type is not a  remote
>>                file   system   type   as   defined   in  the
>>                /etc/dfs/fstypes file.  nfs is  used  as  the
>>                default   remote   filesystem   type  if  the
>>                /etc/dfs/fstypes file is not present.

>> Many times a simple way is provided :-)

>> Cheers everyone.

> I believe -local only solves half the problem: it may prune nfs
> filesystems, but find stiff traverses loopback mounts, so you could
> potentially get multiple matches reported for the same file.

> Something like
>    find / ! -fstype ufs -prune
> should, I believe, prune all non-ufs paths, including lofs mounts.

> Casper, is this correct?

> --

> Neumann & Associates Information Systems Inc.

> Note: Remember to delete the ".delete-this-part"
> portion of the return address before replying.

--
ftp> get |fortune
377 I/O error: smart remark generator failed

Bogonics: the primary language inside the Beltway


 
 
 

How to keep the find comand from traversing NFS mounts?

Post by and.. » Mon, 16 Nov 1998 04:00:00




Quote:

>I believe -local only solves half the problem: it may prune nfs
>filesystems, but find stiff traverses loopback mounts, so you could
>potentially get multiple matches reported for the same file.

>Something like
>    find / ! -fstype ufs -prune
>should, I believe, prune all non-ufs paths, including lofs mounts.

It will (I suspect) fail to find a ufs filesystem mounted in
an NFS filesystem, which whilst rare, is certainly not unheard
of. Hence my earlier suggestion...

    find `awk '$3=="ufs" {print $2}' /etc/mnttab` -mount .....

--
Andrew Gabriel
Consultant Software Engineer

 
 
 

How to keep the find comand from traversing NFS mounts?

Post by Casper H.S. Dik - Network Security Engine » Mon, 16 Nov 1998 04:00:00


[[ PLEASE DON'T SEND ME EMAIL COPIES OF POSTINGS ]]


Quote:>find /mnt -fstype lofs -print   (only finds directories)
>find /mnt -fstype ufs -print    (finds everything other than directories)
>System info:
>SunOS mindwarp 5.6 Generic_105181-09 sun4m sparc SUNW,SPARCstation-10
>This is definitely not what I would have expected!  However, the "BUGS"
>section of lofs(7fs) somewhat explains what's happening:

Yes, only lofs directories have lofs nodes.

Casper
--
Expressed in this posting are my opinions.  They are in no way related
to opinions held by my employer, Sun Microsystems.
Statements on Sun products included here are not gospel and may
be fiction rather than truth.

 
 
 

1. how to configure wu-ftpd to keep users from traversing $HOME

I'm sure this question has been asked and answered many times, but I could not
find anything about it after searching usenet, HOWTO's, and many FAQ's:

How can I configure my wu-ftpd so that users cannot traverse the filesystem
any lower that their $HOME?

IOW, if I'm ftp'd into /home/johnd, and I cd .., I would still be in
/home/johnd?

TIA,

sean

______________________________________________________________
#include "sig.h"
int main(){
        if (feelingWitty) wittySig();
        else standardSig();
        return 0;}
/*                              Sean


*/

2. How do I get a valid unix user id's from a unix server

3. An NFS mounted client keeps dying.

4. unix

5. /var/mail: to NFS mount or not to NFS mount?

6. strcmp in kernel

7. nfs mount to a nfs mount fails

8. Wingz is now shareware

9. nfs mount problem: mount: can't get address for nfs-server.kauai

10. "cc" comand not found when running make

11. useradd comand not found in bash.

12. du -d traverses loopback mounts

13. comand not found