RAID6CHECK(8)

πŸ“¦
version 4.6 Β· 2 versions
, in arch rolling

πŸ‘‘ RAID6CHECK β€” the mdadm girlies' fave checker, aka check MD RAID6 device for errors aka Linux Software RAID

okay bestie, sit down, hydrate, and let me tell you about raid6check πŸ’– it's the little tool from the System Manager's Manual family that goes and pokes at your MD RAID6 device to see if anything's sus. Two modes, no drama (well, some drama): check mode and repair mode. periodt.


✨ SYNOPSIS ✨

raid6check <raid6_device> <start_stripe> <number_of_stripes> [autorepair]
raid6check <raid6_device> repair <stripe> <failed_slot_1> <failed_slot_2>

🌸 DESCRIPTION 🌸

so here's the vibe. RAID6 devices where one single component drive has errors can use that iconic double parity to figure out which component drive is the messy one. that's the whole point of raid6check, and it's giving detective energy πŸ”

raid6check has exactly two modes: check mode and repair mode.

raid6check needs a non-degraded RAID6 MD device as its first parameter. if the MD device you hand it isn't a RAID6, raid6check will, of course, not continue. like, obviously. not me handing it the wrong device πŸ’€

and if the RAID6 MD device is degraded, raid6check will report an error and will not proceed further. no cap.

πŸ•΅οΈβ™€οΈ Check mode

in check mode, raid6check goes stripe by stripe and checks the double parity consistency, reports mismatches, and β€” if it can β€” tells you which component drive has the mismatch. since it works at stripe level, it can absolutely report different drives with mismatches at different stripes. messy behavior, honestly. we don't judge.

besides the MD device, raid6check requires a starting stripe (usually 0) and the number of stripes to be checked. and here's the tea: if that third parameter is also 0, it will check the array up to the end ✨ and if the fourth parameter is autorepair, it will overwrite single-slot errors.

raid6check will start printing info about the RAID6, then for each stripe it will report the parity rotation status. if there are parity mismatches, raid6check reports which component drive could be responsible β€” if possible. otherwise it reports that it is not possible to find the component drive. shrug emoji 🫢

okay important: no write operations are performed on the array or the components, unless autorepair is specified. and bonus: the checked array can be online and in use while raid6check is doing its thing. iconic, no downtime, we love to see it πŸ’…

πŸ› οΈ Repair mode

in repair mode, raid6check checks the given stripe. if it finds inconsistencies, it attempts to repair the strip assuming that the two given slots are incorrect.

and listen β€” -1 may be used to specify parity P and -2 parity Q. write that down. literally.


πŸ’« EXAMPLES πŸ’«

raid6check /dev/md0 0 0

this will check /dev/md0 from start to end. the full send πŸ¦‹

raid6check /dev/md3 0 1 autorepair

this will check the first stripe of /dev/md3. any error will be reported, and if single-slot, repaired. glow up in real time ✨

raid6check /dev/md3 0 repair 1 -1 -2

this will check the first stripe of /dev/md3. if any inconsistencies are found, repair is performed assuming the two parities are incorrect.

raid6check /dev/md1 1000 0

this will check /dev/md1 from stripe 1000 up to the end.

raid6check /dev/m127 128 256

this will check 256 stripes of /dev/md127 starting from stripe 128.

raid6check /dev/md0 0 0 | grep -i error > md0_err.log

this will check /dev/md0 completely and create a log file only with errors, if any. piping into grep, logging the receipts, main character energy πŸ“


πŸŽ€ FILES πŸŽ€

raid6check uses directly the component drives as found in /dev. also, the sysfs interface is needed in order to find out the RAID6 parameters. yes bestie, it needs both. it's high maintenance but it's worth it πŸ’œ


πŸ’€ BUGS πŸ’€

okay so the not-so-cute parts, we keep it real:

  • 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.) so like, tread carefully, this is giving undefined behavior territory 😭
  • It is not clear what will happen if the RAID6 MD device gets degraded during the check. so... yeah. nobody knows. we're all just vibing.

the latest version of raid6check should always be available from

https://www.kernel.org/pub/linux/utils/raid/mdadm/

related man pages, for your reading pleasure:

mdadm(8) mdmon(8), mdadm.conf(5), md(4).


go check your arrays, bestie. and remember: don't run autorepair unless you actually mean it. 🫢

and that's the whole page, written by me, shipped as v1.0.0 🌈 stay slay, stay consistent, and may all your parity checks come back clean. bye πŸ’–

πŸ“¦ where this page comes from