linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Question about mdcheck
@ 2021-04-05 17:17 Jeffery Small
  2021-04-05 18:58 ` Jeffery Small
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffery Small @ 2021-04-05 17:17 UTC (permalink / raw)
  To: Mailing Lists

This is on an Xubuntu 20.04 system.

I was wondering why I was occasionally seeing a "check" operation
occurring on my clean RAID1 mirrors.  Eventually I discovered the
checkarray and mdcheck scripts in /usr/share/mdadm.  It appears
that checkarray isn't used (is that correct?), but mdcheck is being
launched by /lib/systemd/system/mdcheck_start.service on the first
Sunday of each month.  I have a couple of questions?

1: Where do you look for the systemctl scheduling of services
like this?  Is there a cron-like scheduler?  The time for this needs
to be adjusted.

2: Why does mdcheck get a 6 hour run duration set?  Right now
it is starting a little after 8 AM, running until 2 PM and then check-
pointed and suspended.  On Monday at 9:10 AM it  continued due
to /lib/systemd/system/mdcheck_continue.service. It is running on
a 4TB raid that takes over 12 hours to complete, so why stop it
after 6 hours?  I'm certainly not getting any advantage to running in
off hours since it is starting at a really inappropriate time.

3: The process is really putting a load on the system and interfering
with other work.  Can the priority for this process be lowered so that
it doesn't consume so many resources?

4: How critical is the check operation?  Does it discover things that
the normal RAID operation misses?

Anything else I should know about all of this?

Thanks.
--
Jeffery Small

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: Question about mdcheck
  2021-04-05 17:17 Question about mdcheck Jeffery Small
@ 2021-04-05 18:58 ` Jeffery Small
  2021-04-05 19:06   ` systemd black magic (was "Re: Question about mdcheck") David T-G
  0 siblings, 1 reply; 4+ messages in thread
From: Jeffery Small @ 2021-04-05 18:58 UTC (permalink / raw)
  To: Mailing Lists

Following up to my own post:

Further exploration revealed a couple of things (to me!):

The mdcheck_start.timer and mdcheck_continue.timer files
under /lib/systemd/system/ contain RandomizedDelaySec
settings of 24h and 12h respectively.  This appears to be
responsible for the odd starting times for the check which is
interfering with daytime system use.  Why would these
values be included for a service intended to only run once
a month?

I do not want to edit the files under /lib/systemd/system/
which would certainly be overwritten with future updates.
Can I place copies of these files in /etc/systemd/system
and completely override the entries under /lib/systemd?

Clearly, I'm still trying to figure out just how the systemd
works and how it integrates with the old legacy init system.

On Mon, Apr 5, 2021 at 10:17 AM Jeffery Small <jeff@cjsa.com> wrote:
>
> This is on an Xubuntu 20.04 system.
>
> I was wondering why I was occasionally seeing a "check" operation
> occurring on my clean RAID1 mirrors.  Eventually I discovered the
> checkarray and mdcheck scripts in /usr/share/mdadm.  It appears
> that checkarray isn't used (is that correct?), but mdcheck is being
> launched by /lib/systemd/system/mdcheck_start.service on the first
> Sunday of each month.  I have a couple of questions?
>
> 1: Where do you look for the systemctl scheduling of services
> like this?  Is there a cron-like scheduler?  The time for this needs
> to be adjusted.
>
> 2: Why does mdcheck get a 6 hour run duration set?  Right now
> it is starting a little after 8 AM, running until 2 PM and then check-
> pointed and suspended.  On Monday at 9:10 AM it  continued due
> to /lib/systemd/system/mdcheck_continue.service. It is running on
> a 4TB raid that takes over 12 hours to complete, so why stop it
> after 6 hours?  I'm certainly not getting any advantage to running in
> off hours since it is starting at a really inappropriate time.
>
> 3: The process is really putting a load on the system and interfering
> with other work.  Can the priority for this process be lowered so that
> it doesn't consume so many resources?
>
> 4: How critical is the check operation?  Does it discover things that
> the normal RAID operation misses?
>
> Anything else I should know about all of this?
>
> Thanks.
> --
> Jeffery Small

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: systemd black magic (was "Re: Question about mdcheck")
  2021-04-05 18:58 ` Jeffery Small
@ 2021-04-05 19:06   ` David T-G
  2021-04-05 19:21     ` Paul Menzel
  0 siblings, 1 reply; 4+ messages in thread
From: David T-G @ 2021-04-05 19:06 UTC (permalink / raw)
  To: Mailing Lists

Jeffery, et al --

...and then Jeffery Small said...
% 
...
% I do not want to edit the files under /lib/systemd/system/
% which would certainly be overwritten with future updates.
% Can I place copies of these files in /etc/systemd/system
% and completely override the entries under /lib/systemd?

Yes.  That is exactly the right way to do it.  In fact, there's a
way you can only make changes such as adding a param (but not removing;
that DOES require wholesale overriding) so that you don't have to
maintain the entire separate copy, which might then diverge with nice
changes across updates.  On the other hand, it can be nice to have
absolute control over what happens.


% 
% Clearly, I'm still trying to figure out just how the systemd
% works and how it integrates with the old legacy init system.

Join the club :-/  You now know pretty much as much as I do about
systemd --- which ain't much!


HTH & HAND

:-D
-- 
David T-G
See http://justpickone.org/davidtg/email/
See http://justpickone.org/davidtg/tofu.txt


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: systemd black magic (was "Re: Question about mdcheck")
  2021-04-05 19:06   ` systemd black magic (was "Re: Question about mdcheck") David T-G
@ 2021-04-05 19:21     ` Paul Menzel
  0 siblings, 0 replies; 4+ messages in thread
From: Paul Menzel @ 2021-04-05 19:21 UTC (permalink / raw)
  To: Jeffery Small, David T-G; +Cc: linux-raid

Dear Jeffery, dear David,


Am 05.04.21 um 21:06 schrieb David T-G:
> Jeffery, et al --
> 
> ...and then Jeffery Small said...
> %
> ...
> % I do not want to edit the files under /lib/systemd/system/
> % which would certainly be overwritten with future updates.
> % Can I place copies of these files in /etc/systemd/system
> % and completely override the entries under /lib/systemd?
> 
> Yes.  That is exactly the right way to do it.  In fact, there's a
> way you can only make changes such as adding a param (but not removing;
> that DOES require wholesale overriding) so that you don't have to
> maintain the entire separate copy, which might then diverge with nice
> changes across updates.  On the other hand, it can be nice to have
> absolute control over what happens.

Yes, extending or overriding a unit is part of systemd’s design. Often 
drop-in snippets allow you to only change specific things, so you get 
the other updates, in case the software (often distribution package) 
changes something.

You can easily use `systemctl edit …` to do extend or override a unit 
[1][2].


Kind regards,

Paul


[1]: 
https://www.freedesktop.org/software/systemd/man/systemctl.html#edit%20UNIT%E2%80%A6
[2]: 
https://www.digitalocean.com/community/tutorials/how-to-use-systemctl-to-manage-systemd-services-and-units

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-04-05 19:22 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-04-05 17:17 Question about mdcheck Jeffery Small
2021-04-05 18:58 ` Jeffery Small
2021-04-05 19:06   ` systemd black magic (was "Re: Question about mdcheck") David T-G
2021-04-05 19:21     ` Paul Menzel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).