linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Chiung-Ming Huang <photon3108@gmail.com>
To: Qu Wenruo <quwenruo.btrfs@gmx.com>
Cc: linux-btrfs@vger.kernel.org
Subject: Re: How to Fix 'Error: could not find extent items for root 257'?
Date: Wed, 5 Feb 2020 23:29:08 +0800	[thread overview]
Message-ID: <CAEOGEKE6m=n1JTfFqBy33D9n1WFTjuuyQ_q+X=jF7+tNCYsLfg@mail.gmail.com> (raw)
In-Reply-To: <6cea6393-1bb0-505e-b311-bff4a818c71b@gmx.com>

Hi Qu Wenruo

Thanks for your reply and help.

Qu Wenruo <quwenruo.btrfs@gmx.com> 於 2020年2月5日 週三 下午6:29寫道: server ~$
Decrypted by /etc/crypttab
server ~$ mkfs.btrfs -m raid1 -d raid1 /dev/bcache0 /dev/bcache1
/dev/bcache2 /dev/bcache3 /dev/bcache4
server ~$ mount -o subvol=@defaults,degraded,nossd,subvol /dev/bcache4
/ (By /etc/fstab)
server ~$ reboot
server ~$ btrfs balance start /
server ~$ btrfs fi usage /
^^^^^^^^^^^^^ Only /dev/sdc (3T), /dev/sdd (10T), /dev/sdf (10T) have
data. The first two don't have any data and the last one have a mirror
copy of RAID1.
server ~$ Removed /dev/sda (1T), /dev/sde (2T), /dev/sdd (10T) from
/etc/crypttab
server ~$ reboot
server ~$ btrfs fi show
^^^^^^^^^^^^ /dev/sda (1T), /dev/sde (2T), /dev/sdd (10T) are marked `missing`
server ~$ btrfs balance start -f -sconvert=single -mconvert=single
-dconvert=single /
server ~$ btrfs balance cancel /
server ~$ reboot
server ~$ Put luks on bcache and mkfs.btrfs /dev/sda (1T)
server ~$ Put luks on bcache and mkfs.btrfs /dev/sde (2T)
server ~$ Forgot to do it on /dev/sdd (10T)
server ~$ btrfs device remove missing
^^^^^^^^^^^^ Executed about 5 seconds. (Becasue /dev/sda (1T) is empty?)
server ~$ btrfs device remove missing
^^^^^^^^^^^^ Executed about 5 seconds. (Becasue /dev/sde (2T) is empty?)
server ~$ btrfs device remove missing
^^^^^^^^^^^^ Executed at least 12 hours before power-off accidentally.

[Change to the independent rescue OS.]
rescue ~$ Add /dev/sda (1T), /dev/sde (2T), /dev/sdd (10T) back to
/etc/crypttab. And /dev/sdd (10T) still keep the mirror copy of RAID1
before removing it from /etc/crypttab.
rescue ~$ reboot
rescue ~$ btrfs check -p --repair /dev/bcache4
^^^^^^^^^^^ failed
rescue ~$ mount /dev/bcache4 /mnt
rescue ~$ btrfs check --repair /dev/bcache4
^^^^^^^^^^ [4/7] ...
Errors ....... fs root
rescue ~$ btrfs scrub start -B /mnt
^^^^^^^^^^ Showed a lot of errors and I can't ctrl+alt+3. So I rebooted.
rescue ~$ btrfs check --repair /dev/bcache4
^^^^^^^^^^ [1/7] checking root items
Error: could not find extent items for root 257
ERROR: failed to repair root items: No such file or directory



> ...
> >
> > 7. $ btrfs check -p /dev/bcache4
> > Opening filesystem to check...
> > Checking filesystem on /dev/bcache4
> > UUID: 0b79cf54-c424-40ed-adca-bd66b38ad57a
> > Error: could not find extent items for root 257(0:00:00 elapsed, 1199
> > items checked)
> > [1/7] checking root items                      (0:00:00 elapsed, 7748
> > items checked)
> > ERROR: failed to repair root items: No such file or directory
>
> Have you tried btrfs check --repair then mount?

Yes.

> Is that mentioned dmesg the first time you hit, not something after

I keep kern.log but it's about 17M. I cannot post it here. And It
doesn't show `btrfs command` in the context.
A lot of `BTRFS critical` and `BTRFS error` are there but `BTRFS
critical` repeated.

Feb  3 15:38:24 rescue kernel: [ 8731.172674] BTRFS critical (device
bcache2): corrupt leaf: root=23146 block=19498503094272 slot=8,
invalid key objectid: has 18446744073709551606 expect 6 or [256,
18446744073709551360] or 18446744073709551604
Feb  3 15:38:24 rescue kernel: [ 8731.172860] BTRFS critical (device
bcache2): corrupt leaf: root=23146 block=19498503094272 slot=8,
invalid key objectid: has 18446744073709551606 expect 6 or [256,
18446744073709551360] or 18446744073709551604
Feb  3 20:19:42 rescue kernel: [25609.592216] BTRFS critical (device
bcache2): corrupt leaf: root=23146 block=19498503094272 slot=8,
invalid key objectid: has 18446744073709551606 expect 6 or [256,
18446744073709551360] or 18446744073709551604
Feb  3 20:19:42 rescue kernel: [25609.592511] BTRFS critical (device
bcache2): corrupt leaf: root=23146 block=19498503094272 slot=8,
invalid key objectid: has 18446744073709551606 expect 6 or [256,
18446744073709551360] or 18446744073709551604
Feb  5 17:05:58 rescue kernel: [ 3601.738469] BTRFS critical (device
bcache2): unable to find logical 7157918187520 length 4096
Feb  5 17:05:58 rescue kernel: [ 3601.738474] BTRFS critical (device
bcache2): unable to find logical 7157918187520 length 4096
Feb  5 17:05:58 rescue kernel: [ 3601.738481] BTRFS critical (device
bcache2): unable to find logical 7157918187520 length 16384
Feb  5 17:05:58 rescue kernel: [ 3601.738531] BTRFS critical (device
bcache2): unable to find logical 7157918187520 length 4096
Feb  5 17:05:58 rescue kernel: [ 3601.738533] BTRFS critical (device
bcache2): unable to find logical 7157918187520 length 4096
Feb  5 17:05:58 rescue kernel: [ 3601.738539] BTRFS critical (device
bcache2): unable to find logical 7157918187520 length 16384
.... (repeated 4096, 4096, 16384 these three lines)

> btrfs check --repair?
>
> And `btrfs check` without --repair please, that's the most important
> info to evaluate how to fix it (if possible).

rescue ~$ btrfs check /dev/bcache4
Opening filesystem to check...
Checking filesystem on /dev/bcache4
UUID: 0b79cf54-c424-40ed-adca-bd66b38ad57a
[1/7] checking root items
Error: could not find extent items for root 257
ERROR: failed to repair root items: No such file or directory

rescue ~$ btrfs check --repair /dev/bcache4
enabling repair mode
WARNING:

        Do not use --repair unless you are advised to do so by a developer
        or an experienced user, and then only after having accepted that no
        fsck can successfully repair all types of filesystem corruption. Eg.
        some software or hardware bugs can fatally damage a volume.
        The operation will start in 10 seconds.
        Use Ctrl-C to stop it.
10 9 8 7 6 5 4 3 2 1
Starting repair.
Opening filesystem to check...
Checking filesystem on /dev/bcache4
UUID: 0b79cf54-c424-40ed-adca-bd66b38ad57a
[1/7] checking root items
Error: could not find extent items for root 257
ERROR: failed to repair root items: No such file or directory
rescue ~$

> Thanks,
> Qu

Regards,
Chiung-Ming Huang

  reply	other threads:[~2020-02-05 15:29 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-05 10:18 How to Fix 'Error: could not find extent items for root 257'? Chiung-Ming Huang
2020-02-05 10:29 ` Qu Wenruo
2020-02-05 15:29   ` Chiung-Ming Huang [this message]
2020-02-05 19:38     ` Chris Murphy
2020-02-06  3:11       ` Chiung-Ming Huang
     [not found]   ` <CAEOGEKHf9F0VM=au-42MwD63_V8RwtqiskV0LsGpq-c=J_qyPg@mail.gmail.com>
     [not found]     ` <f2ad6b4f-b011-8954-77e1-5162c84f7c1f@gmx.com>
2020-02-06  4:13       ` Chiung-Ming Huang
2020-02-06  4:35         ` Qu Wenruo
2020-02-06  6:50           ` Chiung-Ming Huang
2020-02-07  3:49           ` Chiung-Ming Huang
2020-02-07  4:00             ` Qu Wenruo
2020-02-07  6:16               ` Chiung-Ming Huang
2020-02-07  7:16                 ` Qu Wenruo
2020-02-10  6:50                   ` Chiung-Ming Huang
2020-02-10  7:03                     ` Qu Wenruo
2020-02-15  3:47                       ` Chiung-Ming Huang
2020-02-15  4:29                         ` Qu Wenruo

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='CAEOGEKE6m=n1JTfFqBy33D9n1WFTjuuyQ_q+X=jF7+tNCYsLfg@mail.gmail.com' \
    --to=photon3108@gmail.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=quwenruo.btrfs@gmx.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).