All of lore.kernel.org
 help / color / mirror / Atom feed
* csum failed : d-raid0, m-raid1
@ 2016-01-29 18:04 John Smith
  2016-01-29 18:13 ` John Smith
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: John Smith @ 2016-01-29 18:04 UTC (permalink / raw)
  To: linux-btrfs

Hi

i built btrfs volume using 2x3tb brand new /tested for badblocks
drives. I copied into volume around 5Tb of data.

I tried to read one file which is around 4GB and i got input / output error.

Dmesg contains:

[154159.040059] BTRFS warning (device sdd): csum failed ino 9995246
off 4506214400 csum 383964635 expected csum 6478505


Any idea what is it? Whats the reason that this happened? Can I recover?


Thank you!

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

* Re: csum failed : d-raid0, m-raid1
  2016-01-29 18:04 csum failed : d-raid0, m-raid1 John Smith
@ 2016-01-29 18:13 ` John Smith
  2016-01-29 20:26 ` Chris Murphy
  2016-01-30  5:58 ` Duncan
  2 siblings, 0 replies; 4+ messages in thread
From: John Smith @ 2016-01-29 18:13 UTC (permalink / raw)
  To: linux-btrfs

the out of the smartctl of both drives is here :

https://drive.google.com/folderview?id=0B6RZ_9vVuTEcRnFfRzhGZEdWSjA&usp=sharing



thanks

On Fri, Jan 29, 2016 at 7:04 PM, John Smith <lenovomi@gmail.com> wrote:
> Hi
>
> i built btrfs volume using 2x3tb brand new /tested for badblocks
> drives. I copied into volume around 5Tb of data.
>
> I tried to read one file which is around 4GB and i got input / output error.
>
> Dmesg contains:
>
> [154159.040059] BTRFS warning (device sdd): csum failed ino 9995246
> off 4506214400 csum 383964635 expected csum 6478505
>
>
> Any idea what is it? Whats the reason that this happened? Can I recover?
>
>
> Thank you!

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

* Re: csum failed : d-raid0, m-raid1
  2016-01-29 18:04 csum failed : d-raid0, m-raid1 John Smith
  2016-01-29 18:13 ` John Smith
@ 2016-01-29 20:26 ` Chris Murphy
  2016-01-30  5:58 ` Duncan
  2 siblings, 0 replies; 4+ messages in thread
From: Chris Murphy @ 2016-01-29 20:26 UTC (permalink / raw)
  To: John Smith; +Cc: Btrfs BTRFS

On Fri, Jan 29, 2016 at 11:04 AM, John Smith <lenovomi@gmail.com> wrote:
> Hi
>
> i built btrfs volume using 2x3tb brand new /tested for badblocks
> drives. I copied into volume around 5Tb of data.
>
> I tried to read one file which is around 4GB and i got input / output error.
>
> Dmesg contains:
>
> [154159.040059] BTRFS warning (device sdd): csum failed ino 9995246
> off 4506214400 csum 383964635 expected csum 6478505
>
>
> Any idea what is it? Whats the reason that this happened? Can I recover?

You haven't provided enough info to really answer the first two
questions. That this is raid1 for metadata and you're getting a
checksum error without a fixup says this is a problem with a data
block not checksumming. Why? Need a complete dmesg to see what else
was going on. Even that won't necessarily answer the question. Could
be silent corruption anywhere in the chain, and may not be caused by
the drives themselves. Could be a connector. Could be a controller.
Could be RAM. Could be a bug (seems sorta unlikely at this point but
we don't know what kernel or btrfs-progs version you're using).

As far as I know you can't recover the affected file(s)
conventionally, Btrfs won't hand over data it thinks id corrupt. You
can use find <mountpoint> -inum <value> to find files with that inode
number. Unmount the file system. Then use btrfs restore to get the
file. The man page has more info including a wiki document on how to
use restore.



-- 
Chris Murphy

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

* Re: csum failed : d-raid0, m-raid1
  2016-01-29 18:04 csum failed : d-raid0, m-raid1 John Smith
  2016-01-29 18:13 ` John Smith
  2016-01-29 20:26 ` Chris Murphy
@ 2016-01-30  5:58 ` Duncan
  2 siblings, 0 replies; 4+ messages in thread
From: Duncan @ 2016-01-30  5:58 UTC (permalink / raw)
  To: linux-btrfs

John Smith posted on Fri, 29 Jan 2016 19:04:42 +0100 as excerpted:

> Hi
> 
> i built btrfs volume using 2x3tb brand new /tested for badblocks drives.
> I copied into volume around 5Tb of data.
> 
> I tried to read one file which is around 4GB and i got input / output
> error.
> 
> Dmesg contains:
> 
> [154159.040059] BTRFS warning (device sdd): csum failed ino 9995246 off
> 4506214400 csum 383964635 expected csum 6478505
> 
> 
> Any idea what is it? Whats the reason that this happened? Can I recover?

Btrfs crc32c-checksums all blocks on write, both data (except for data 
written while mounted nodatasum and nocow attribute files) and metadata 
(always), and verifies the checksum on read.

The read-time csum verification failed on the block at that address of 
the file, and as your data is raid0, there's no second copy to fall back 
on as there would be for raid1 data and no parity data available to try 
to rebuild from as there'd be for raid56 data, so the file can only be 
read upto that point, and if you skip that block, and there are no 
further checksum failures, beyond that point, to the end of the file.

Of course the sysadmin's first rule of backups, in simplest form, is that 
if you don't have at least one backup, you are by your failure to backup 
defining the value of the data as less than the value of the time/hassle/
resources you'd otherwise spend making that backup, so you either have a 
backup to fallback to, or you're data is self-defined by that lack of a 
backup as of only trivial value not worth the trouble.

And of course, btrfs, while stabilizING, isn't yet considered fully 
stable and mature, so that sysadmin's rule of backups applies to an even 
stronger degree than it does to fully stable and mature filesystems.

As a result, for recovery, you can either fall back to the backup, 
rewriting the file from backup to the btrfs in question, or by action you 
defined the data as too trivial to be worth backing up, so you can simply 
delete the file in question and not worry about it.

The question then becomes one of finding out what file is involved, in 
ordered to either delete it or recover it from backup.  Keep in mind that 
unlike most filesystems, inode numbers on btrfs are subvolume-specific, 
so it's possible to have multiple inodes with the same inode number on 
the filesystem, if you have multiple subvolumes.  Thus, it's not as 
simple as looking up what file that inode corresponds to, unless of 
course you have only the primary/root subvolume, no others.

There are two ways to find what file corresponds to that inode on that 
subvolume.  One involves use of the btrfs debugging tools and is targeted 
at devs.  While I know this is possible and I've seen the method posted, 
I'm not a dev, only a btrfs user and list regular, and I've not kept 
track of the specifics, so I won't attempt to describe them further here.

The other one is btrfs scrub, which will systematically verify all 
checksums on the filesystem, repairing errors where it's possible 
(metadata in your case as it's raid1, assuming of course that the second 
copy of the block isn't also bad), reporting those which it can't (the 
raid0 data).  Where it can't fix the problem dmesg should contain the 
file with the problem (unless it's metadata and thus not a file, of 
course).

Of course on 5 TB of data, scrub's going to take awhile... likely over a 
day and possibly two (5 TiB of data at 30 MiB/sec is about 48 hours, 30 
MiB/sec might be a bit pessimistically slow but isn't out of real-world 
range on spinning rust).  Even on relatively fast (for spinning rust) 
drives, 100 MiB/sec, you're looking at 14 hours...

Tho because scrub checksum-verifies all blocks, it'll cover any problems 
in other files and in metadata too, not just the one file.

FWIW, maintenance time is one of several reasons I use multiple smaller 
btrfs on partitioned up devices, here, instead of a single huge multi-TB 
btrfs.  My btrfs are also all raid1 both data and metadata, save for 
/boot (and its backup on the other device) which are both mixed-mode dup, 
two copies on the same device, so there's always that second copy to pull 
from to repair the failed one, if something fails checksum verification.  
They also happen to be on SSD, with the largest btrfs on a pair of 24 GiB 
partitions.  As such, scrubs, balances, checks, etc, all take under 10 
minutes per filesystem, with scrubs often complete in under a minute, 
instead of the day or longer it's likely to take you for 5 TiB on 
spinning rust.  Of course I have more btrfs and it'd take me somewhat 
longer than that minute to do just one, say a half hour, to scrub them 
all, but some of them aren't even routinely mounted, and my 8 GiB (per 
device, two devices) btrfs raid1 / is mounted read-only by default, so it 
too is unlikely to be damaged.  As such, generally only 2-3 btrfs need 
scrubbed at once and often it's only 1-2, and on fast SSD, I'm done in 
under 5 minutes.  /Much/ more feasible maintenance time than several 
/days/! =:^)

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


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

end of thread, other threads:[~2016-01-30  5:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-29 18:04 csum failed : d-raid0, m-raid1 John Smith
2016-01-29 18:13 ` John Smith
2016-01-29 20:26 ` Chris Murphy
2016-01-30  5:58 ` Duncan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.