Commit Graph

8 Commits

Author SHA1 Message Date
Donald Buczek 3b7aae927b mdcheck: Log when done
Currently mdcheck (when called with `--duration`) logs only the
beginning of the check, the pausing and the continuation but not the
completion.

So, log the completion, too, so that it can be determined how long the
raid check took.

    2020-05-08T18:00:02+02:00 deadpool root: mdcheck start checking /dev/md0
    2020-05-08T18:00:02+02:00 deadpool root: mdcheck start checking /dev/md1
    2020-05-09T15:32:04+02:00 deadpool root: mdcheck finished checking /dev/md1
    2020-05-09T17:38:04+02:00 deadpool root: mdcheck finished checking /dev/md0

Cc: linux-raid@vger.kernel.org
Signed-off-by: Paul Menzel <pmenzel@molgen.mpg.de>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2020-05-14 11:08:59 -04:00
NeilBrown f258a5e391 mdcheck: improve cleanup
We should remove the tmp file on signals as well as on exit.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-10-10 16:42:39 -04:00
NeilBrown ea835492b6 mdcheck: add some logging.
Use 'logger' to report when mdcheck starts, stops, or continues
the check on an array.

Signed-off-by: NeilBrown <neilb@suse.com>
Signed-off-by: Jes Sorensen <jsorensen@fb.com>
2017-10-10 16:41:42 -04:00
NeilBrown 979b1feb09 mdcheck: be careful when sourcing the output of "mdadm --detail --export"
The output of "mdadm --detail --export" isn't quoted properly so
fields that contain spaces can be a problem.
We only want the MD_UUID field, and it has a very well defined
format with no spaces.
So use 'grep' to limit the output to just that.

Signed-off-by: NeilBrown <neilb@suse.de>
2015-02-04 09:06:47 +11:00
NeilBrown 36dab45b89 mdcheck: don't git error if not /dev/md?* devices exist.
If there are no such devices, the 'for' will set '$dev' to
'/dev/md?*', which should be ignored.

Signed-off-by: NeilBrown <neilb@suse.de>
2014-11-03 11:58:06 +11:00
NeilBrown 868ab80dea mdcheck: don't pass the '+' to "date".
It isn't needed, makes is harder to describe what --duration does.

Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-26 09:37:05 +10:00
NeilBrown df881f757b mdcheck: new script to help with regular checks of md arrays.
This script allows arrays to be 'checked' for a limited amount
of time on a regular basis.

For example, running

 mdcheck --duration 6hours

early every Sunday morning and

 mdcheck --continue 6hours

ever other morning will check all arrays every week, but if that take
more than 6 hours, will won't run into the day, but will be continued
the next morning, and the next ... etc.

Signed-off-by: NeilBrown <neilb@suse.de>
2014-05-22 16:00:39 +10:00
Neil Brown b5e6464503 mdadm-1.8.0 2004-11-01 04:49:34 +00:00