From unknown Mon Sep 08 01:50:44 2025 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Mailer: MIME-tools 5.509 (Entity 5.509) Content-Type: text/plain; charset=utf-8 From: bug#20578 <20578@debbugs.gnu.org> To: bug#20578 <20578@debbugs.gnu.org> Subject: Status: du counts a multiple times bind-mounted directory just for the first listed directory in a directory lists Reply-To: bug#20578 <20578@debbugs.gnu.org> Date: Mon, 08 Sep 2025 08:50:44 +0000 retitle 20578 du counts a multiple times bind-mounted directory just for th= e first listed directory in a directory lists reassign 20578 coreutils submitter 20578 Toralf F=C3=B6rster severity 20578 normal tag 20578 notabug thanks From debbugs-submit-bounces@debbugs.gnu.org Thu May 14 14:37:40 2015 Received: (at submit) by debbugs.gnu.org; 14 May 2015 18:37:40 +0000 Received: from localhost ([127.0.0.1]:45342 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ysy0q-0001as-2U for submit@debbugs.gnu.org; Thu, 14 May 2015 14:37:40 -0400 Received: from eggs.gnu.org ([208.118.235.92]:40165) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Ysy0o-0001af-Mk for submit@debbugs.gnu.org; Thu, 14 May 2015 14:37:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ysy0i-0005BD-Dt for submit@debbugs.gnu.org; Thu, 14 May 2015 14:37:33 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:56143) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysy0i-0005B8-BL for submit@debbugs.gnu.org; Thu, 14 May 2015 14:37:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53664) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysy0h-0002p5-AW for bug-coreutils@gnu.org; Thu, 14 May 2015 14:37:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Ysy0d-0004y3-5L for bug-coreutils@gnu.org; Thu, 14 May 2015 14:37:31 -0400 Received: from mout.gmx.net ([212.227.15.19]:52838) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Ysy0c-0004tY-Ri for bug-coreutils@gnu.org; Thu, 14 May 2015 14:37:27 -0400 Received: from [192.168.178.24] ([78.54.158.149]) by mail.gmx.com (mrgmx003) with ESMTPSA (Nemesis) id 0Mcmmn-1YbZa93fVp-00Hzla for ; Thu, 14 May 2015 20:37:25 +0200 Message-ID: <5554EB63.8050505@gmx.de> Date: Thu, 14 May 2015 20:37:23 +0200 From: =?UTF-8?B?VG9yYWxmIEbDtnJzdGVy?= User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: bug-coreutils@gnu.org Subject: du counts a multiple times bind-mounted directory just for the first listed directory in a directory lists Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K0:8JcAtpXB1j54V/Ip+MVSAXhRZJzjV3/7CqhYulBxCoVWJbEvvG8 YsyqQQmliA68gfuv6iB6eNJJgZxLDxsrxi17zqZcSnsnQY0/9T5UCy/y8L3IWi41VMMtuPc 6FpSbG7jf4wYKJQAJbOeJD+u7G8r+fZaD+7SqWoCaAYccHMzwcQ1mlphVPXwh+rbW+I3CMt +POKsynncmpbqp0jOqxQQ== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -4.1 (----) X-Debbugs-Envelope-To: submit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -4.1 (----) I created few chroot image, each conteaining a Gentoo Linux minimal image. I do bind-mount a directory from the host (~35 GB of downloaded package files) onto a directory of each of the chroots to save space and bandwith. A "du -ms" however counts that value just for the first listed directories: tor-relay /mnt/qa/tinderbox # du -ms amd64-hardened-stable_* amd64-hardened-unstable_* 2>/dev/null 42318 amd64-hardened-stable_20150513-221439 11948 amd64-hardened-unstable_20150513-215830 tor-relay /mnt/qa/tinderbox # du -ms amd64-hardened-unstable_* amd64-hardened-stable_* 2>/dev/null 48790 amd64-hardened-unstable_20150513-215830 5434 amd64-hardened-stable_20150513-221439 Pls Cc:- me - I'm not subscribed tor-relay /mnt/qa/tinderbox # eix -I sys-apps/coreutils [I] sys-apps/coreutils Available versions: 8.20 8.21 ~8.22 ~8.22-r1 ~8.23 {acl caps gmp multicall nls selinux static vanilla xattr USERLAND="BSD"} Installed versions: 8.21(11:34:15 AM 10/25/2014)(acl nls xattr -caps -gmp -selinux -static -vanilla USERLAND="-BSD") Homepage: http://www.gnu.org/software/coreutils/ Description: Standard GNU file utilities (chmod, cp, dd, dir, ls...), text utilities (sort, tr, head, wc..), and shell utilities (whoami, who,...) -- Toralf pgp key: 7B1A 07F4 EC82 0F90 D4C2 8936 872A E508 0076 E94E -- "; the past is all dirty and cruel in the modern popular imagination, with the exception of the Romans, who are just cruel" Ian Mortimer, 2008, "The Time Traveller's Guide to Medieval England" From debbugs-submit-bounces@debbugs.gnu.org Thu May 14 22:35:46 2015 Received: (at 20578) by debbugs.gnu.org; 15 May 2015 02:35:46 +0000 Received: from localhost ([127.0.0.1]:45582 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yt5TV-0004jG-SN for submit@debbugs.gnu.org; Thu, 14 May 2015 22:35:46 -0400 Received: from smtp.cs.ucla.edu ([131.179.128.62]:46898) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Yt5TT-0004j2-IS for 20578@debbugs.gnu.org; Thu, 14 May 2015 22:35:44 -0400 Received: from localhost (localhost.localdomain [127.0.0.1]) by smtp.cs.ucla.edu (Postfix) with ESMTP id 6595339E8016; Thu, 14 May 2015 19:35:37 -0700 (PDT) X-Virus-Scanned: amavisd-new at smtp.cs.ucla.edu Received: from smtp.cs.ucla.edu ([127.0.0.1]) by localhost (smtp.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CkZ6pC3jJHPQ; Thu, 14 May 2015 19:35:37 -0700 (PDT) Received: from [192.168.1.9] (pool-100-32-155-148.lsanca.fios.verizon.net [100.32.155.148]) by smtp.cs.ucla.edu (Postfix) with ESMTPSA id D898639E8015; Thu, 14 May 2015 19:35:36 -0700 (PDT) Message-ID: <55555B78.5030004@cs.ucla.edu> Date: Thu, 14 May 2015 19:35:36 -0700 From: Paul Eggert Organization: UCLA Computer Science Department User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: =?UTF-8?B?VG9yYWxmIEbDtnJzdGVy?= , 20578@debbugs.gnu.org Subject: Re: bug#20578: du counts a multiple times bind-mounted directory just for the first listed directory in a directory lists References: <5554EB63.8050505@gmx.de> In-Reply-To: <5554EB63.8050505@gmx.de> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: 20578 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -2.3 (--) Toralf Förster wrote: > I do bind-mount a directory from the host (~35 GB of downloaded package files) onto a directory of each of the chroots to save space and bandwith. > A "du -ms" however counts that value just for the first listed directories It sounds like 'du' is doing the right thing. du is supposed to count disk usage, which means it's not supposed to double-count files. If you prefer each directory to be considered independently, you can use 'du a; du b' rather than 'du a b'. Or possibly you may want the --count-links or --apparent-size options. From debbugs-submit-bounces@debbugs.gnu.org Mon Oct 22 22:20:31 2018 Received: (at 20578) by debbugs.gnu.org; 23 Oct 2018 02:20:31 +0000 Received: from localhost ([127.0.0.1]:36761 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEmJ4-0000ZS-RN for submit@debbugs.gnu.org; Mon, 22 Oct 2018 22:20:31 -0400 Received: from mail-io1-f67.google.com ([209.85.166.67]:40491) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gEmJ2-0000Z6-OF; Mon, 22 Oct 2018 22:20:29 -0400 Received: by mail-io1-f67.google.com with SMTP id a23-v6so2701589iod.7; Mon, 22 Oct 2018 19:20:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=SdyjWQi+vuP+d/DYBK1GKoo1Tz2SnmVc7AoJQte+2Qs=; b=UxzKlnLRhqyp00saRiB7InWeCryonEf/gy0Sf019tHljGj2cp9NJY3HgsCuw5BUYRD PdLwq4oueGCe43DFCKV12y+OfJ7ntQkhyMp+0fPS8Y1jW8Fosm1UaYHCJGAXMj1hHXkC YQjBNK3y2ZqAYnduNnLqnCUVBYOtz3iTxLtpZS0f1KRt82za4sRF2flIl+ugkw4A+pDP FThgFizyv3t9gkhMP3SWeSxyHQeHX0uQAlaEi8FDjx/5ISmDypQDiyfLTDdHz6/R44dd Jp49nbwvMDbxLsF0EdQBb7XTehb9d/WxyRmMb9IzHVeWLb3V4TFC6akHaWkjD1ficCLo H/MQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=SdyjWQi+vuP+d/DYBK1GKoo1Tz2SnmVc7AoJQte+2Qs=; b=UiXwF3uw16hbesnAAULFICk1gndMH4WJCwvCy+qzWVTlDteAY7hJ9cyPCsEn/Y6gwx 1VtxUE0ZjFp609ZHDuu/hwNgRl6e4jsr9rKc+W+kGiNaY/6dmUiJYLGA5I1ZC8+Q+Y1I ok22Gx+Js5cv34W0Bh3wc/YmdcLlV/lNMocJZV7ZMHApeXGHA6q2x38SAdsx2xV/n0qv z3vmB2sOn9I3L3Rn2+DxRIBRhDVRCPh5MnkJFhqBgg3bB2L/t6kImCeLUVCbR4fq69zl DIcXdqk2eiUE1eODhrXnPv4kSEoDn4U5sKjLKMyawR0NvpM/E05WgbeHI3YUOdJAoaeD OPEA== X-Gm-Message-State: AGRZ1gJmujwHINaaCCpiMwg/mLXzgddX32XXXFAr8fyrrqhWyoPh/gE7 RZWhWViuhYK/GTMTwcgvxiRrHx3B X-Google-Smtp-Source: AJdET5c2t1XeDHCHmpmMneIyhWIe0+i2lUncsE5m6MBrFTqcGmuP2ixCmLKrtt1+fR1fv6XMRMiy4g== X-Received: by 2002:a6b:7717:: with SMTP id n23-v6mr10343023iom.88.1540261222404; Mon, 22 Oct 2018 19:20:22 -0700 (PDT) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id l2-v6sm10365194ioj.59.2018.10.22.19.20.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 22 Oct 2018 19:20:21 -0700 (PDT) Subject: Re: bug#20578: du counts a multiple times bind-mounted directory just for the first listed directory in a directory lists To: 20578@debbugs.gnu.org References: <5554EB63.8050505@gmx.de> <55555B78.5030004@cs.ucla.edu> From: Assaf Gordon Message-ID: <2bc18eb0-0bde-a542-85f7-055dff165721@gmail.com> Date: Mon, 22 Oct 2018 20:20:19 -0600 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <55555B78.5030004@cs.ucla.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit X-Spam-Score: -0.0 (/) X-Debbugs-Envelope-To: 20578 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -1.0 (-) tags 20578 notabug close 20578 stop (triaging old bugs) On 14/05/15 08:35 PM, Paul Eggert wrote: > Toralf Förster wrote: >> I do bind-mount a directory from the host (~35 GB of downloaded >> package files) onto a directory of each of the chroots to save space >> and bandwith. >> A "du -ms" however counts that value just for the first listed >> directories > > It sounds like 'du' is doing the right thing.  du is supposed to count > disk usage, which means it's not supposed to double-count files. With no further comments in 3 years, I'm closing this bug. Discussion can continue by replying to this thread. -assaf From unknown Mon Sep 08 01:50:44 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Tue, 20 Nov 2018 12:24:09 +0000 User-Agent: Fakemail v42.6.9 # This is a fake control message. # # The action: # bug archived. thanks # This fakemail brought to you by your local debbugs # administrator