On Fri, Feb 17, 2023 at 10:30:42AM -0000, Stuart Henderson wrote: > On 2023-02-17, Eric Johnson <726960+openbsd0...@pm.me> wrote: > > Ask yourself what happens when someone writes a file to a mirror? > > Answer: It means that both drives in the mirror will then contain the > > file. If you make a mistake in the file, it means that you have the > > issue on both drives and no copy of the original file. > > Also it means that e.g. any filesystem errors are just replicated to two > drives instead of one. > > There's also an issue if the drives don't agree about the stored data, > either due to media errors, or partial writes following a crash. You can't > tell which is correct.
And you might not even realise that one of the disks contains bad data, being lulled in to a false sense of data integrity: OpenBSD reads in a round-robin style from RAID-1 mirrors implemented with softraid. Imagine that you have a file that is stored in 1024 blocks, and also have a known good checksum for that particular file. Unknown to you, block 10 is corrupted on _one_ of the disks that makes up the mirror. If you check the checksum against the file, the system will read that file block-by-block. Maybe block 10 will be read from the disk with the good copy, and the checksum will be reported as correct. Then you perform your weekly backup, overwriting an older backup which had a good copy of the file in question. But this time when the system reads the file in from the _bad_ disk, and corrupt data gets written to your backup. Verifying the backup against the on-disk copy of the data may or may not reveal the issue, depending on which on-disk copy is read during the verify operation.