* Will BTRFS repair or restore data if corrupted?
@ 2012-01-25 23:27 Waxhead
2012-01-26 7:19 ` Chester
2012-01-26 8:59 ` Hugo Mills
0 siblings, 2 replies; 7+ messages in thread
From: Waxhead @ 2012-01-25 23:27 UTC (permalink / raw)
To: linux-btrfs
Hi,
From what I have read BTRFS does replace a bad copy of data with a
known good copy (if it has one). Will BTRFS try to repair the corrupt
data or will it simply silently restore the data without the user
knowing that a file has been "fixed"?
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Will BTRFS repair or restore data if corrupted?
2012-01-25 23:27 Will BTRFS repair or restore data if corrupted? Waxhead
@ 2012-01-26 7:19 ` Chester
2012-01-26 8:59 ` Hugo Mills
1 sibling, 0 replies; 7+ messages in thread
From: Chester @ 2012-01-26 7:19 UTC (permalink / raw)
To: Waxhead; +Cc: linux-btrfs
On Wed, Jan 25, 2012 at 5:27 PM, Waxhead <waxhead@online.no> wrote:
> Hi,
>
> From what I have read BTRFS does replace a bad copy of data with a kn=
own
> good copy (if it has one). Will BTRFS try to repair the corrupt data =
or will
> it simply silently restore the data without the user knowing that a f=
ile has
> been "fixed"?
=46rom what I've seen, it'll quietly restore the data without the user
knowing. The only indication would be in dmesg where there should be a
message about incorrect checksums and btrfs fixing it automatically.
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs=
" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at =A0http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-btrfs" =
in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Will BTRFS repair or restore data if corrupted?
2012-01-25 23:27 Will BTRFS repair or restore data if corrupted? Waxhead
2012-01-26 7:19 ` Chester
@ 2012-01-26 8:59 ` Hugo Mills
2012-01-26 9:33 ` Stefan Behrens
1 sibling, 1 reply; 7+ messages in thread
From: Hugo Mills @ 2012-01-26 8:59 UTC (permalink / raw)
To: Waxhead; +Cc: linux-btrfs
[-- Attachment #1: Type: text/plain, Size: 849 bytes --]
On Thu, Jan 26, 2012 at 12:27:57AM +0100, Waxhead wrote:
> Hi,
>
> From what I have read BTRFS does replace a bad copy of data with a
> known good copy (if it has one).
Correct.
> Will BTRFS try to repair the corrupt data or will it simply silently
> restore the data without the user knowing that a file has been
> "fixed"?
No, it'll just return the good copy and report the failure in the
system logs. If you want to fix the corrupt data, you need to use
scrub, which will check everything and fix blocks with failed
checksums.
Hugo.
--
=== Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk ===
PGP key: 515C238D from wwwkeys.eu.pgp.net or http://www.carfax.org.uk
--- ... one ping(1) to rule them all, and in the ---
darkness bind(2) them.
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 190 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Will BTRFS repair or restore data if corrupted?
2012-01-26 8:59 ` Hugo Mills
@ 2012-01-26 9:33 ` Stefan Behrens
2012-01-26 19:16 ` Zoiled
0 siblings, 1 reply; 7+ messages in thread
From: Stefan Behrens @ 2012-01-26 9:33 UTC (permalink / raw)
To: Hugo Mills, Waxhead, linux-btrfs
On 1/26/2012 9:59 AM, Hugo Mills wrote:
> On Thu, Jan 26, 2012 at 12:27:57AM +0100, Waxhead wrote:
[...]
>> Will BTRFS try to repair the corrupt data or will it simply silently
>> restore the data without the user knowing that a file has been
>> "fixed"?
>
> No, it'll just return the good copy and report the failure in the
> system logs. If you want to fix the corrupt data, you need to use
> scrub, which will check everything and fix blocks with failed
> checksums.
Since 3.2, btrfs rewrites the corrupt disk block (commit 4a54c8c and
f4a8e65 from Jan Schmidt), even without scrub.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Will BTRFS repair or restore data if corrupted?
2012-01-26 9:33 ` Stefan Behrens
@ 2012-01-26 19:16 ` Zoiled
2012-01-26 20:22 ` cwillu
0 siblings, 1 reply; 7+ messages in thread
From: Zoiled @ 2012-01-26 19:16 UTC (permalink / raw)
To: Stefan Behrens; +Cc: Hugo Mills, Waxhead, linux-btrfs
Stefan Behrens wrote:
> On 1/26/2012 9:59 AM, Hugo Mills wrote:
>> On Thu, Jan 26, 2012 at 12:27:57AM +0100, Waxhead wrote:
> [...]
>>> Will BTRFS try to repair the corrupt data or will it simply silently
>>> restore the data without the user knowing that a file has been
>>> "fixed"?
>> No, it'll just return the good copy and report the failure in the
>> system logs. If you want to fix the corrupt data, you need to use
>> scrub, which will check everything and fix blocks with failed
>> checksums.
> Since 3.2, btrfs rewrites the corrupt disk block (commit 4a54c8c and
> f4a8e65 from Jan Schmidt), even without scrub.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
So if I for example edit a text file three times and store it I can get
the following.
Version1: I currently like cheese
Version2: I currently like onions
Version3: I currently like apples
As far as I understand a disk corruption might result in me suddenly
liking onions (or even cheese) instead of apples without any warning
except in syslog.?! I really hope I have misunderstood the concept and
that there is some error correction codes somewhere.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Will BTRFS repair or restore data if corrupted?
2012-01-26 19:16 ` Zoiled
@ 2012-01-26 20:22 ` cwillu
2012-01-26 20:27 ` Zoiled
0 siblings, 1 reply; 7+ messages in thread
From: cwillu @ 2012-01-26 20:22 UTC (permalink / raw)
To: Zoiled; +Cc: Stefan Behrens, Hugo Mills, Waxhead, linux-btrfs
> So if I for example edit a text file three times and store it I can get the
> following.
> Version1: I currently like cheese
> Version2: I currently like onions
> Version3: I currently like apples
> As far as I understand a disk corruption might result in me suddenly liking
> onions (or even cheese) instead of apples without any warning except in
> syslog.?! I really hope I have misunderstood the concept and that there is
> some error correction codes somewhere.
Yes, you've completely misunderstood the concept :p
There are crc's on each 4k block of data; if one copy fails the
checksum, and a second copy is available, and that copy does match,
then the good data will be returned and btrfs will overwrite the
corrupted copy with the good copy. If there isn't another copy, then
an io error will be returned instead.
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: Will BTRFS repair or restore data if corrupted?
2012-01-26 20:22 ` cwillu
@ 2012-01-26 20:27 ` Zoiled
0 siblings, 0 replies; 7+ messages in thread
From: Zoiled @ 2012-01-26 20:27 UTC (permalink / raw)
To: cwillu; +Cc: Stefan Behrens, Hugo Mills, Waxhead, linux-btrfs
cwillu wrote:
>> So if I for example edit a text file three times and store it I can get the
>> following.
>> Version1: I currently like cheese
>> Version2: I currently like onions
>> Version3: I currently like apples
>> As far as I understand a disk corruption might result in me suddenly liking
>> onions (or even cheese) instead of apples without any warning except in
>> syslog.?! I really hope I have misunderstood the concept and that there is
>> some error correction codes somewhere.
> Yes, you've completely misunderstood the concept :p
>
> There are crc's on each 4k block of data; if one copy fails the
> checksum, and a second copy is available, and that copy does match,
> then the good data will be returned and btrfs will overwrite the
> corrupted copy with the good copy. If there isn't another copy, then
> an io error will be returned instead.
> --
> To unsubscribe from this list: send the line "unsubscribe linux-btrfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
>
>
>
Phew... that sounds better :)
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2012-01-26 20:27 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-25 23:27 Will BTRFS repair or restore data if corrupted? Waxhead
2012-01-26 7:19 ` Chester
2012-01-26 8:59 ` Hugo Mills
2012-01-26 9:33 ` Stefan Behrens
2012-01-26 19:16 ` Zoiled
2012-01-26 20:22 ` cwillu
2012-01-26 20:27 ` Zoiled
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).