bug-coreutils
[Top][All Lists]
Advanced

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

Re: du feature request: option like -x to exclude bind mounts


From: Jim Meyering
Subject: Re: du feature request: option like -x to exclude bind mounts
Date: Tue, 07 Oct 2008 17:35:20 +0200

Nicholas Leippe <address@hidden> wrote:

> On Tuesday 07 October 2008 05:58:19 am you wrote:
>> Nicholas Leippe <address@hidden> 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,

Whoops.  Here, I meant the -x (--one-file-system) option.

>> and two bind-mounted directories share the same device number,
>> it's not sensible to make --exclude do what you want.
...
> Just to be sure we're on the same page, I'm interested in excluding them
> entirely, not just making sure they only get counted once.
> Eg:
>
> a/
> a/b/
> b/
> mount -o bind b a/b
> du -<some option> a/
> result: only counts a/, skipping both hidden a/b/ and b/ bind mounted
> on top of a/b/
>
> Which is why I referenced the -x option which logically seems similar to
> what I want.

If you know beforehand which directory you'd like to exclude,
then use one of the --exclude=PATTERN or --exclude-from=FILE options.




reply via email to

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