Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have more than two very old HDDs in a softraid(4) RAID1 mirroring discipline on OpenBSD.

It looks like some of the underlying physical drives may be seeing some I/O errors; but prior to a complete replacement of such physical drives, one at a time, I wanted to ensure that I really don't need any data off of it anymore.

Is there any way to check the integrity of the arrays, prior to replacing one of the drives, to avoid surprises years down the line?

share|improve this question

1 Answer 1

As the documentation for OpenBSD's softraid seems to indicate, the arrays are created without any kind of synchronisation taking place during the creation step:

 The RAID 1 discipline does not initialize the mirror upon creation.  This
 is by design because all sectors that are read are written first.  There
 is no point in wasting a lot of time syncing random data.

As such, the integrity and consistency between the physical drives would have to be verified with the help of a filesystem.

However, since each filesystem on top of softraid is RAID-agnostic, there would have to be a special way to, perhaps, mount the filesystem in a read-only mode onto several different mounting points, with each mount being tied to a separate physical drive in the underlying RAID1, and then run a comparison tool to compare filesystem content between the drives. There doesn't seem to be any code to this effect currently.

Another alternative would be to completely zero-out all the physical drives prior to creating the softraid, or zero out out all the logical RAID volumes prior to creating the filesystems. This would make it possible to compare data block-by-block (for example, by mounting the filesystems in read-only mode, and doing a sha1 of each physical drive, after ignoring the initial offset that's used to store the softraid information (unless it's stored in multiple locations on disc, like the filesystems do with some most important data)).

The final alternative would seem to be to try to fill all filesystems with files full of /dev/zero, which may or may not make the logical drives have the same content, and then trying to do the comparison of the data on the physical drives with sha1 as in the step above. However, this final step would be of no good if a given physical drive has already been taken offline from the logical one, since there is no longer any way to mount it, or modify its content.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.