On Thu, Feb 16, 2023 at 01:48:49AM +0100, i...@tutanota.com wrote:
> If I setup a couple of drives in a RAID mirror on OpenBSD to serve as
> a NAS box, what is the best way to ensure data integrity?

This is a very broad question and the answer is always going to depend on
your specific use case.

However, in general, it's best to do this kind of thing at the application
level, or rather not to add excessive features at the filesystem or block
device level to try to ensure 'data integrity'.

This could be as simple as a script run from cron to check the hashes of files
which are not expected to change, or as complicated as modifying the
applications you are using to store ECC in their data files, or even write
multiple copies of the same data to different files on the disks, (and check
those as deemed to be required).

But the point is to do this _in the application_ or at least as a user-land
task, and not try to build a fancy 'one size fits all' solution to the
(perceived), problem with a complex combination of RAID arrays, funky
filesystems, and other trickery.

And the other key to ensuring data integrity over a long period of time is
to separate out data which is not expected to change, and archive it
separately.  Don't just create one massive RAID-5 dumping ground for
everything and keep adding data and disks to it in an unorganised fashion
until it breaks.

Reply via email to