Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

MDADM Automatic Scrubbing

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
Gerowen
Posts: 182
Joined: 2011-04-11 05:12
Location: Kentucky
XMMP/Jabber: gerowen@conversations.im
Has thanked: 5 times
Been thanked: 2 times
Contact:

MDADM Automatic Scrubbing

#1 Post by Gerowen »

Does mdadm have automatic scrubbing of arrays with its out of the box configuration? I've got my own cron.monthly script that does a manual scrub every three months, but I've seen "some" mention of mdadm services that do scrubs on their own at particular intervals, and if this is the case, I don't want to duplicate effort and introduce unnecessary wear and tear on my stuff.

I'm poking around in /lib/systemd/system reading these .service files, but if somebody already knows and could educate me it would be much appreciated.

Here's the script I wrote for myself that runs the manual scrub.
raidscrub.png
raidscrub.png (57.65 KiB) Viewed 1827 times

Gerowen
Posts: 182
Joined: 2011-04-11 05:12
Location: Kentucky
XMMP/Jabber: gerowen@conversations.im
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: MDADM Automatic Scrubbing

#2 Post by Gerowen »

Got it figured out, my script is not necessary. Thanks to rudi_s in the IRC for educating me, :-)
rudis_mdadm.png
rudis_mdadm.png (223.05 KiB) Viewed 1785 times

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 65 times

Re: MDADM Automatic Scrubbing

#3 Post by LE_746F6D617A7A69 »

Gerowen wrote: 2022-05-29 08:27 Does mdadm have automatic scrubbing
No, but it performs automatic error correction, see md(4)

Personally, I'm not using scrubbing of the md arrays, because the probability of damaging all the stripes containing the same data chunk is nearly zero. Far more probable is a raid device failure, which is already handled by rejecting the faulty device from an array.
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

Gerowen
Posts: 182
Joined: 2011-04-11 05:12
Location: Kentucky
XMMP/Jabber: gerowen@conversations.im
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: MDADM Automatic Scrubbing

#4 Post by Gerowen »

LE_746F6D617A7A69 wrote: 2022-05-29 19:59
Gerowen wrote: 2022-05-29 08:27 Does mdadm have automatic scrubbing
No, but it performs automatic error correction, see md(4)

Personally, I'm not using scrubbing of the md arrays, because the probability of damaging all the stripes containing the same data chunk is nearly zero. Far more probable is a raid device failure, which is already handled by rejecting the faulty device from an array.
Between the contents of /etc/default/mdadm and the cron job located in /etc/cron.d, it "appears" at least that it does a regularly scheduled low-priority scrub on the first Sunday of every month. Am I misunderstanding something? It's very possible, and I'm not looking to do constant scrubs, but I figure it might be a good idea to run one a few times a year just to catch bit rot before it becomes a problem, like what happened to Linus on LTT because his server (unraid, proxmox maybe?) wasn't doing regular automatic scrubs to alert them to problems. If it's doing this low priority scrub on its own every month, I'm fine with that. If it's not, I'd like to schedule one to run every 3 months, maybe even every 6 months. I just don't want to be two years or something into storing bad data on my off-site backup before I realize it and don't have another copy to restore from.

Here's the contents of /etc/default/mdadm
etcdefaultmdadm.png
etcdefaultmdadm.png (81.05 KiB) Viewed 1763 times
Here's the contents of /etc/cron.d/mdadm
mdadmcronjob.png
mdadmcronjob.png (51.97 KiB) Viewed 1763 times

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 65 times

Re: MDADM Automatic Scrubbing

#5 Post by LE_746F6D617A7A69 »

Gerowen wrote: 2022-05-29 20:52 I just don't want to be two years or something into storing bad data on my off-site backup before I realize it and don't have another copy to restore from.
Raid is*not*creating backups - it provides redundancy, which is *not* a backup, nor is the cloud.
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

Gerowen
Posts: 182
Joined: 2011-04-11 05:12
Location: Kentucky
XMMP/Jabber: gerowen@conversations.im
Has thanked: 5 times
Been thanked: 2 times
Contact:

Re: MDADM Automatic Scrubbing

#6 Post by Gerowen »

LE_746F6D617A7A69 wrote: 2022-05-29 21:17
Gerowen wrote: 2022-05-29 20:52 I just don't want to be two years or something into storing bad data on my off-site backup before I realize it and don't have another copy to restore from.
Raid is*not*creating backups - it provides redundancy, which is *not* a backup, nor is the cloud.
I never said RAID was my backup, my backup is a separate thing. But, having a separate backup doesn't accomplish anything if you're copying corrupted data to it because the RAID contains corruptions that haven't been caught or corrected.

LE_746F6D617A7A69
Posts: 932
Joined: 2020-05-03 14:16
Has thanked: 7 times
Been thanked: 65 times

Re: MDADM Automatic Scrubbing

#7 Post by LE_746F6D617A7A69 »

Gerowen wrote: 2022-05-29 22:32 But, having a separate backup doesn't accomplish anything if you're copying corrupted data to it because the RAID contains corruptions that haven't been caught or corrected.
It's extremely unlikely that a read/write error will cause data corruption on any Raid level (excluding level 0 ofc.) - that's the primary reason of why the raid arrays are used.
Far more probable is data corruption in the RAM buffers, f.e. during copying - unless You're using ECC memory.
Bill Gates: "(...) In my case, I went to the garbage cans at the Computer Science Center and I fished out listings of their operating system."
The_full_story and Nothing_have_changed

Post Reply