On Thu, Jan 09, 2014 at 11:26:26AM +0100, Clemens Eisserer wrote: > Hi, > > I am running write-intensive (well sort of, one write every 10s) > workloads on cheap flash media which proved to be horribly unreliable. > A 32GB microSDHC card reported bad blocks after 4 days, while a usb > pen drive returns bogus data without any warning at all. > > So I wonder, how would btrfs behave in raid1 on two such devices? > Would it simply mark bad blocks as "bad" and continue to be > operational, or will it bail out when some block can not be > read/written anymore on one of the two devices?
If a block is read and fails its checksum, then the other copy (in RAID-1) is checked and used if it's good. The bad copy is rewritten to use the good data. If the block is bad such that writing to it won't fix it, then there's probably two cases: the device returns an IO error, in which case I suspect (but can't be sure) that the FS will go read-only. Or the device silently fails the write and claims success, in which case you're back to the situation above of the block failing its checksum. There's no marking of bad blocks right now, and I don't know of anyone working on the feature, so the FS will probably keep going back to the bad blocks as it makes CoW copies for modification. Hugo. -- === Hugo Mills: hugo@... carfax.org.uk | darksatanic.net | lug.org.uk === PGP key: 65E74AC0 from wwwkeys.eu.pgp.net or http://www.carfax.org.uk --- Trouble rather the tiger in his lair than the sage amongst --- his books for to you kingdoms and their armies are mighty and enduring, but to him they are but toys of the moment to be overturned by the flicking of a finger.
signature.asc
Description: Digital signature