0

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[1] sda1[2]
      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[1] sda1[2]
      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? sda1 andsdb1still 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  /

UPDATE:

There's no /etc/charray but /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 protected]>
# 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.

2
  • 1
    Do you have an /etc/cron.d/checkarray or /etc/cron.d/mdadm file, and if so what is in it?
    – icarus
    Commented May 3, 2020 at 3:46
  • 1
    probably just a periodic check but you can see if there were any errors in dmesg Commented May 3, 2020 at 15:28

1 Answer 1

2

There is a cron job run in the early hours of the morning of the first sunday of the month which does a full check of the array. The OP caught it running.

2
  • Okay, nothing to worry about then? It wasn't Sunday early hours in my time zone but for UTC, that is about true!
    – stdcerr
    Commented May 3, 2020 at 18:37
  • 1
    Almost certainly nothing to worry about.
    – icarus
    Commented May 3, 2020 at 21:42

You must log in to answer this question.

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