Re: "find" problem

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 07 January 2012 at 20:02:21 +1100, Cameron Simpson wrote:
> On 06Jan2012 23:29, Dean S. Messing <deanm@xxxxxxxxxxxxx> wrote:
> | In doing more experimenting with find, I discovered that
> | / is evidently fstype "rootfs", whatever that is.
> 
> Interesting.
> 
> | Looking in /etc/mtab I see:
> |    rootfs / rootfs rw 0 0
> 
> I was going to suggest you run the "mount" command, but I see you're
> ahead of me.

Yeah, I ran "mount" first and it _does not_ show up there.
But it does in /etc/mtab, which in F15 is just a symlink to /proc/self/mounts.

> | and 
> |    /dev/mapper/vg00-lv_root / ext4
> |    rw,relatime,user_xattr,acl,barrier=1,stripe=32,data=ordered 0 0
> |
> | In fact,
> |    find /  -fstype rootfs -print
> | prints all the files and ordinary directories under /.
> 
> Which makes sense, given the above.

Yep.

> | None of the ext4 mounts are entered, nor are /proc or /sys, &c.
> 
> As you'd hope!

Well, I hoped for much more, but I didn't get it. :-)

> |    find /  -fstype ext4 -print
> | only prints the entries in ext4 directories mounted in /.
> 
> Well at least it is all nice and consistent.

Yes. 

> | This behaviour thoroughly breaks some of my scripts.
> 
> Fun fun fun. What assumptions are you making (aside from ext4 == regular
> filesystem)? Are you simply trying to avoid /proc and /dev etc? And NFS
> mounts I guess?

Approximately.  Here is the key line from one of the scripts.

find /  \( \! -fstype ext2 \! -fstype ext3 \! -fstype ext4 $w \) -prune \
-o <my processing>

$w is built earlier in the script as follows:

for pp in $PRUNEPATHS
do
    w="$w -o -wholename $pp"
done

$PRUNEPATHS is a list of directories I also want to prune from the tree
before processing begins.

I suppose I can just add rootfs to the list of -fstype switches, but
I'm not sure what side effects this will have since "rootfs" is not
really a "file type". It also is no longer portable.

How much nicer it would be to return to how it "should" work!

Dean
-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
Have a question? Ask away: http://ask.fedoraproject.org


[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux