
Quoting "Avi Miller" <avi.miller@gmail.com>:
Hi,
On 14/02/2012, at 11:44 AM, Toby Corkindale wrote:
Can you explain the failure modes for when a block checksum fails when you have data on a single disk?
You would get a checksum failure reading that block.
Essentially I was wondering whether you'd lose an entire file (or extent of a file) if the checksum fails, or whether you could still access the rest of the file but with just one block missing in the event of a bad sector.
You wouldn't lose the entire file. btrfs is copy-on-write, so best case scenario, you could walk backwards through the tree to find a previous copy of the same block and read that, assuming the faulty block hasn't changed. If you manage to break the latest copy and the previous block is different, you may have to step back to previous data for that block. The "recover" tool in btrfs-progs is useful for extracting information in a read-only fashion from btrfs volumes.
That assumes that there is an older copy. The OP thinks more of a movie or a song at home, I guess. They are written once, there will be no older copy. Even a snapshot does not help because it will include the same faulty block. With ZFS you can have multiple copies of directory trees, even on the same device. btrfs may have the same functionality. I do not have enough private data to fill a hard disk these days so it could be an option for him too. Or slice the disks in two partitions of equal size and use them as a mirror. Regards Peter