From: Duncan <1i5t5.duncan@cox.net>
To: linux-btrfs@vger.kernel.org
Subject: Re: Error while balance after convert from ext4
Date: Wed, 8 Jul 2015 00:18:59 +0000 (UTC) [thread overview]
Message-ID: <pan$2e38c$aafcae5e$5b1bff88$546fb2b@cox.net> (raw)
In-Reply-To: CAFdkf7Pqkjf=H11LaGQusDE_OT3zK1civwrHWeqmTS27uB4FPA@mail.gmail.com
Николай Овчинников posted on Wed, 08 Jul 2015 00:46:48 +0300 as excerpted:
> While balancing after succsecful converting from ext4 filesystem moved
> into read-only mode and balance aborted.
> Before balance df says about 6Gb freespace.
> Now filesystem can be mounted only in recovery mode with 1 dir and about
> 20 zero-sized files.
> Is there a chance to recover these files?
FWIW, there have been several other reports of conversion not going so
well recently. The opinion of at least some users is that apparently,
btrfs has moved on from where it was when the conversion tool was built,
and the conversion tool hasn't kept up, causing problems with the
conversion in more cases, recently. (FWIW, I've never particularly
trusted filesystem conversion tools in the first place. As such, I
always had a strong preference for doing a fresh mkfs, then copying
things over from the old filesystem. That way, the old filesystem
becomes the backup you're restoring to a fresh filesystem from, and it
remains a backup, in case there are issues with the new filesystem, as
well as for all the other reasons, including fat-fingering, that valuing
the data is in practice defined as having a backup.)
Meanwhile, to answer your question, yes, the files can be recovered from
the backups you had if you valued the data. If you didn't have them, the
data obviously wasn't important, and you simply had a bit of help
clearing your cache of unimportant junk-files. =:^)
Seriously, the sysadmin's standard backup rule states that if you don't
have a backup, by definition, you value the data less than the time and
resources necessary to create the backup, no matter any claims to the
contrary. Further, for purposes of this rule a would-be backup that
hasn't been tested restorable isn't yet a backup as a backup isn't
complete until it's tested.
Of course, the fact that btrfs isn't yet fully stable means the rule
applies double, compared to its normal application to a fully stable
filesystem.
And of course, converting a filesystem without a backup is also something
that by definition is never done with data you actually care about, so at
/least/ double again (if not 4X on its own).
Which means the rule applied at 4X-8X strength. You REALLY had a backup
(and at 4-8X strength, probably more than one), or REALLY don't care
about the data.
But, there does remain a glimmer of hope in case you had no backup.
There's the btrfs restore tool you can try. I'm not sure how well it'll
work on an incompletely rebalanced after convert filesystem, but it's
worth a try. You will need somewhere else to store the restored files,
since it works with an unmounted filesystem without writing to it (so at
least it can't make the problem worse). If restore can't find a usable
root on its own, you can try using btrfs-find-root, and feed that (or
rather the corresponding bytenr) to btrfs restore using the -t option.
There's a somewhat dated but still useful writeup on the wiki about it.
https://btrfs.wiki.kernel.org/index.php/Restore
Note that generation and tranaction-id (transid) are different words for
the same thing, btrfs restore -t <bytenr> -l lists the various subtree
roots available from that root (the part of the writeup where it says
select the root with the most available trees in it), there's now a -D
dry-run option that will let you get at least some idea how many files
can be restored, and that the new -m (metadata, ownership/perms info) and
-S (symlinks) options allow restoring these, as they won't be restored by
default.
Again, I'm not sure how well restore will do with a fresh conversion
where the balance died like that, but it's worth a shot, and has a couple
times restored newer versions of files than my backups had, working well
for me, tho with a filesystem that was btrfs all along, not converted.
--
Duncan - List replies preferred. No HTML msgs.
"Every nonfree program has a lord, a master --
and if you use the program, he is your master." Richard Stallman
next prev parent reply other threads:[~2015-07-08 0:19 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-07-07 21:46 Error while balance after convert from ext4 Николай Овчинников
2015-07-08 0:18 ` Duncan [this message]
2015-07-08 13:56 ` Chris Murphy
2015-07-08 19:38 ` Николай Овчинников
2015-07-08 23:32 ` Duncan
2015-07-08 23:58 ` Николай Овчинников
2015-07-09 0:37 ` Chris Murphy
2015-07-09 1:55 ` Chris Murphy
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='pan$2e38c$aafcae5e$5b1bff88$546fb2b@cox.net' \
--to=1i5t5.duncan@cox.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