Bug Report: Dashboard misreporting RAID configuration on Dashboard

NethServer Version: 7.3 RC3 (updated to latest updates_
Module: nethserver-base

Folks, doing the a production installation for Nethserver. Everything seems to be going as expected (I did report a firewall addition needed for what most people believe is normal VPN behavior). I installed the machine to use RAID 10 for the root and swap partitions on 6 drives. All installs and works as expect. If you look at the provided screen shot you’ll see md126 and md127 reported as RAID 1 with 6 drives).

Here is the output from my cat /proc/mdstat:

Personalities : [raid10] [raid1]
md1 : active raid1 sda2[0] sdb2[1]
1048512 blocks super 1.0 [2/2] [UU]
bitmap: 0/1 pages [0KB], 65536KB chunk

md126 : active raid10 sdf2[5] sda5[0] sdc2[2] sdb5[1] sde2[4] sdd2[3]
5845847040 blocks super 1.2 512K chunks 2 near-copies [6/6] [UUUUUU]
bitmap: 13/44 pages [52KB], 65536KB chunk

md127 : active raid10 sdf1[5] sdb3[1] sdc1[2] sde1[4] sda3[0] sdd1[3]
7999488 blocks super 1.2 512K chunks 2 near-copies [6/6] [UUUUUU]

Is this a simple parse or CSS error? Anyway, it should probably get fixed soon as this could confuse people when looking at the summary screen.

2 Likes

It’s a bug in the raid status parser. When looking for raid level, it stops at the first digit.
Edit line 59 of /usr/libexec/nethserver/raid-status adding a “*” like in the following diff:

-		if (/^raid(\d)/) {
+		if (/^raid(\d*)/) {
1 Like

yep, it works. Would it make more sense to to make it “\d+”? I don’t think any raid name ends in a non-digit and this allows anything after the first number if my understanding of regex is correct. Anyway here is what I did which also appears to work:

-		if (/^raid(\d)/) {
+               if (/^raid(\d+)/) {

Thanks for the quick response. The team will upload some code correction I expect. I’ll watch for the updates. :smile:

1 Like

I agree.
According to wikipedia, RAID10 shouldn’t exist: :slight_smile:

According to man mdadm we should support even more keywords:

Currently, Linux supports LINEAR md devices, RAID0 (striping), RAID1 (mirroring), RAID4, RAID5, RAID6, RAID10, MULTIPATH, FAULTY, and CONTAINER.

Hmm…mdstat doesn’t show the words “(striping)” or “(mirroring)” but I wonder how the string format of “MULTIPATH”, “FAULTY”, and “CONTAINER” are used. Never looked into this before as it is important for me till now. :smiley: I’m concerned that a “*” after \d may get stray data that wasn’t intended. Wikipedia appears to be outdated. It’s weird because many net admins are reporting RAID 6 to be worse than losing data in some cases because the rebuild takes too long on larger hard drivers (2+ TB) so many are strongly advising RAID10.

Back to Regex:

From https://raid.wiki.kernel.org/index.php/Mdstat here is a list:

[raid0] [raid1] [raid4] [raid5] [raid6] [linear] [multipath] [faulty]

“faulty” is listed as a status So from this list:

/^raid(\d+|linear|multipath)/ regex perhaps? Not sure. Anyone out there who can confirm all possible RAID outputs for cat /proc/mdstat?

2 Likes

Just substituted this regex on line 59:

/^raid(\d+|linear|multipath)/

and it seems to work properly. Anyone want to verify one of these alternatives and upload to the code/updates. I’m sure many admin’s want to see the correct RAID. :smiley:

I don’t think that it will work with linear or multipath (I can’t test it now).
As an immediate safe fix, I’d use "/^raid(\d+)/.
We could develop a full fix for linear and multipath later, given the relatively rare usage of those modes.
Do you agree?

Not really my call, I’m just a humble tester/user but the “\d+” is certainly safe for the vast majority. I’ll run my “wordy” expression through a couple of regex testers but at least for my RAID 10 it seems to work. But as you say, the immediate safe fix of “\d+” is a safe solution and I’d have no problem with that being in the update.