bug-findutils
[Top][All Lists]
Advanced

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

Listing all inodes on filesystem (without doing a stat() call).


From: Ray Van Dolson
Subject: Listing all inodes on filesystem (without doing a stat() call).
Date: Thu, 31 Dec 2009 14:32:23 -0800
User-agent: Mutt/1.5.19 (2009-01-05)

I'm trying to generate a sorted list of inodes on my filesystem (so I
can optimize a GFS2 backup workflow).  The filesystem has >1 million
inodes, so generating this list can take a little bit of time.

I initially attempted to do this via Python, but all of its calls
appear to be too high level and result in stat() being called on every
file.

I then tried using find:

  find . -printf "%-15i %h/%f\n"

However, this also appears to call stat() on every file -- presumably
because the call to printf means I might want other information not
necessarily provided via a readdir()/getdents() calls (?)

I came across this[1] but it seems to refer specifically to -inum and
not a case where I want to output an inode number and filename only.

Can someone advise as to the most efficient way to generate a list of
inode / filename pairs for my entire filesystem using find?

I have tried with both findutils 4.2 and 4.4 (I realize the bug I
mentioned above is only in 4.5) from RHEL 5.4 and Fedora 11
respectively.

Thanks,
Ray

[1] http://savannah.gnu.org/bugs/?func=detailitem&item_id=24342#options




reply via email to

[Prev in Thread] Current Thread [Next in Thread]