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"? -- 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
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 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"?From 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 http://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
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.
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
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. -- 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.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
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 :) -- 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