From 2a63857e9506324ec3ef69746344de08f55e6d77 Mon Sep 17 00:00:00 2001 From: Mingye Wang Date: Sat, 20 Sep 2025 14:21:40 +0800 Subject: [PATCH 64/74] Update raid6check man page This adds autorepair and manual repair modes, which have been here for about 12 years. The description of the manual repair mode can probably use more work. Signed-off-by: Mingye Wang --- raid6check.8 | 61 +++++++++++++++++++++++++++++++++++++--------------- 1 file changed, 44 insertions(+), 17 deletions(-) diff --git a/raid6check.8 b/raid6check.8 index 8999ca89e951..f6acb288834b 100644 --- a/raid6check.8 +++ b/raid6check.8 @@ -13,48 +13,72 @@ Linux Software RAID .SH SYNOPSIS -.BI raid6check " " +.BI raid6check " " +.RB [ autorepair ] + +.BI raid6check " " repair " " +.I "" .SH DESCRIPTION RAID6 devices in which one single component drive has errors can use the double parity in order to find out which component drive. -The "raid6check" tool checks, for each stripe, the double parity -consistency, reports mismatches and, if possible, which +The "raid6check" tool has two modes: check mode and repair mode. + +"raid6check" requires a non-degraded RAID6 MD device as first +parameter. If the given MD device is not a RAID6, "raid6check" will, +of course, not continue. + +If the RAID6 MD device is degraded, "raid6check" will report +an error and it will not proceed further. + +.SS Check mode +In the check mode, the "raid6check" tool checks, for each stripe, the +double parity consistency, reports mismatches and, if possible, which component drive has the mismatch. Since it works at stripe level, it can report different drives with mismatches at different stripes. -"raid6check" requires a non-degraded RAID6 MD device as first -parameter, a starting stripe (usually 0) and the number of stripes -to be checked. +In addition to the MD device, "raid6check" requries a starting stripe +(usually 0) and the number of stripes to be checked. If this third parameter is also 0, it will check the array up to the end. +If the fourth parameter is "autorepair", it will overwrite single-slot +errors. "raid6check" will start printing information about the RAID6, then for each stripe, it will report the parity rotation status. In case of parity mismatches, "raid6check" reports, if possible, -which component drive could be responsible. Otherwise it reports -that it is not possible to find the component drive. - -If the given MD device is not a RAID6, "raid6check" will, of -course, not continue. +which component drive could be responsible. +Otherwise it reports that it is not possible to find the component drive. -If the RAID6 MD device is degraded, "raid6check" will report -an error and it will not proceed further. - -No write operations are performed on the array or the components. +No write operations are performed on the array or the components, +unless "autorepair" is specified. Furthermore, the checked array can be online and in use during the operation of "raid6check". +.SS Repair mode +In the repair mode, the "raid6check" tool checks the given stripe. +If inconsistencies are found, it attempts to repair the strip assuming +that the two given slots are incorrect. + +-1 may be used to specify parity P and -2 parity Q. + .SH EXAMPLES .B " raid6check /dev/md0 0 0" .br This will check /dev/md0 from start to end. -.B " raid6check /dev/md3 0 1" +.B " raid6check /dev/md3 0 1 autorepair" +.br +This will check the first stripe of /dev/md3. +Any error will be reported, and if single-slot, repaired. + +.B " raid6check /dev/md3 0 repair 1 -1 -2" .br This will check the first stripe of /dev/md3. +If any inconsistencies are found, repair is performed assuming +the two parities are incorrect. .B " raid6check /dev/md1 1000 0" .br @@ -76,7 +100,10 @@ Furthermore, the sysfs interface is needed in order to find out the RAID6 parameters. .SH BUGS -Negative parameters can lead to unexpected results. +Negative stripe parameters can lead to unexpected results due to +strtoull. +(Negative slot numbers should work for Q [-1] and P [-2] but +currently involve compiler-defined behavior.) It is not clear what will happen if the RAID6 MD device gets degraded during the check. -- 2.50.1