Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Russell Coker <russell@coker.com.au>
To: Boris Burkov <boris@bur.io>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: btrfs-progs: btrfs dev usa as non-root is wrong and should just abort
Date: Thu, 11 Jul 2024 13:50:11 +1000	[thread overview]
Message-ID: <2138052.8hb0ThOEGa@cupcakke> (raw)
In-Reply-To: <20240710162938.GA3394284@zen.localdomain>

On Thursday, 11 July 2024 02:29:38 AEST Boris Burkov wrote:
> Also wrong, but at least it's the "size" number?!
> 
> btrfs device usage (and btrfs filesystem usage) usually give
> pretty reasonable results without root on my systems, so this is sort of
> surprising to me, especially since it looks like we both have the same
> trivial raid/volume setup and you are on a relatively new kernel.
> e.g., on my system running 6.9:

I'm surprised that it worked for anyone, my experience was that it fails on 
all systems and I had assumed that was the general experience.

> Does the same discrepancy happen for you when running
> 'btrfs filesystem usage /' with and without root? That command gives me
> lots of useful, interesting output without root. e.g.,

For me btrfs fi usa gives me almost everything as non-root.  A bogus value for 
device slack is the only thing wrong.

# btrfs fi usa /
Overall:
    Device size:		476.37GiB
    Device allocated:		222.07GiB
    Device unallocated:		254.29GiB
    Device missing:		    0.00B
    Device slack:		  1.50KiB
    Used:			209.94GiB
    Free (estimated):		263.99GiB	(min: 136.84GiB)
    Free (statfs, df):		263.99GiB
    Data ratio:			     1.00
    Metadata ratio:		     2.00
    Global reserve:		385.50MiB	(used: 0.00B)
    Multiple profiles:		       no

Data,single: Size:216.01GiB, Used:206.31GiB (95.51%)
   /dev/mapper/root	216.01GiB

Metadata,DUP: Size:3.00GiB, Used:1.81GiB (60.50%)
   /dev/mapper/root	  6.00GiB

System,DUP: Size:32.00MiB, Used:48.00KiB (0.15%)
   /dev/mapper/root	 64.00MiB

Unallocated:
   /dev/mapper/root	254.29GiB

$ btrfs fi usa /
WARNING: cannot read detailed chunk info, per-device usage will not be shown, 
run as root
Overall:
    Device size:		476.37GiB
    Device allocated:		222.07GiB
    Device unallocated:		254.29GiB
    Device missing:		    0.00B
    Device slack:		 16.00EiB
    Used:			209.94GiB
    Free (estimated):		263.99GiB	(min: 136.84GiB)
    Free (statfs, df):		263.99GiB
    Data ratio:			     1.00
    Metadata ratio:		     2.00
    Global reserve:		385.50MiB	(used: 0.00B)
    Multiple profiles:		       no

Data,single: Size:216.01GiB, Used:206.31GiB (95.51%)

Metadata,DUP: Size:3.00GiB, Used:1.81GiB (60.50%)

System,DUP: Size:32.00MiB, Used:48.00KiB (0.15%)

-- 
My Main Blog         http://etbe.coker.com.au/
My Documents Blog    http://doc.coker.com.au/




  reply	other threads:[~2024-07-11  3:50 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-07-10 11:52 btrfs-progs: btrfs dev usa as non-root is wrong and should just abort Russell Coker
2024-07-10 16:29 ` Boris Burkov
2024-07-11  3:50   ` Russell Coker [this message]
2024-07-10 21:13 ` Qu Wenruo
2024-07-11  3:42   ` Russell Coker
2024-07-11  3:47     ` Qu Wenruo
2024-07-11  3:55       ` Russell Coker
2024-07-11  3:58         ` Qu Wenruo

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2138052.8hb0ThOEGa@cupcakke \
    --to=russell@coker.com.au \
    --cc=boris@bur.io \
    --cc=linux-btrfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox