Nicholas Leippe <[EMAIL PROTECTED]> wrote: > Currently, du -x properly excludes other filesystems that are mounted. > But if the same filesystem is mounted again with -o bind (linux, possibly > other oses), it still includes them in the count. > > An option to exclude them from the count as well would be convenient.
du's --exclude option excludes based on device number, and two bind-mounted directories share the same device number, it's not sensible to make --exclude do what you want. I was going to suggest that you run "du -x some-top-dir" where some-top-dir contains both of your bind-mounted directories, thinking the total would reflect that one is essentially linked to the other, ... But that doesn't work. The space is counted twice because du recognizes same dev/ino pairs only when the link count (st_nlink) is 2 or larger. Relaxing that by removing a single line/disjunct solves the problem at the expense of requiring significantly more memory in the common case: one dev/ino pair is stored for every single non-directory encountered, rather than only those with two or more links. This might require a new option. I'll think about it. If you don't hear anything in a week or two, please ping the list. _______________________________________________ Bug-coreutils mailing list Bug-coreutils@gnu.org http://lists.gnu.org/mailman/listinfo/bug-coreutils