public inbox for linux-btrfs@vger.kernel.org
 help / color / mirror / Atom feed
From: Hugo Mills <hugo@carfax.org.uk>
To: Graham Cobb <g.btrfs@cobb.uk.net>
Cc: Alex Powell <alexj.powellalt@googlemail.com>,
	linux-btrfs@vger.kernel.org
Subject: Re: space still allocated post deletion
Date: Tue, 19 Apr 2022 13:42:33 +0100	[thread overview]
Message-ID: <20220419124233.GA15632@savella.carfax.org.uk> (raw)
In-Reply-To: <6672365e-c3d2-1a4c-7eb6-957f7a692d3a@cobb.uk.net>

On Tue, Apr 19, 2022 at 12:21:31PM +0100, Graham Cobb wrote:
> On 19/04/2022 11:41, Alex Powell wrote:
> > Hi team,
> > I have deleted hundreds of GB of files however space still remains the
> > same, even after a full balance and a dusage=0 balance. The location I
> > am deleting from is usually a mount point but I found some files had
> > saved there while the array was unmounted, which I then removed.
> 
> Most likely you have files in subvolumes which are not currently mounted
> anywhere. You need to mount the root subvolume of the filesystem to see
> all the files. Many distros default to putting the system root into a
> non-root subvolume.
> 
> I think you can see them all if you use:
> 
> btrfs subv list -a /
> 
> To access them...
> 
> mkdir /mnt/1
> mount -o subvolid=5 /dev/sdh2 /mnt/1

   As well as the above, the deleted files may also exist in
snapshots, in which case the space is still needed to store the
snapshot copy of it, and won't be released until all of those
snapshots have been removed as well (this may simply be a case of
waiting for the snapshots to time-out through your normal cleanup
schedule).

   If the things you deleted were themselves subvolumes, then it's
possible that there was an open file on the subvol (or that it was
monted elsewhere), in which case it won't be cleaned up until the open
file/mount is closed. You can check that with "btrfs sub list -d", but
I don't think that's likely to be the case here.

   Hugo.

> Graham
> 
> > 
> > root@bean:/home/bean# du -h --max-depth=1 /mnt/data/triage
> > 6.4G /mnt/data/triage/complete
> > 189G /mnt/data/triage/incomplete
> > 195G /mnt/data/triage
> > 
> > root@bean:/home/bean# rm -rf /mnt/data/triage/complete/*
> > root@bean:/home/bean# rm -rf /mnt/data/triage/incomplete/*
> > root@bean:/home/bean# du -h --max-depth=1 /mnt/data/triage
> > 0 /mnt/data/triage/complete
> > 0 /mnt/data/triage/incomplete
> > 0 /mnt/data/triage
> > 
> > root@bean:/home/bean# btrfs filesystem show
> > Label: none  uuid: 24933208-0a7a-42ff-90d8-f0fc2028dec9
> > Total devices 1 FS bytes used 209.03GiB
> > devid    1 size 223.07GiB used 211.03GiB path /dev/sdh2
> > 
> > root@bean:/home/bean# du -h --max-depth=1 /
> > 244M /boot
> > 91M /home
> > 7.5M /etc
> > 0 /media
> > 0 /dev
> > 0 /mnt
> > 0 /opt
> > 0 /proc
> > 2.7G /root
> > 1.6M /run
> > 0 /srv
> > 0 /sys
> > 0 /tmp
> > 3.6G /usr
> > 13G /var
> > 710M /snap
> > 22G /
> > 
> > Linux bean 5.15.0-25-generic #25-Ubuntu SMP Wed Mar 30 15:54:22 UTC
> > 2022 x86_64 x86_64 x86_64 GNU/Linux
> > btrfs-progs v5.16.2
> 

-- 
Hugo Mills             | What's a Nazgûl like you doing in a place like this?
hugo@... carfax.org.uk |
http://carfax.org.uk/  |
PGP: E2AB1DE4          |                                                Illiad

  reply	other threads:[~2022-04-19 12:42 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-19 10:41 space still allocated post deletion Alex Powell
2022-04-19 11:21 ` Graham Cobb
2022-04-19 12:42   ` Hugo Mills [this message]
2022-04-20  7:17   ` Alex Powell
2022-04-20  8:27     ` Graham Cobb
2022-04-23  6:04     ` Andrei Borzenkov

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=20220419124233.GA15632@savella.carfax.org.uk \
    --to=hugo@carfax.org.uk \
    --cc=alexj.powellalt@googlemail.com \
    --cc=g.btrfs@cobb.uk.net \
    --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