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.
>> > 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