Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: "Holger Hoffstätte" <holger.hoffstaette@googlemail.com>
To: Marc MERLIN <marc@merlins.org>,
	"linux-btrfs@vger.kernel.org" <linux-btrfs@vger.kernel.org>
Subject: Re: Scrub: no spae left on device
Date: Tue, 8 Dec 2015 16:37:43 +0100	[thread overview]
Message-ID: <5666F947.5010902@googlemail.com> (raw)
In-Reply-To: <20151208150638.GL27889@merlins.org>

On 12/08/15 16:06, Marc MERLIN wrote:
> Howdy,
> 
> Why would scrub need space and why would it cancel if there isn't enough of
> it?
> (kernel 4.3)
> 
> /etc/cron.daily/btrfs-scrub:
> btrfs scrub start -Bd /dev/mapper/cryptroot
> scrub device /dev/mapper/cryptroot (id 1) done
> 	scrub started at Mon Dec  7 01:35:08 2015 and finished after 258 seconds
> 	total bytes scrubbed: 130.84GiB with 0 errors
> btrfs scrub start -Bd /dev/mapper/pool1
> ERROR: scrubbing /dev/mapper/pool1 failed for device id 1 (No space left on device)
> scrub device /dev/mapper/pool1 (id 1) canceled

Scrub rewrites metadata (apparently even in -r aka readonly mode), and that
can lead to temporary metadata expansion (stuff gets COWed around); it's
a bit surprising but makes sense if you think about it. The fact that you
ENOSPCed means that the fs was probably already fully allocated.

If it bothers you, a subsequent balance with -musage=10 should vacuum things
up. Alternatively just keep using the filesystem; eventually the empty metadata
chunks should be collected, on the next remount at the latest.

tl;dr: Never allocate all the chunks. Yes, this needs more graceful handling.

-h


  reply	other threads:[~2015-12-08 15:37 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-08 15:06 Scrub: no spae left on device Marc MERLIN
2015-12-08 15:37 ` Holger Hoffstätte [this message]
2015-12-08 15:46   ` Lionel Bouton
2015-12-08 16:02     ` Holger Hoffstätte
2015-12-08 16:06     ` Marc MERLIN
2015-12-08 16:24       ` Holger Hoffstätte
2015-12-08 16:39         ` Marc MERLIN
2015-12-09  6:46       ` Duncan
2015-12-08 15:39 ` Lionel Bouton
2015-12-08 16:00 ` 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=5666F947.5010902@googlemail.com \
    --to=holger.hoffstaette@googlemail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=marc@merlins.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