bug-coreutils
[Top][All Lists]
Advanced

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

bug#7399: du may count one file multiple times if it visible through mul


From: Evgeny Kapun
Subject: bug#7399: du may count one file multiple times if it visible through multiple mounts
Date: Sun, 14 Nov 2010 16:16:36 +0300
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.12) Gecko/20101027 Thunderbird/3.1.6

Some kernels, such as Linux, permit mounting one filesystem multiple
times. This can make multiple paths refer to the same file, although
neither hard nor symbolic links are involved. In this case, du sometimes
incorrectly counts that file many times:

        $ mkdir dir1 dir2
        # mount --bind dir1 dir2
        $ dd if=/dev/urandom of=dir1/file bs=1k count=1000
        1000+0 records in
        1000+0 records out
        1024000 bytes (1.0 MB) copied, 0.179289 s, 5.7 MB/s
        $ du
        1008    ./dir1
        1008    ./dir2
        2020    .

As you may see, the file is counted twice, once as dir1/file and then as
dir2/file. However, if du is run with repeated argument, it's behavior
is different:

        $ du . .
        1008    ./dir1
        1012    .





reply via email to

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