linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* btrfs check --repair: ERROR: cannot read chunk root
@ 2016-10-30 18:34 Marc MERLIN
  2016-10-31  1:02 ` Qu Wenruo
  0 siblings, 1 reply; 41+ messages in thread
From: Marc MERLIN @ 2016-10-30 18:34 UTC (permalink / raw)
  To: linux-btrfs

I have a filesystem on top of md raid5 that got a few problems due to the
underlying block layer (bad data cable).
The filesystem mounts fine, but had a few issues
Scrub runs (I didn't let it finish, it takes a _long_ time)
But check --repair won't even run at all:

myth:~# btrfs --version
btrfs-progs v4.7.3
myth:~# uname -r
4.8.5-ia32-20161028

myth:~# btrfs check -p --repair  /dev/mapper/crypt_bcache0  2>&1 | tee
/var/spool/repair
bytenr mismatch, want=13835462344704, have=0
ERROR: cannot read chunk root
Couldn't open file system
enabling repair mode
myth:~#

myth:~# btrfs rescue super-recover -v /dev//mapper/crypt_bcache0 
All Devices:
        Device: id = 1, name = /dev//mapper/crypt_bcache0

Before Recovering:
        [All good supers]:
                device name = /dev//mapper/crypt_bcache0
                superblock bytenr = 65536

                device name = /dev//mapper/crypt_bcache0
                superblock bytenr = 67108864

                device name = /dev//mapper/crypt_bcache0
                superblock bytenr = 274877906944

        [All bad supers]:

All supers are valid, no need to recover


I don't care about the data, it's a backup array, but I'd still like to know
if I can recover from this state and do a repair to see how much data got
damaged

Thanks,
Marc
-- 
"A mouse is a device used to point at the xterm you want to type in" - A.S.R.
Microsoft is to operating systems ....
                                      .... what McDonalds is to gourmet cooking
Home page: http://marc.merlins.org/  

^ permalink raw reply	[flat|nested] 41+ messages in thread
* btrfs check --repair: ERROR: cannot read chunk root
@ 2016-10-31  1:29 Janos Toth F.
  0 siblings, 0 replies; 41+ messages in thread
From: Janos Toth F. @ 2016-10-31  1:29 UTC (permalink / raw)
  To: Btrfs BTRFS

I stopped using Btrfs RAID-5 after encountering this problem two times
(once due to a failing SATA cable, once due to a random kernel problem
which caused the SATA or the block device driver to reset/crash).
As much as I can tell, the main problem is that after a de- and a
subsequent re-attach (on purpose or due to failing cable/controller,
kernel problem, etc), your de-synced disk is taken back to the "array"
as if it was still in sync despite having a lower generation counter.
The filesystem detects the errors later but it can't reliably handle,
let alone fully correct them. If you search on this list with "RAID 5"
you will see that RAID-5/6 scrub/repair has some known serious
problems (which probably contribute to this but I guess something on
top of those problems plays a part here to make this extra messy, like
the generations never getting synced). The de-synchronization will get
worse over time if your are in writable mode (the generation of the
de-synced disk is stuck), up to he point of the filesystem becoming
unmountable (if not already, probably due to scrub causing errors on
the disks in sync).
I was able to use "rescue" once and even achieve a read-only mount
during the second time (with only a handful of broken files). But I
could see a pattern and didn't want to end up in situations like that
for a third time.
Too bad, I would prefer RAID-5/6 over RAID-1/10 any day otherwise
(RAID-5 is faster than RAID-1 and you can loose any two disks from a
RAID-6, not just one from each mirrors on RAID-10) but most people
think it's slow and obsolete (I mean they say that about hardware or
mdadm RAID-5/6 and Btrfs's RAID-5/6 is frowned upon for true reasons)
while it's actually the opposite with a limited number of drives (<=6,
or may be up to 10).
It's not impossible to get right though, RAID-Z is nice (except the
inability to defrag the inevitable fragmentation), so I keep hoping...

^ permalink raw reply	[flat|nested] 41+ messages in thread

end of thread, other threads:[~2016-11-13 15:52 UTC | newest]

Thread overview: 41+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-10-30 18:34 btrfs check --repair: ERROR: cannot read chunk root Marc MERLIN
2016-10-31  1:02 ` Qu Wenruo
2016-10-31  2:06   ` Marc MERLIN
2016-10-31  4:21     ` Marc MERLIN
2016-10-31  5:27     ` Qu Wenruo
2016-10-31  5:47       ` Marc MERLIN
2016-10-31  6:04         ` Qu Wenruo
2016-10-31  6:25           ` Marc MERLIN
2016-10-31  6:32             ` Qu Wenruo
2016-10-31  6:37               ` Marc MERLIN
2016-10-31  7:04                 ` Qu Wenruo
2016-10-31  8:44                   ` Hugo Mills
2016-10-31 15:04                     ` Marc MERLIN
2016-11-01  3:48                       ` Marc MERLIN
2016-11-01  4:13                       ` Qu Wenruo
2016-11-01  4:21                         ` Marc MERLIN
2016-11-04  8:01                           ` Marc MERLIN
2016-11-04  9:00                             ` Roman Mamedov
2016-11-04 17:59                               ` Marc MERLIN
2016-11-07  1:11                             ` Qu Wenruo
     [not found]                               ` <87lgwwnnyf.fsf@notabene.neil.brown.name>
2016-11-07  1:20                                 ` clearing blocks wrongfully marked as bad if --update=no-bbl can't be used? Marc MERLIN
2016-11-07  1:39                                   ` Qu Wenruo
2016-11-07  4:18                                     ` Qu Wenruo
2016-11-07  5:36                                       ` btrfs support for filesystems >8TB on 32bit architectures Marc MERLIN
2016-11-07  6:16                                         ` Qu Wenruo
2016-11-07 14:55                                           ` Marc MERLIN
2016-11-08  0:35                                             ` Qu Wenruo
2016-11-08  0:39                                               ` Marc MERLIN
2016-11-08  0:43                                                 ` Qu Wenruo
2016-11-08  1:06                                                   ` Marc MERLIN
2016-11-08  1:17                                                     ` Qu Wenruo
2016-11-08 15:24                                                       ` Marc MERLIN
2016-11-09  1:50                                                         ` Qu Wenruo
2016-11-09  2:05                                                           ` Marc MERLIN
2016-11-11  3:48                                                             ` Marc MERLIN
2016-11-11  3:55                                                               ` Qu Wenruo
2016-11-12  3:17                                                                 ` when btrfs scrub reports errors and btrfs check --repair does not Marc MERLIN
2016-11-13 15:06                                                                   ` Marc MERLIN
2016-11-13 15:13                                                                     ` Roman Mamedov
2016-11-13 15:52                                                                       ` Marc MERLIN
  -- strict thread matches above, loose matches on Subject: below --
2016-10-31  1:29 btrfs check --repair: ERROR: cannot read chunk root Janos Toth F.

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).