1

I recently had a server outage due to a failed drive. Because of that I set up the server with a new SSD in RAID1 this time but until I managed to get another SSD drive the mdadm-based RAID1 runs with only 1 device and is in degraded mode. (I know that it’s not any safer right now, but this is only for preparation!) There is no failed device and the RAID1 is in the expected state. So I don’t want to get bothered with these e-mails.

How can I specifically disable warnings for that particular RAID device being “degraded”?

The warning is sent by mdadm monitoring to the root of the system. Once every day, I think.

This is an automatically generated mail message from mdadm
running on MY_HOSTNAME

A DegradedArray event had been detected on md device /dev/md/0.

Faithfully yours, etc.

P.S. The /proc/mdstat file currently contains the following:

Personalities : [raid1] [linear] [multipath] [raid0] [raid6] [raid5] [raid4] [raid10]
md1 : active raid1 sda2[0]
      156011520 blocks super 1.2 [2/1] [U_]
      bitmap: 2/2 pages [8KB], 65536KB chunk

md0 : active raid1 sda1[0]
      144384 blocks super 1.2 [2/1] [U_]

unused devices: <none>
2
  • 1
    Degraded doesn't mean you have a failed device but means your RAID is not fullfill the normal operation requirements.
    – GuBo
    Commented May 31, 2020 at 5:10
  • @GuBo That is correct. I don’t really care how you call it. The issue is that mdadm sends an e-mail about this once a day. I absolutely care about being notified about problems and don’t want to get used to ignore them. Commented May 31, 2020 at 17:25

3 Answers 3

2

The mdmonitor.service runs permanently and immediately notifies about changes of mdadm devices.

The daily warning is generated by /etc/cron.daily/mdadm. I could disable the daily warning by temporarily inserting exit 0 at the top of the script.

This method is rather unspecific though. I couldn’t find a way to ignore particular mdadm devices. But because mdmonitor will notify about changes anyway, this method might be acceptable.

0

The daily warning goes to the email address found in the MAILADDR variable from /etc/mdadm/mdadm.conf - by default it's "root" hence "root@localhost", but can be anything your /usr/sbin/sendmail can deliver to

So you can e.g. alias that into a separate mailbox, like /dev/null

Or, you can in turn alias it to a separate set of e.g. maildrop filters that check if it's about that specific device, and then drop it; otherwise deliver it to you

0

I had a similar situation today on another system that I am migrating away from: I removed a disk from the RAID1 in order to transfer that data to the new system. The old array is now “degraded” but is soon going to be removed completely. The system contains another valid RAID5 array with redundancy—so I do not want to disable notifications altogether.

I managed to reduce the number of disks from 2 to 1 in order to make the array status fine again:

root@server:~# mdadm --grow --raid-devices=1 /dev/md127
mdadm: '1' is an unusual number of drives for an array, so it is probably
     a mistake.  If you really mean it you will need to specify --force before
     setting the number of drives.
root@server:~# mdadm --grow --force --raid-devices=1 /dev/md127
raid_disks for /dev/md127 set to 1

Before I received daily notifications about two degraded arrays with status [U_]:

root@server:~# cat /proc/mdstat 
Personalities : [raid1] [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid10] 
md125 : active raid5 sdc1[3] sde1[7] sdd1[4] sdf1[5]
      5849607168 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      
md126 : active raid1 sda2[0]
      232651776 blocks super 1.2 [2/1] [U_]
      bitmap: 2/2 pages [8KB], 65536KB chunk

md127 : active raid1 sda1[0]
      152576 blocks super 1.2 [2/1] [U_]
      
unused devices: <none>

You can now see two RAID devices with status [U]:

root@server:~# cat /proc/mdstat
Personalities : [raid1] [raid6] [raid5] [raid4] [linear] [multipath] [raid0] [raid10] 
md125 : active raid5 sdc1[3] sde1[7] sdd1[4] sdf1[5]
      5849607168 blocks super 1.2 level 5, 512k chunk, algorithm 2 [4/4] [UUUU]
      
md126 : active raid1 sda2[0]
      232651776 blocks super 1.2 [1/1] [U]
      bitmap: 2/2 pages [8KB], 65536KB chunk

md127 : active raid1 sda1[0]
      152576 blocks super 1.2 [1/1] [U]
      
unused devices: <none>

You can later increase the number of devices again if desired.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .