Does RAIDZ2 Provide Data Integrity

iqgrande

Cadet
Joined
Sep 13, 2021
Messages
2
Greetings:

This should hopefully be a very simple question to answer, however I just want to make sure since I am new to ZFS. I set up my 8-disk TrueNAS system with 1 VDEV configured for RAIDZ2. I chose the defaults which has "copies=1" set. I am under the impression that should something like bit rot occur on a file that ZFS would attempt to grab the correct duplicate copy of this and then it would copy the correct duplicate in a new location and use that instead of the incorrect entity, all despite "copies=1" being set. I came across some poorly worded stuff that made it seem like "copies=2" or higher would need to be set to achieve this result. I believe this to be wrong and that the "copies=" values greater than 1 give that data integrity capability for situations where there is only a single drive. Am I correct with what I'm describing here or am I way off? I have tried to read up on stuff but I just want to make sure I'm not misinterpreting things. Thank you for any help you can provide with this. I have been very impressed with ZFS for the few days I've been exposed to it and want to learn as much about it as possible.

Kind regards,
Anthony
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
The copies property is fundamentally distinct from vdev-level redundancy. A healthy RAIDZ or mirror will allow ZFS to correct any errors. Using copies=2/3, ZFS will store one/two additional copy/ies of data. The default behavior is to use copies=2 for all less-than-critical metadata and copies=3 for vdev-level metadata. Additionally, if multiple vdevs are available, ZFS will attempt to place each copy on a separate vdev.

Most users do not feel the need to bump up the copies property.
 

sretalla

Powered by Neutrality
Moderator
Joined
Jan 1, 2016
Messages
9,703
Just to add a little to that...

With RAIDZn, you have n disks worth of Parity data which can effectively provide an additional "n copies" (via calculation) from which to restore corrupted blocks, so having an entire copy in addition to that is usually not necessary (knowing that the additional copy would also have 2 disks worth of parity on top... seems excessive).

For mirrors, you have the same number of copies (no Parity as such) that you have disks in the VDEV.

In all cases above, with copies set to 1, so no need to intervene.

The metadata stuff mentioned is automatic and warranted IMO.
 
Last edited:

iqgrande

Cadet
Joined
Sep 13, 2021
Messages
2
Thank you everyone for your responses! Are the maintenance items for the NAS to check for corrupted blocks and correct them manual or automatic?
 

Patrick M. Hausen

Hall of Famer
Joined
Nov 25, 2013
Messages
7,776
There are regular "scrub" tasks that do exactly that.

Bildschirmfoto 2021-09-15 um 09.06.03.png
 
Top