RAID1 and data safety?
Just wondering;
Is there any way to tell MD to do verify-on-write and read-from-all-disks on a RAID1 array?
I was thinking of setting up a couple of RAID1s with maximum data safety. I'd like to verify after each write to a disk plus I'd like to read from all disks and perform data comparison whenever something is read.
I'd then run a RAID0 over the RAID1 arrays, to regain some of the
speed lost from all of the excessive checking.
Just wondering if it could be done :-).
Apologies if the answer is in the docs.
Quoted 4 lines · On Wednesday March 16, [email protected] wrote:
Just wondering;
Is there any way to tell MD to do verify-on-write and read-from-all-disks on a RAID1 array?
No.
I would have thought that modern disk drives did some sort of verify-on-write, else how would they detect write errors, and they are certainly in the best place to do verify-on-write.
Doing it at the md level would be problematic as you would have to ensure that you really were reading from the media and not from some cache somewhere in the data path. I doubt it would be a mechanism that would actually increase confidence in the safety of the data.
read-from-all-disks would require at least three drives before there would be any real value in it. There would be an enormous overhead, but possibly that could be justified in some circumstances. If we ever implement background-data-checking, it might become relatively easy to implement this.
However I think that checksum based checking would be more effective, and that it should be done at the filesystem level.
Imagine a filesystem that could access multiple devices, and where it kept index information it didn't just keep one block address, but rather kept two block address, each on different devices, and a strong checksum of the data block. This would allow much the same robustness as read-from-all-drives and much lower overhead.
It is very possibly the Sun's new ZFS filesystem works like this, though I haven't seen precise technical details.
In summary:
- you cannot do it now.
- I don't think md is at the right level to solve these sort of problems. I think a filesystem could do it much better. (I'm working on a filesystem .... slowly...)
- read-from-all-disks might get implemented one day. verify-on-write is much less likely.
Quoted 2 lines
Apologies if the answer is in the docs.
It isn't. But it is in the list archives now....
NeilBrown
Quoted 7 lines · Neil Brown
Quoted 2 lines
Is there any way to tell MD to do verify-on-write and read-from-all-disks on a RAID1 array?
No.
I would have thought that modern disk drives did some sort of verify-on-write, else how would they detect write errors, and they are certainly in the best place to do verify-on-write.
Really? My guess was that they wouldn't, because it would lead to less performance.
And that's why read errors crop up at read time.
Quoted 4 lines
Doing it at the md level would be problematic as you would have to ensure that you really were reading from the media and not from some cache somewhere in the data path. I doubt it would be a mechanism that would actually increase confidence in the safety of the data.
Hmm. Could hack it by reading / writing blocks larger than the cache. Ugly.
Quoted 5 lines
Imagine a filesystem that could access multiple devices, and where it kept index information it didn't just keep one block address, but rather kept two block address, each on different devices, and a strong checksum of the data block. This would allow much the same robustness as read-from-all-drives and much lower overhead.
As in, "if the checksum fails, try loading the data blocks [again] from the other device"?
Not sure why a checksum of X data blocks should be cheaper performance-wise than a comparison between X data blocks, but I can see the point in that you only have to load the data once and check the checksum. Not quite the same security, but almost.
Quoted 11 lines
In summary:
- you cannot do it now.
- I don't think md is at the right level to solve these sort of problems. I think a filesystem could do it much better. (I'm working on a filesystem .... slowly...)
- read-from-all-disks might get implemented one day. verify-on-write is much less likely.Quoted 1 line
Apologies if the answer is in the docs.
It isn't. But it is in the list archives now....
Thanks! :-)
(Guess I'll drop the idea for the time being...)