I have a number of Debian servers in a datacenter and from time to time I notice that the software RAID 1 was degraded. While the re-sync process starts automatically and I don't lose any data I find it annoying as it slows down the servers even for days while the HDDs are re-syncing.
I was wondering what exactly causes the HDDs to de-sync in the first place and if there are any configuration options to prevent this from happening.
Any thoughts/suggestions on this matter would be greatly appreciated.
You may also want to check for the existence of a
cron
job which regularly runs a RAID check on the mirrors. This can look a lot like a resync while it's happening.On CentOS-type systems, it's done by
/etc/cron.weekly/99-raid-check
; I don't know what that'd be on a Debian system, though.Edit: That's a weekly cron job that runs a RAID check, which causes the discs to perform something very like a RAID resync. This isn't the same thing as just checking to see if RAID has failed; the substantive line is
echo "check" > /sys/block/$dev/md/sync_action
. If you're saying that you constantly find your RAID arrays resyncing, this may be what's biting you. If you're saying that they constantly report unrecovering degraded, this isn't it.If you think this might be it, you'll have to look at wherever Debian keeps its weekly/monthly cron jobs.
Edit 2: this file in
/sys
isn't a real file, it's a kernel artefact. You have to find out whichcron
job is writingcheck
to that file, and stop it. I'm sorry, but I've little experience with debian, and don't know where it keeps its system cron files. But if you poke around, you should be able to find the local equivalent of my/etc/cron.weekly/99-raid-check
, and edit it (or a resource file it depends on) so it doesn't do that, or just delete it.Edit 3: you might try
to stop an in-progress sync check. But it's been a while since I had to disable one mid-check, so I can't swear to that.