All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marc MERLIN <marc@merlins.org>
To: Andrei Borzenkov <arvidjaar@gmail.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: How to find/reclaim missing space in volume
Date: Mon, 5 Jun 2023 18:46:36 -0700	[thread overview]
Message-ID: <20230606014636.GG105809@merlins.org> (raw)
In-Reply-To: <9bfa8bb6-b64e-d34f-f9c8-db5f9510fc29@gmail.com>

On Mon, Jun 05, 2023 at 08:00:02PM +0300, Andrei Borzenkov wrote:
> On 05.06.2023 19:26, Marc MERLIN wrote:
> > I have this:
> > sauron [mc]# df -h .
> > Filesystem         Size  Used Avail Use% Mounted on
> > /dev/mapper/pool2  1.1T  853G  212G  81% /mnt/btrfs_pool2
> > sauron [mc]# btrfs fi show .
> > Label: 'btrfs_pool2'  uuid: fde3da31-67e9-4f88-b90d-6c3f6becd56a
> > 	Total devices 1 FS bytes used 847.89GiB
> > 	devid    1 size 1.04TiB used 890.02GiB path /dev/mapper/pool2
> > sauron [mc]# btrfs fi df .
> > Data, single: total=878.00GiB, used=843.85GiB
> > System, DUP: total=8.00MiB, used=128.00KiB
> > Metadata, DUP: total=6.00GiB, used=4.04GiB
> > GlobalReserve, single: total=512.00MiB, used=0.00B
> > 
> 
> btrfs filesystem usage -T is usually more useful than both the above
> commands.
sauron:/mnt/btrfs_pool2# btrfs fi usage -T .
Overall:
    Device size:		   1.04TiB
    Device allocated:		 890.02GiB
    Device unallocated:		 177.73GiB
    Device missing:		     0.00B
    Used:			 851.85GiB
    Free (estimated):		 211.93GiB	(min: 123.07GiB)
    Data ratio:			      1.00
    Metadata ratio:		      2.00
    Global reserve:		 512.00MiB	(used: 0.00B)

                     Data      Metadata System               
Id Path              single    DUP      DUP       Unallocated
-- ----------------- --------- -------- --------- -----------
 1 /dev/mapper/pool2 878.00GiB 12.00GiB  16.00MiB   177.73GiB
-- ----------------- --------- -------- --------- -----------
   Total             878.00GiB  6.00GiB   8.00MiB   177.73GiB
   Used              843.79GiB  4.03GiB 128.00KiB      

> > sauron:/mnt/btrfs_pool2# du -sh *
> > 599G	varchange2
> > 598G	varchange2_ggm_daily_ro.20230605_07:57:43
> > 4.0K	varchange2_last
> > 599G	varchange2_ro.20230605_08:01:30
> > 599G	varchange2_ro.20230605_09:01:43
> > 
> > I'm confused, the volumes above are snapshots with mostly the same data
> > (made within the last 2 hours) and I didn't delete any data in the FS
> > (they are mostly identical and used for btfrs send/receive)
> > 
> > Why do they add up ot 600GB, but btrfs says 847FB is used?
> > 
> 
> Each subvolume references 600G but it does not mean they are the same 600G.
> If quota is enabled, "btrfs quota show" may provide some more information,
> otherwise "btrfs filesystem du" shows shared and exclusive space (you need
> to pass all subvolumes in question to correctly compute shared vs
> exclusive).

Right, I did check/know that the snapshots shared the same data, but it 
doens't hurt to confirm:

sauron:/mnt/btrfs_pool2# btrfs filesystem du -s *
     Total   Exclusive  Set shared  Filename
 597.57GiB    20.00KiB   588.75GiB  varchange2
 597.57GiB     4.00KiB   588.75GiB  varchange2_ggm_daily_ro.20230605_09:59:26
 597.57GiB       0.00B   588.75GiB  varchange2_last
 597.57GiB     4.00KiB   588.75GiB  varchange2_minly.20230605_17:30:33
 597.57GiB       0.00B   588.75GiB  varchange2_minly.20230605_17:35:32
 597.57GiB       0.00B   588.75GiB  varchange2_minly.20230605_17:40:32
 597.57GiB     4.00KiB   588.75GiB  varchange2_minly.20230605_17:45:32
 597.57GiB     4.00KiB   588.75GiB  varchange2_minly.20230605_17:50:32
 597.57GiB     4.00KiB   588.75GiB  varchange2_minly.20230605_17:55:32
 597.57GiB       0.00B   588.75GiB  varchange2_minly.20230605_18:00:32
 597.57GiB       0.00B   588.75GiB  varchange2_minly.20230605_18:05:32
 597.57GiB     8.00KiB   588.75GiB  varchange2_minly.20230605_18:10:32
 597.57GiB    16.00KiB   588.75GiB  varchange2_ro.20230605_10:01:40
 597.57GiB    12.00KiB   588.75GiB  varchange2_ro.20230605_11:01:31
 597.57GiB     4.00KiB   588.75GiB  varchange2_ro.20230605_13:01:28
 597.57GiB     4.00KiB   588.75GiB  varchange2_ro.20230605_14:01:30
 597.57GiB     4.00KiB   588.75GiB  varchange2_ro.20230605_15:01:29
 597.57GiB     4.00KiB   588.75GiB  varchange2_ro.20230605_16:01:32
 597.57GiB     4.00KiB   588.75GiB  varchange2_ro.20230605_17:01:31
 597.57GiB       0.00B   588.75GiB  varchange2_ro.20230605_18:02:02
sauron:/mnt/btrfs_pool2# df -h .
Filesystem         Size  Used Avail Use% Mounted on
/dev/mapper/pool2  1.1T  853G  212G  81% /mnt/btrfs_pool2


-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
 
Home page: http://marc.merlins.org/                       | PGP 7F55D5F27AAF9D08

  reply	other threads:[~2023-06-06  1:46 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-06-05 16:26 How to find/reclaim missing space in volume Marc MERLIN
2023-06-05 16:47 ` Roman Mamedov
2023-06-05 17:00 ` Andrei Borzenkov
2023-06-06  1:46   ` Marc MERLIN [this message]
2023-06-06  4:47     ` Andrei Borzenkov
2023-06-06 16:41       ` Marc MERLIN
2023-06-06 18:25         ` Roman Mamedov
2023-06-07  2:12           ` Qu Wenruo
2023-06-07 19:17             ` Marc MERLIN
2023-06-07 19:32               ` Hans van Kranenburg
2023-06-07 20:02                 ` Marc MERLIN
2023-06-07 20:31                   ` Hans van Kranenburg
2023-06-06 18:19       ` Graham Cobb

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=20230606014636.GG105809@merlins.org \
    --to=marc@merlins.org \
    --cc=arvidjaar@gmail.com \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.