From: Marc Joliet <marcec@gmx.de>
To: linux-btrfs@vger.kernel.org
Subject: Re: ENOSPC errors during balance
Date: Sun, 20 Jul 2014 12:22:33 +0200 [thread overview]
Message-ID: <20140720122233.4ef06751@marcec> (raw)
In-Reply-To: <pan$c685d$4bb40507$f2be4604$15619074@cox.net>
[-- Attachment #1: Type: text/plain, Size: 5543 bytes --]
Am Sun, 20 Jul 2014 02:39:27 +0000 (UTC)
schrieb Duncan <1i5t5.duncan@cox.net>:
> Chris Murphy posted on Sat, 19 Jul 2014 11:38:08 -0600 as excerpted:
>
> > I'm not sure of the reason for the "BTRFS info (device sdg2): 2 enospc
> > errors during balance" but it seems informational rather than either a
> > warning or problem. I'd treat ext4->btrfs converted file systems to be
> > something of an odd duck, in that it's uncommon, therefore isn't getting
> > as much testing and extra caution is a good idea. Make frequent backups.
>
> Expanding on that a bit...
>
> Balance simply rewrites chunks, combining where possible and possibly
> converting to a different layout (single/dup/raid0/1/10/5/6[1]) in the
> process. The most common reason for enospc during balance is of course
> all space allocated to chunks, with various workarounds for that if it
> happens, but that doesn't seem to be what was happening to you
> (Mark J./OP).
>
> Based on very similar issues reported by another ext4 -> btrfs converter
> and the discussion on that thread, here's what I think happened:
>
> First a critical question for you as it's a critical piece of this
> scenario that you didn't mention in your summary. The wiki page on
> ext4 -> btrfs conversion suggests deleting the ext2_saved subvolume and
> then doing a full defrag and rebalance. You're attempting a full
> rebalance, but have you yet deleted ext2_saved and did you do the defrag
> before attempting the rebalance?
>
> I'm guessing not, as was the case with the other user that reported this
> issue. Here's what apparently happened in his case and how we fixed it:
Ah, I actually did, in fact. I only implicitly said it, though. Here's what I
wrote:
"After converting the backup partition about a week ago, following the wiki
entry on ext4 conversion, I eventually ran a full balance [...]"
The wiki says to run a full balance (and defragment before that, but that was
sloooooooow, so I didn't do it), *after* deleting the ext4 file system image.
So the full balance was right after doing that :) .
> The problem is that btrfs data chunks are 1 GiB each. Thus, the maximum
> size of a btrfs extent is 1 GiB. But ext4 doesn't have an arbitrary
> limitation on extent size, and for files over a GiB in size, ext4 extents
> can /also/ be over a GiB in size.
>
> That results in two potential issues at balance time. First, btrfs
> treats the ext2_saved subvolume as a read-only snapshot and won't touch
> it, thus keeping the ext* data intact in case the user wishes to rollback
> to ext*. I don't think btrfs touches that data during a balance either,
> as it really couldn't do so /safely/ without incorporating all of the
> ext* code into btrfs. I'm not sure how it expresses that situation, but
> it's quite possible that btrfs treats it as enospc.
>
> Second, for files that had ext4 extents greater than a GiB, balance will
> naturally enospc, because even the biggest possible btrfs extent, a full
> 1 GiB data chunk, is too small to hold the existing file extent. Of
> course this only happens on filesystems converted from ext*, because
> natively btrfs has no way to make an extent larger than a GiB, so it
> won't run into the problem if it was created natively instead of
> converted from ext*.
>
> Once the ext2_saved subvolume/snapshot is deleted, defragging should cure
> the problem as it rewrites those files to btrfs-native chunks, normally
> defragging but in this case fragging to the 1 GiB btrfs-native data-chunk-
> size extent size.
Hmm, well, I didn't defragment because it would have taken *forever* to go
through all those hardlinks, plus my experience is that ext* doesn't fragment
much at all, so I skipped that step. But I certainly have files over 1GB in
size.
On the other hand, the wiki [0] says that defragmentation (and balancing) is
optional, and the only reason stated for doing either is because they "will have
impact on performance".
> Alternatively, and this is what the other guy did, one can find all the
> files from the original ext*fs over a GiB in size, and move them off-
> filesystem and back AFAIK he had several gigs of spare RAM and no files
> larger than that, so he used tmpfs as the temporary storage location,
> which is memory so the only I/O is that on the btrfs in question. By
> doing that he deleted the existing files on btrfs and recreated them,
> naturally splitting the extents on data-chunk-boundaries as btrfs
> normally does, in the recreation.
>
> If you had deleted the ext2_saved subvolume/snapshot and done the defrag
> already, that explanation doesn't work as-is, but I'd still consider it
> an artifact from the conversion, and try the alternative move-off-
> filesystem-temporarily method.
I'll try this and see, but I think I have more files >1GB than would account
for this error (which comes towards the end of the balance when only a few
chunks are left). I'll see what "find /mnt -type f -size +1G" finds :) .
> If you don't have any files over a GiB in size, then I don't know...
> perhaps it's some other bug.
>
> ---
> [1] Raid5/6 support not yet complete. Operational code is there but
> recovery code is still incomplete.
[0] https://btrfs.wiki.kernel.org/index.php/Conversion_from_Ext3
Thanks
--
Marc Joliet
--
"People who think they know everything really annoy those of us who know we
don't" - Bjarne Stroustrup
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]
next prev parent reply other threads:[~2014-07-20 10:22 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-07-19 15:26 ENOSPC errors during balance Marc Joliet
2014-07-19 17:38 ` Chris Murphy
2014-07-19 21:06 ` Piotr Szymaniak
2014-07-20 2:39 ` Duncan
2014-07-20 10:22 ` Marc Joliet [this message]
2014-07-20 11:40 ` Marc Joliet
2014-07-20 19:44 ` Marc Joliet
2014-07-21 2:41 ` Duncan
2014-07-21 13:22 ` Marc Joliet
2014-07-21 22:30 ` Marc Joliet
2014-07-21 23:30 ` Marc Joliet
2014-07-22 3:26 ` Duncan
2014-07-22 7:37 ` Marc Joliet
2014-07-20 12:59 ` Duncan
2014-07-21 11:01 ` Brendan Hide
-- strict thread matches above, loose matches on Subject: below --
2014-07-19 20:10 Fw: " Marc Joliet
2014-07-19 20:58 ` Marc Joliet
2014-07-20 0:53 ` Chris Murphy
2014-07-20 9:50 ` Marc Joliet
2014-07-20 1:11 ` Chris Murphy
2014-07-20 9:48 ` Marc Joliet
2014-07-20 19:46 ` Marc Joliet
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=20140720122233.4ef06751@marcec \
--to=marcec@gmx.de \
--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;
as well as URLs for NNTP newsgroup(s).