All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hugo Mills <hugo@carfax.org.uk>
To: Peter Grandi <pg@btrfs.list.sabi.co.UK>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: understanding disk space usage
Date: Wed, 8 Feb 2017 18:03:11 +0000	[thread overview]
Message-ID: <20170208180311.GB4249@carfax.org.uk> (raw)
In-Reply-To: <22683.12104.679173.639568@tree.ty.sabi.co.uk>

[-- Attachment #1: Type: text/plain, Size: 3399 bytes --]

On Wed, Feb 08, 2017 at 02:46:32PM +0000, Peter Grandi wrote:
> >> My system is or seems to be running out of disk space but I
> >> can't find out how or why. [ ... ]
> >> Filesystem            Size  Used Avail Use% Mounted on
> >> /dev/sda3              28G   26G  2.1G  93% /
> [ ... ]
> > So from chunk level, your fs is already full.  And balance
> > won't success since there is no unallocated space at all.
> 
> To add to this, 28GiB is a bit too small for Btrfs, because at
> that point chunk size is 1GiB. I have the habit of sizing
> partitions to an exact number of GiB, and that means that most
> of 1GiB will never be used by Btrfs because there is a small
> amount of space allocated that is smaller than 1GiB and thus
> there will be eventually just less than 1GiB unallocated.

   Not true -- the last chunk can be smaller than 1 GiB, to use the
available space completely.

   Hugo.

> Unfortunately the chunk size is not manually settable.
> 
> Example here from 'btrfs fi usage':
> 
> Overall:
>     Device size:                  88.00GiB
>     Device allocated:             86.06GiB
>     Device unallocated:            1.94GiB
>     Device missing:                  0.00B
>     Used:                         80.11GiB
>     Free (estimated):              6.26GiB      (min: 5.30GiB)
> 
> That means that I should 'btrfs balance' now, because of the
> 1.94GiB "unallocated", 0.94GiB will never be allocated, and that
> leaves just 1GiB "unallocated" which is the minimum for running
> 'btrfs balance'. I have just done so and this is the result:
> 
> Overall:
>     Device size:                  88.00GiB
>     Device allocated:             82.03GiB
>     Device unallocated:            5.97GiB
>     Device missing:                  0.00B
>     Used:                         80.11GiB
>     Free (estimated):              6.26GiB      (min: 3.28GiB)
> 
> At some point I had decided to use 'mixedbg' allocation to
> reduce this problem and hopefully improve locality, but that
> means that metadata and data need to have the same profile, and
> I really want metadata to be 'dup' because of checksumming,
> and I don't want data to be 'dup' too.
> 
> > [ ... ] To proceed, add a larger device to current fs, and do
> > a balance or just delete the 28G partition then btrfs will
> > handle the rest well.
> 
> Usually for this I use a USB stick, with a 1-3GiB partition plus
> a bit extra because of that extra bit of space.
> 
> https://btrfs.wiki.kernel.org/index.php/FAQ#How_much_free_space_do_I_have.3F
> https://btrfs.wiki.kernel.org/index.php/FAQ#Help.21_Btrfs_claims_I.27m_out_of_space.2C_but_it_looks_like_I_should_have_lots_left.21
> marc.merlins.org/perso/btrfs/post_2014-05-04_Fixing-Btrfs-Filesystem-Full-Problems.html
> 
> Unfortunately if it is a single device volume and metadata is
> 'dup' to remove the extra temporary device one has first to
> convert the metadata to 'single' and then back to 'dup' after
> removal.
> 
> There are also some additional reasons why space used (rather
> than allocated) may be larger than expected, in special but not
> wholly infrequent cases. My impression is that the Btrfs design
> trades space for performance and reliability.

-- 
Hugo Mills             | Alert status chocolate viridian: Authorised
hugo@... carfax.org.uk | personnel only. Dogs must be carried on escalator.
http://carfax.org.uk/  |
PGP: E2AB1DE4          |

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

  parent reply	other threads:[~2017-02-08 19:03 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-07 16:44 understanding disk space usage Vasco Visser
2017-02-08  3:48 ` Qu Wenruo
2017-02-08  9:55   ` Vasco Visser
2017-02-09  2:53     ` Qu Wenruo
2017-02-09 12:01       ` Vasco Visser
2017-02-08 14:46   ` Peter Grandi
2017-02-08 17:50     ` Austin S. Hemmelgarn
2017-02-08 21:45       ` Peter Grandi
2017-02-09 12:47         ` Austin S. Hemmelgarn
2017-02-08 18:03     ` Hugo Mills [this message]
2017-02-09 13:25   ` Adam Borowski
2017-02-09 17:53     ` Austin S. Hemmelgarn

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=20170208180311.GB4249@carfax.org.uk \
    --to=hugo@carfax.org.uk \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=pg@btrfs.list.sabi.co.UK \
    /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.