From unknown Fri Jun 20 20:12:11 2025 X-Loop: help-debbugs@gnu.org Subject: bug#60335: du should warn about btrfs Resent-From: Krzysztof =?UTF-8?Q?=C5=BBelechowski?= Original-Sender: "Debbugs-submit" Resent-CC: bug-coreutils@gnu.org Resent-Date: Mon, 26 Dec 2022 09:10:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 60335 X-GNU-PR-Package: coreutils X-GNU-PR-Keywords: To: 60335@debbugs.gnu.org X-Debbugs-Original-To: bug-coreutils@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.167204576229371 (code B ref -1); Mon, 26 Dec 2022 09:10:01 +0000 Received: (at submit) by debbugs.gnu.org; 26 Dec 2022 09:09:22 +0000 Received: from localhost ([127.0.0.1]:50748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9jU1-0007df-Qt for submit@debbugs.gnu.org; Mon, 26 Dec 2022 04:09:22 -0500 Received: from lists.gnu.org ([209.51.188.17]:40094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9jU0-0007dY-U0 for submit@debbugs.gnu.org; Mon, 26 Dec 2022 04:09:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9jU0-0001zP-P7 for bug-coreutils@gnu.org; Mon, 26 Dec 2022 04:09:20 -0500 Received: from shark2.2a.pl ([213.77.90.2] helo=shark.2a.pl) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9jTy-000753-SM for bug-coreutils@gnu.org; Mon, 26 Dec 2022 04:09:20 -0500 Received: from wrasse.2a.pl (wrasse.2a.pl [213.77.90.7]) by shark.2a.pl (Postfix) with ESMTP id F1742175083F for ; Mon, 26 Dec 2022 10:03:30 +0100 (CET) X-Virus-Scanned: amavisd-new at 2a.pl Received: from shark.2a.pl ([213.77.90.2]) by wrasse.2a.pl (wrasse.2a.pl [213.77.90.7]) (amavisd-new, port 10024) with ESMTP id 377C66u24npH for ; Mon, 26 Dec 2022 09:50:07 +0100 (CET) Received: from localhost.localdomain (unknown [10.8.1.26]) by shark.2a.pl (Postfix) with ESMTPSA id 1903B1753B7C for ; Mon, 26 Dec 2022 10:03:29 +0100 (CET) From: Krzysztof =?UTF-8?Q?=C5=BBelechowski?= Date: Mon, 26 Dec 2022 09:55:56 +0100 Message-ID: <2272224.ElGaqSPkdT@localhost.localdomain> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=213.77.90.2; envelope-from=giecrilj@stegny.2a.pl; helo=shark.2a.pl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) 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: -3.3 (---) The tool du does not handle btrfs volumes correctly. The total reported on my system is almost twice the volume capacity. This is unexpected and should be indicated with a warning, both in the output and in the documentation. Since the head of the output is often lost because it is not that important, the warning should be emitted at the end. The total reported by { du /; } agrees on the total reported by { btrfs filesystem du /; } but the latter command also prints a shared size which is not paradoxical. The problem with the tool btrfs is that it is a system command and not a user command so our code cannot just execute their code and be happy with it. Also, their output is different because it has 3 columns as I mentioned earlier. I understand that the total reported by { du /; } is still useful if one were to create an archive of the file system; such an archive would be much bigger than the file system itself and thus could not be restored unless the volume has lots of free space or the archiver itself is btrfs-aware, which I am afraid it is not. The moral of this story apparently is that btrfs volumes cannot be reasonably archived using standard tools. From unknown Fri Jun 20 20:12:11 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.505 (Entity 5.505) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Krzysztof =?UTF-8?Q?=C5=BBelechowski?= Subject: bug#60335: closed (Re: bug#60335: du should warn about btrfs) Message-ID: References: <54e938dd-1ba2-556b-51be-8aa9a8ddde7a@cs.ucla.edu> <2272224.ElGaqSPkdT@localhost.localdomain> X-Gnu-PR-Message: they-closed 60335 X-Gnu-PR-Package: coreutils Reply-To: 60335@debbugs.gnu.org Date: Mon, 26 Dec 2022 18:43:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1672080182-17593-1" This is a multi-part message in MIME format... ------------=_1672080182-17593-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #60335: du should warn about btrfs which was filed against the coreutils package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 60335@debbugs.gnu.org. --=20 60335: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D60335 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1672080182-17593-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 60335-done) by debbugs.gnu.org; 26 Dec 2022 18:42:43 +0000 Received: from localhost ([127.0.0.1]:54104 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9sQs-0004Z6-KS for submit@debbugs.gnu.org; Mon, 26 Dec 2022 13:42:43 -0500 Received: from zimbra.cs.ucla.edu ([131.179.128.68]:44996) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9sQl-0004Yi-Vg for 60335-done@debbugs.gnu.org; Mon, 26 Dec 2022 13:42:40 -0500 Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 25055160043; Mon, 26 Dec 2022 10:42:29 -0800 (PST) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id AgIai3N4IKn5; Mon, 26 Dec 2022 10:42:28 -0800 (PST) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 13BE6160048; Mon, 26 Dec 2022 10:42:28 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.9.2 zimbra.cs.ucla.edu 13BE6160048 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cs.ucla.edu; s=78364E5A-2AF3-11ED-87FA-8298ECA2D365; t=1672080148; bh=pQYbG3/Flv3hVmFL5iPhIxhCg/3bn4LTf1FySBmSGQA=; h=Content-Type:Message-ID:Date:MIME-Version:Subject:To:From; b=gvEw1t60X5VS1ewnUeejRY9OKUpu1zeLQkP7G+1U0qOIKaRVYJ77O7Mje3gpdZsXc WCZj5y8RIa+K7F4gSbNKNPQQDrEzkNMhr59tFUbwRpbppniRbm29Eq7SoW4OIJtQt0 SJ97UTNxhkF8dzlLR5xhCsLewIkP91Q1HurR61r8= X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id mYfmpccoJlfq; Mon, 26 Dec 2022 10:42:27 -0800 (PST) Received: from [192.168.86.236] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id D755B160043; Mon, 26 Dec 2022 10:42:27 -0800 (PST) Content-Type: multipart/mixed; boundary="------------0rkSLqvb2CvIc0K0rTR7B06l" Message-ID: <54e938dd-1ba2-556b-51be-8aa9a8ddde7a@cs.ucla.edu> Date: Mon, 26 Dec 2022 10:42:27 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: bug#60335: du should warn about btrfs Content-Language: en-US To: =?UTF-8?Q?Krzysztof_=c5=bbelechowski?= References: <2272224.ElGaqSPkdT@localhost.localdomain> From: Paul Eggert In-Reply-To: <2272224.ElGaqSPkdT@localhost.localdomain> X-Spam-Score: -3.4 (---) X-Debbugs-Envelope-To: 60335-done Cc: 60335-done@debbugs.gnu.org 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: -4.4 (----) This is a multi-part message in MIME format. --------------0rkSLqvb2CvIc0K0rTR7B06l Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable On 12/26/22 00:55, Krzysztof =C5=BBelechowski wrote: > The total reported on my > system is almost twice the volume capacity. This is unexpected and sho= uld be > indicated with a warning, both in the output and in the documentation. Although we can document the issue, I don't think a warning is needed.=20 Nor is it implementable, since there's no reliable way to know whether=20 copy-on-write, compression, etc. are affecting the numbers the operating=20 system is reporting. Perhaps in some distant future the kernel, Btrfs, ZFS etc. can find a=20 way to report underlying space usage in a better way. For example, if=20 CoW is being used for a page they might divide the page's size by the=20 number of times it's used. Whatever. In the meantime the best we can do=20 is document the issue, which I've attempted to do by installing the=20 attached patch. Thanks for reporting the problem. --------------0rkSLqvb2CvIc0K0rTR7B06l Content-Type: text/x-patch; charset=UTF-8; name="0001-doc-improve-doc-of-du-with-CoW-etc.patch" Content-Disposition: attachment; filename="0001-doc-improve-doc-of-du-with-CoW-etc.patch" Content-Transfer-Encoding: base64 RnJvbSBjZmU0YWY2NjFmOTU3MmFkNGRiZTViM2UwMWExNzhlMDRmZjM0M2FlIE1vbiBTZXAg MTcgMDA6MDA6MDAgMjAwMQpGcm9tOiBQYXVsIEVnZ2VydCA8ZWdnZXJ0QGNzLnVjbGEuZWR1 PgpEYXRlOiBNb24sIDI2IERlYyAyM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bmRlcmx5aW5nIGRldmljZXMu CiAKIEBleGl0c3RhdHVzCiAKLS0gCjIuMzguMQoK --------------0rkSLqvb2CvIc0K0rTR7B06l-- ------------=_1672080182-17593-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 26 Dec 2022 09:09:22 +0000 Received: from localhost ([127.0.0.1]:50748 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9jU1-0007df-Qt for submit@debbugs.gnu.org; Mon, 26 Dec 2022 04:09:22 -0500 Received: from lists.gnu.org ([209.51.188.17]:40094) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9jU0-0007dY-U0 for submit@debbugs.gnu.org; Mon, 26 Dec 2022 04:09:21 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9jU0-0001zP-P7 for bug-coreutils@gnu.org; Mon, 26 Dec 2022 04:09:20 -0500 Received: from shark2.2a.pl ([213.77.90.2] helo=shark.2a.pl) by eggs.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9jTy-000753-SM for bug-coreutils@gnu.org; Mon, 26 Dec 2022 04:09:20 -0500 Received: from wrasse.2a.pl (wrasse.2a.pl [213.77.90.7]) by shark.2a.pl (Postfix) with ESMTP id F1742175083F for ; Mon, 26 Dec 2022 10:03:30 +0100 (CET) X-Virus-Scanned: amavisd-new at 2a.pl Received: from shark.2a.pl ([213.77.90.2]) by wrasse.2a.pl (wrasse.2a.pl [213.77.90.7]) (amavisd-new, port 10024) with ESMTP id 377C66u24npH for ; Mon, 26 Dec 2022 09:50:07 +0100 (CET) Received: from localhost.localdomain (unknown [10.8.1.26]) by shark.2a.pl (Postfix) with ESMTPSA id 1903B1753B7C for ; Mon, 26 Dec 2022 10:03:29 +0100 (CET) From: Krzysztof =?utf-8?B?xbtlbGVjaG93c2tp?= To: bug-coreutils@gnu.org Subject: du should warn about btrfs Date: Mon, 26 Dec 2022 09:55:56 +0100 Message-ID: <2272224.ElGaqSPkdT@localhost.localdomain> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Received-SPF: none client-ip=213.77.90.2; envelope-from=giecrilj@stegny.2a.pl; helo=shark.2a.pl X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_NONE=0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Spam-Score: -2.3 (--) X-Debbugs-Envelope-To: submit 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: -3.3 (---) The tool du does not handle btrfs volumes correctly. The total reported on my system is almost twice the volume capacity. This is unexpected and should be indicated with a warning, both in the output and in the documentation. Since the head of the output is often lost because it is not that important, the warning should be emitted at the end. The total reported by { du /; } agrees on the total reported by { btrfs filesystem du /; } but the latter command also prints a shared size which is not paradoxical. The problem with the tool btrfs is that it is a system command and not a user command so our code cannot just execute their code and be happy with it. Also, their output is different because it has 3 columns as I mentioned earlier. I understand that the total reported by { du /; } is still useful if one were to create an archive of the file system; such an archive would be much bigger than the file system itself and thus could not be restored unless the volume has lots of free space or the archiver itself is btrfs-aware, which I am afraid it is not. The moral of this story apparently is that btrfs volumes cannot be reasonably archived using standard tools. ------------=_1672080182-17593-1--