From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 20 04:15:26 2019 Received: (at submit) by debbugs.gnu.org; 20 Jan 2019 09:15:26 +0000 Received: from localhost ([127.0.0.1]:38304 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gl9CP-0005Hp-Lv for submit@debbugs.gnu.org; Sun, 20 Jan 2019 04:15:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:33523) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkyq2-0005Kq-3O for submit@debbugs.gnu.org; Sat, 19 Jan 2019 17:11:38 -0500 Received: from lists.gnu.org ([209.51.188.17]:50664) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gkypv-0000Zu-Rt for submit@debbugs.gnu.org; Sat, 19 Jan 2019 17:11:32 -0500 Received: from eggs.gnu.org ([209.51.188.92]:43714) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkypv-0001VQ-1D for bug-coreutils@gnu.org; Sat, 19 Jan 2019 17:11:31 -0500 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: * X-Spam-Status: No, score=1.1 required=5.0 tests=BAYES_50, FREEMAIL_ENVFROM_END_DIGIT,FREEMAIL_FROM,HTML_MESSAGE,MIME_HTML_ONLY, RCVD_IN_DNSWL_LOW autolearn=disabled version=3.3.2 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkypt-0000Yc-68 for bug-coreutils@gnu.org; Sat, 19 Jan 2019 17:11:31 -0500 Received: from mout.gmx.net ([212.227.15.19]:34697) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkypr-0000Wv-7B for bug-coreutils@gnu.org; Sat, 19 Jan 2019 17:11:29 -0500 Received: from [109.18.21.177] ([109.18.21.177]) by web-mail.gmx.net (3c-app-mailcom-bs14.server.lan [172.19.170.182]) (via HTTP); Sat, 19 Jan 2019 23:11:24 +0100 MIME-Version: 1.0 Message-ID: From: "Joseph Paul" To: bug-coreutils@gnu.org Subject: [coreutils 8.28] du -x is reporting a lower disk usage for /mnt when partitions are mounted Content-Type: text/html; charset=UTF-8 Date: Sat, 19 Jan 2019 23:11:24 +0100 Importance: normal Sensitivity: Normal X-Priority: 3 X-Provags-ID: V03:K1:52gBoIny20jN9Kqf7Y8X2U7vsyc8sUFdF4YPwSHRwQnWdibWd/sI6q7JmBLIn31Di1USY xMnojHC/oMDTWbD7ctV8ik+0nCGfQ+Lb0eXTWZkJZpHcagSoFGzaLB/NYqDSi2LS0YgM74IVOHdW soEFEhWou1lh4G0YGkTOvMuq/tP4GYRFDX55NIsSFqEZ3UaM+cSRCK2LEke0GmovevFpImk4c7YT p9Vg3SH3aJ/ZlYjrUy9TvC1hbcLw8BbUuQDr3svIi0LHPjKPF6ouQsaPUNEe5Csi00zYdxPogT9S hg= X-UI-Out-Filterresults: notjunk:1;V03:K0:tVu4dAKZ+to=:zXi5/QmI3b018CIJXa4Lw8 doNQoog5MXhK0AAOiEPwVtQ231AsLBUhnFTEY57E0F9nIDx4BMcR74MRuj4r1nlTQAi86CQkJ jTrbFcwIgMzKM0w/l5NlaQ7Mv69DtofCdceYjN0rmWVuwTJoSztcndXLakoO+qfcZPJg65E+1 0+PsbmmPirgFYmfB/jMCeZYiSQ89vS5IgzHOjJlyX1q3SOdS1EvjCO9OQjZ4rhs+mtQJSPxIL hTFpy/vwgG12W1mft9QKXWSc9l320PADnNghCWP+EyNBdWUN5oJqAHs8CypKzFogAJrVOXgkV 6KKYkMSmctnEz+oBEV8uhZ8+WJZTWwnJ6p+2xLI5k1x4vbfuZYr7DNbJ7UAsT8GLdVXdoiWj9 nowgAT0toirqoQ/H/jjoRT2C8JHeWvc0cApEXUtTOHaAbPFBZkLE9VsPHjlLHPf5w2Ib1upFY njrzW7yuphz0ulQMgck19Xv8812qGbCwU/B1A9V+RPoXiAYU8Irjruf1dBGsU5uqMLUGWrQ/P t4w0j93w+2TSX/G+MhucNQBaD4wFZuL3SH0gmHasWDD+yMObIwqcxMNV9K/5LDqotBNdNM8s3 LE3V6lc7KcAq0= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 212.227.15.19 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-Spam-Score: 4.5 (++++) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello, It may not be a bug at all, but I was surprised to find out that 'du -x' is reporting a lower disk usage on /mnt when partitions are mounted. Here is an example with '/mnt' belonging to the same filesystem as '/' : Content analysis details: (4.5 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom; id=joseph.paul1%40gmx.com; ip=209.51.188.92; r=debbugs.gnu.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (joseph.paul1[at]gmx.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (joseph.paul1[at]gmx.com) 1.1 MIME_HTML_ONLY BODY: Message only has text/html MIME parts 0.0 HTML_MESSAGE BODY: HTML included in message 2.2 XPRIO Has X-Priority header X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Sun, 20 Jan 2019 04:15:24 -0500 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.3 (+) X-Spam-Report: Spam detection software, running on the system "debbugs.gnu.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: Hello, It may not be a bug at all, but I was surprised to find out that 'du -x' is reporting a lower disk usage on /mnt when partitions are mounted. Here is an example with '/mnt' belonging to the same filesystem as '/' : Content analysis details: (1.3 points, 10.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- 0.9 SPF_FAIL SPF: sender does not match SPF record (fail) [SPF failed: Please see http://www.openspf.org/Why?s=mfrom;id=joseph.paul1%40gmx.com;ip=209.51.188.92;r=debbugs.gnu.org] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit (joseph.paul1[at]gmx.com) 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (joseph.paul1[at]gmx.com) 1.1 MIME_HTML_ONLY BODY: Message only has text/html MIME parts 0.0 HTML_MESSAGE BODY: HTML included in message -1.0 MAILING_LIST_MULTI Multiple indicators imply a widely-seen list manager
Hello,
 
It may not be a bug at all, but I was surprised to find out that 'du -x' is reporting a lower disk usage on /mnt when partitions are mounted.
 
Here is an example with '/mnt' belonging to the same filesystem as '/' :
 
linux$ LANG=EN ls -l /mnt
total 12
drwxr-xr-x 2 root root 4096 Jul  8  2018 VL1800
drwxr-xr-x 2 root root 4096 Jul  8  2018 data
drwxr-xr-x 3 root root 4096 Aug 19 13:24 nfs
 
# I mount two partitions from other disks on /mnt
 
linux$ sudo mount /mnt/VL1800
linux$ sudo mount /mnt/data
 
linux$ du -x /mnt
4    /mnt/nfs/nas
8    /mnt/nfs
12    /mnt
 
# I unmount the two partitions
 
linux$ sudo umount /mnt/VL1800
linux$ sudo umount /mnt/data
 
linux$ du -x /mnt
4    /mnt/data
4    /mnt/VL1800
4    /mnt/nfs/nas
8    /mnt/nfs
20    /mnt
 
/mnt is now bigger.
 
Is this a normal result, because even when mounted, physically, the directories '/mnt/VL1800' and '/mnt/data' still  exist on the '/' filesystem, or not ?
Shouldn't they still occupy 4Kb of disk space each on the '/' filesystem when partitions are mounted ?
 
Best regards,
Joseph Paul
 
From debbugs-submit-bounces@debbugs.gnu.org Sun Jan 20 05:30:26 2019 Received: (at 34143) by debbugs.gnu.org; 20 Jan 2019 10:30:26 +0000 Received: from localhost ([127.0.0.1]:38328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glAN0-00075i-4l for submit@debbugs.gnu.org; Sun, 20 Jan 2019 05:30:26 -0500 Received: from mail-pg1-f176.google.com ([209.85.215.176]:42913) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1glAMx-00075P-Of; Sun, 20 Jan 2019 05:30:24 -0500 Received: by mail-pg1-f176.google.com with SMTP id d72so8123936pga.9; Sun, 20 Jan 2019 02:30:23 -0800 (PST) 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=vTNKetnKu0NiVA3+2/VailpoaybBOw22L/O0aBtsgMc=; b=nhSzLnntVJB78XxlVD1yGuMhKiUr50MT1eMi5Rp1MAkQinSHO/Zo7Cp6zLQPM+SQBd CTGoERjH5KYSYmeGwnBwnNx8Kzl/embRIsesSlwSPop3v17IPw+kh7rjhX/aWc6FV2SR JNyWekwOWjegO3agFu52kTG2gZwtVWAYjcczihcG2ai9SSaKOUKN6U0qqUbJXphfS9YV Q38NkZcl9Qczx+bRAlEX5wNo7rLKLxfqzaRRL7l9P9BZA4p3CSefwSQFgV752kxT3tqH uzpwzBl5nuhDBRQEEBEi+eXOBDbPRv/p6YXjM5C8dGqxyuebk+AAXtVjUPAMypb7bpEb I62A== 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=vTNKetnKu0NiVA3+2/VailpoaybBOw22L/O0aBtsgMc=; b=LOBkbriVQcND0Xw0ul77QuPv4A0sVWwL8mDRt3CrgQtW1tHmg3kpMcQQ6vgXkQ0kwN 3vmdLVpfvQPHgRFXYR3d5zrFOq/OnMsiRhAXO5d9YN6kJqIIXY6AwbVdGFwzlTSBZrrk fcFMAc+fc4/GgoSAmo/dvulCgfTJpzLmy9Bz7ohPab9FNFqAZiq+WcuJTMxBs3vN1QnM XT2C8D+EsHdIXso6YQRI38QklZBm3pD0XY6mmCuIZyZ+/gcGmkVRrww5383iw+EcRXcX R9UqYuZqBWBMDwcNgy3q9ZHqIdpmNs/FOHCCBMKbQrzTH15rhYtwTwMBb4DL/M3pLfu8 4Y4w== X-Gm-Message-State: AJcUukfUhPewIw0TLHHLTISu0qRGOGK7lkB/c0cfsvDQKZwndtkeYyNo gmLjFggXln7d0iLzzXAupIbnjRzr X-Google-Smtp-Source: ALg8bN5In8BjJxcaKje8V0hwF3cpYa6YcZFvR0jUuH99gxL19bsw1Ao08iVBPaMmuvbSm8uqPXDOIA== X-Received: by 2002:a62:99dd:: with SMTP id t90mr25648675pfk.179.1547980216740; Sun, 20 Jan 2019 02:30:16 -0800 (PST) Received: from tomato.housegordon.com (moose.housegordon.com. [184.68.105.38]) by smtp.googlemail.com with ESMTPSA id l85sm14218527pfg.161.2019.01.20.02.30.14 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 20 Jan 2019 02:30:15 -0800 (PST) Subject: Re: bug#34143: [coreutils 8.28] du -x is reporting a lower disk usage for /mnt when partitions are mounted To: Joseph Paul , 34143@debbugs.gnu.org References: From: Assaf Gordon Message-ID: <4fbd6070-a58c-8dcd-b4c6-c1c3de1ad1a1@gmail.com> Date: Sun, 20 Jan 2019 03:30:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Spam-Score: 0.0 (/) X-Debbugs-Envelope-To: 34143 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 34143 notabug close 34143 stop Hello, On 2019-01-19 3:11 p.m., Joseph Paul wrote: > It may not be a bug at all, but I was surprised to find out that 'du > -x' is reporting a lower disk usage on /mnt when partitions are > mounted. This is not a bug. Technically, as you wrote below, du simply skips (and does not count) any directory that is not on the same filesystem. [...] > linux$ du -x /mnt > 4 /mnt/data > 4 /mnt/VL1800 > 4 /mnt/nfs/nas > 8 /mnt/nfs > 20 /mnt > > /mnt is now bigger. > > Is this a normal result, because even when mounted, physically, the > directories '/mnt/VL1800' and '/mnt/data' still exist on the '/' > filesystem, or not ? > Shouldn't they still occupy 4Kb of disk space each on the '/' > filesystem when partitions are mounted ? They do occupy as much disk space as before, but du has no way to know how much they occupy, because the kernel reports that they are on a different device and you requested -x/--one-file-system. We can even take it a step further, and mount a new filesyetem on a non-empty directory - all the directory's content won't be counted: As root, create the directory structure: cd /tmp mkdir -p a a/b a/c a/d Now fill the "b" directory with a large file: dd if=/dev/zero of=a/b/bigfile bs=1M count=1 Before any mounts, "b" is counted: # du -x a 4 a/c 1028 a/b 4 a/d 1040 a Now create a temporary file system loop file, and mount it over "b": dd if=/dev/zero of=disk.img bs=1M count=10 mkfs.ext3 disk.img mount -o loop disk.img a/b Re-checking disk-usage, "b" is not even listed, and its content (1MB) is not counted: # du -x a 4 a/c 4 a/d 12 a --- To see why du skips it, you can check the Device-ID associated with each directory: # stat -c "%n Device-ID: %D Mount-Point: %m" a a/b a/c a/d a Device-ID: 812 Mount-Point: /tmp a/b Device-ID: 700 Mount-Point: /tmp/a/b a/c Device-ID: 812 Mount-Point: /tmp a/d Device-ID: 812 Mount-Point: /tmp Your device numbers will differ, but the number for "a/b" will not be the same as for the rest. When du sees a different device number, it simply skips the directory. Once unmounted, the device-id returns to the old value, and "a/b" will be counted with its content: # umount a/b # stat -c "%n Device-ID: %D Mount-Point: %m" a a/b a/c a/d a Device-ID: 812 Mount-Point: /tmp a/b Device-ID: 812 Mount-Point: /tmp a/c Device-ID: 812 Mount-Point: /tmp a/d Device-ID: 812 Mount-Point: /tmp As such, I'm closing this as "not a bug", but discussion can continue by replying to this thread. regards, - assaf From unknown Sun Jun 15 08:40:07 2025 Received: (at fakecontrol) by fakecontrolmessage; To: internal_control@debbugs.gnu.org From: Debbugs Internal Request Subject: Internal Control Message-Id: bug archived. Date: Sun, 17 Feb 2019 12:24:06 +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