linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Russell Coker <russell@coker.com.au>
To: Peter Waller <peter@scraperwiki.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: ENOSPC with mkdir and rename
Date: Tue, 05 Aug 2014 00:47:21 +1000	[thread overview]
Message-ID: <6493655.Zcj5VSyTA2@xev> (raw)
In-Reply-To: <CAFChkqv3N27jWxL=URgkZ1G86BFBo+-Cmg9emOO3G80OKY2n4g@mail.gmail.com>

On Mon, 4 Aug 2014 14:17:02 Peter Waller wrote:
> For anyone else having this problem, this article is fairly useful for
> understanding disk full problems and rebalance:
> 
> http://marc.merlins.org/perso/btrfs/post_2014-05-04_Fixing-Btrfs-Filesystem-> Full-Problems.html
> 
> It actually covers the problem that I had, which is that a rebalance
> can't take place because it is full.
> 
> I still am unsure what is really wrong with this whole situation. Is
> it that I wasn't careful to do a rebalance when I should have been
> doing? Is it that BTRFS doesn't do a rebalance automatically when it
> could in principle?

Yes and yes.  The fact that BTRFS can't avoid getting into such situations and 
can't recover when it does are both bugs in BTRFS.  The fact that you didn't 
run a balance to prevent this is due to not being careful enough with a 
filesystem that's still in a development stage.

> It's pretty bad to end up in a situation (with spare space) where the
> only way out is to add more storage, which may be impractical,
> difficult or expensive.

Absolutely.

> I conclude that now since I have added more storage, the rebalance
> won't fail and if I keep rebalancing from a cron job I won't hit this
> problem again

Yes.

> (unless the filesystem fills up very fast! what then?).
> I don't know however what value to assign to `-dusage` in general for
> the cron rebalance. Any hints?

If you regularly run a scrub with options such as "-dusage=50 -musage=10" then 
the amount of free space in metadata chunks will tend to be a lot greater than 
that in data chunks.

Another option I've considered is to write a program that creates millions of 
files with 1000 byte random file names.  After creating a filesystem I could 
run that program to cause a sufficient number of metadata chunks to be 
allocated and then remove the subvol containing all those files (which 
incidentally is a lot faster than "rm -rf").

Another thing I've considered is making a filesystem for a file server with a 
RAID-1 array of SSDs and running the above program to allocate all chunks for 
metadata.  Then when the SSDs are totally assigned to metadata I would add a 
pair of SATA disks for data.  A filesystem with all metadata on SSD and all 
data on SATA disks should give great performance as well as having lots of 
space.

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


  parent reply	other threads:[~2014-08-04 14:47 UTC|newest]

Thread overview: 44+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-02 23:35 ENOSPC with mkdir and rename Peter Waller
2014-08-03  0:28 ` Mitch Harder
2014-08-03  1:52   ` Nick Krause
2014-08-03  2:39 ` Russell Coker
2014-08-03  2:59   ` Nick Krause
2014-08-04  1:38 ` Qu Wenruo
2014-08-04  8:14   ` Peter Waller
2014-08-04  9:22     ` Clemens Eisserer
2014-08-04  9:39     ` Chris Samuel
2014-08-04  9:56       ` Clemens Eisserer
2014-08-04 10:24         ` Chris Samuel
2014-08-05  8:06           ` Duncan
2014-08-05 12:20             ` Russell Coker
2014-08-05 12:58               ` Clemens Eisserer
2014-08-05 13:02                 ` Peter Waller
2014-08-10 17:21                 ` Martin Steigerwald
2014-08-05 13:36               ` Chris Samuel
2014-08-06  0:04               ` Duncan
2014-08-06  0:38               ` ronnie sahlberg
2014-08-06  1:18                 ` Nick Krause
2014-08-04 10:09       ` Peter Waller
2014-08-04 10:22         ` Hugo Mills
2014-08-04 10:31           ` Peter Waller
2014-08-04 10:39             ` Hugo Mills
2014-08-04 10:48               ` Peter Waller
2014-08-04 11:29                 ` Hugo Mills
2014-08-04 17:09             ` Austin S Hemmelgarn
2014-08-05  8:20               ` Duncan
2014-08-05 11:31                 ` Austin S Hemmelgarn
2014-08-04 11:04           ` Clemens Eisserer
2014-08-04 11:32             ` Hugo Mills
2014-08-04 13:17               ` Peter Waller
2014-08-04 13:35                 ` Hugo Mills
2014-08-04 14:02                 ` Austin S Hemmelgarn
2014-08-04 14:11                   ` Peter Waller
2014-08-04 14:26                     ` Austin S Hemmelgarn
2014-08-04 14:47                 ` Russell Coker [this message]
2014-08-04 15:19                   ` Mitch Harder
2014-08-04 10:50         ` Chris Samuel
2014-08-04 10:59           ` Peter Waller
2014-08-04 21:27             ` Chris Samuel
2014-08-10 17:26         ` Martin Steigerwald
2014-08-05  8:51     ` Qu Wenruo
2014-08-05 12:17       ` Russell Coker

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=6493655.Zcj5VSyTA2@xev \
    --to=russell@coker.com.au \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=peter@scraperwiki.com \
    /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;
as well as URLs for NNTP newsgroup(s).