Linux Btrfs filesystem development
 help / color / mirror / Atom feed
From: Qu Wenruo <quwenruo@cn.fujitsu.com>
To: Ivan Sizov <sivan606@gmail.com>
Cc: Chris Murphy <lists@colorremedies.com>,
	Btrfs BTRFS <linux-btrfs@vger.kernel.org>
Subject: Re: Will "btrfs check --repair" fix the mounting problem?
Date: Wed, 16 Dec 2015 08:40:21 +0800	[thread overview]
Message-ID: <5670B2F5.2010201@cn.fujitsu.com> (raw)
In-Reply-To: <CAMG9ccy_LKZeGRtPqffpXM8YD4NmDwAxyfr5iPz37j0+OjL4wg@mail.gmail.com>



Ivan Sizov wrote on 2015/12/15 09:34 +0000:
> 2015-12-15 1:42 GMT+00:00 Qu Wenruo <quwenruo@cn.fujitsu.com>:
>> You'll see output like the following:
>> Well block 29491200(gen: 5 level: 0) seems good, and it matches superblock
>> Well block 29376512(gen: 4 level: 0) seems good, but generation/level
>> doesn't match, want gen: 5 level: 0
>>
>> The match one is not what you're looking for.
>> Try the one whose generation is a little smaller than match one.
>>
>> Then use btrfsck to test if it's OK:
>> $ btrfsck -r <BYTENR> /dev/sda1
>>
>> Try 2~5 times with bytenr whose generation is near the match one.
>> If you're in good luck, you will find one doesn't crash btrfsck.
>>
>> And if that doesn't produce much error, then you can try btrfsck --repair -r
>> <BYTENR> to fix it and try mount.
>
> I've found a root that doesn't produce backtrace. But extent/chunk
> allocation errors was found:
>
> $ sudo btrfsck --tree-root 535461888 /dev/sda1
> parent transid verify failed on 535461888 wanted 21154 found 21150
> parent transid verify failed on 535461888 wanted 21154 found 21150
> Ignoring transid failure
> checking extents
> parent transid verify failed on 459292672 wanted 21148 found 21153
> parent transid verify failed on 459292672 wanted 21148 found 21153

Transid failure is OK.

> Ignoring transid failure
> bad block 459292672
> Errors found in extent allocation tree or chunk allocation
> parent transid verify failed on 459292672 wanted 21148 found 21153
>
> Should I ignore those errors and run btrfsck --repair? Or
> --init-extent-tree is needed?
>
Did it btrfsck has other complain?
And how is the generation difference between the one you're using and 
the one in superblock?

If the generation difference is larger than 1, I'd recommend not to run 
'--repair' nor '--init-extent-tree'

If the difference is only 1, and btrfsck doesn't report problems other 
than transid error, I'd like to try --repair or --init-extent-tree.

But there is *NO* guarantee and it may still make case worse.

Thanks,
Qu



      reply	other threads:[~2015-12-16  0:40 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-12-11 17:50 Will "btrfs check --repair" fix the mounting problem? Ivan Sizov
2015-12-11 18:24 ` Chris Murphy
2015-12-12 10:34   ` Ivan Sizov
2015-12-12 14:47     ` Henk Slager
2015-12-12 20:16     ` Chris Murphy
2015-12-12 20:33       ` Christoph Anton Mitterer
2015-12-13  6:51       ` Duncan
2015-12-14  2:28   ` Qu Wenruo
2015-12-14 17:55     ` Ivan Sizov
2015-12-15  1:42       ` Qu Wenruo
2015-12-15  9:34         ` Ivan Sizov
2015-12-16  0:40           ` Qu Wenruo [this message]

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=5670B2F5.2010201@cn.fujitsu.com \
    --to=quwenruo@cn.fujitsu.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=lists@colorremedies.com \
    --cc=sivan606@gmail.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