i have a raspberry pi with two USB thumb drives that are in a mirror raid array and store my data that I share using Nextcloud. Now randomly, I caught today that one USB drive LED was flashing without any obvous reason so I connected to my pi and did
cat /proc/mdstat and what I saw was:
$ cat /proc/mdstat Personalities : [raid1] md0 : active raid1 sdb1 sda1 120109056 blocks super 1.2 [2/2] [UU] [===================>.] check = 99.9% (120103296/120109056) finish=0.0min speed=18842K/sec bitmap: 0/1 pages [0KB], 65536KB chunk
I was awatching it just before it reached 99.9% but this is the laast resync message I caught, after this it looks like:
$ cat /proc/mdstat Personalities : [raid1] md0 : active raid1 sdb1 sda1 120109056 blocks super 1.2 [2/2] [UU] bitmap: 0/1 pages [0KB], 65536KB chunk
Now, how do I find out why the resync happened and if one of the drives is actually bad and should be replaced?
still looks good withlsblk`:
$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 1 119.3G 0 disk └─sda1 8:1 1 114.6G 0 part └─md0 9:0 0 114.6G 0 raid1 /mnt/usb sdb 8:16 1 114.6G 0 disk └─sdb1 8:17 1 114.6G 0 part └─md0 9:0 0 114.6G 0 raid1 /mnt/usb mmcblk0 179:0 0 29.2G 0 disk ├─mmcblk0p1 179:1 0 256M 0 part /boot └─mmcblk0p2 179:2 0 29G 0 part /
/etc/cron.d/mdadm looks like:
$ cat /etc/cron.d/mdadm # # cron.d/mdadm -- schedules periodic redundancy checks of MD devices # # Copyright © martin f. krafft <email@example.com> # distributed under the terms of the Artistic Licence 2.0 # # By default, run at 00:57 on every Sunday, but do nothing unless the day of # the month is less than or equal to 7. Thus, only run on the first Sunday of # each month. crontab(5) sucks, unfortunately, in this regard; therefore this # hack (see #380425). 57 0 * * 0 root if [ -x /usr/share/mdadm/checkarray ] && [ $(date +\%d) -le 7 ]; then /usr/share/mdadm/checkarray --cron --all --idle --quiet; fi
which refers to
/usr/share/mdadm/checkarray which is a script that doesn't produce ant output to stdout when it is run.