On 15May2020 11:53, Patrick O'Callaghan <pocallaghan(a)gmail.com> wrote:
I recently had to throw out an old NAS I've been using for over
10
years. However I rescued the 2 HDDs and got a dual-slot USB SATA
docking station for them. To my astonishment Fedora recognised them
immediately as a RAID1 array (formatted with XFS) without me doing
anything.
Excellent. So it was running Linux inside.
However gsmartcontrol reports that one of the HDDs has internal
errors.
Would it be best to correct these using mdadm (assuming they can be
corrected), and if so, how? Or should I do an offline copy with the
docking station's "clone" button?
Can you copy the filesystem to another drive? I can't speak to repairing
a drive, but from outside the RAID1 you should just be able to copy the
data off. The md stuff does a regular block scan (weekly? something like
that) which will find out if blocks are bad.
Are there any general recommendations for monitoring these beasties?
I
don't want to change anything for the time being and will be using the
thing mainly for backup, but I see there is such a thing as mdmon which
isn't currently running. Should it be? I have no previous experience
with md devices.
I run my "chkmdstat" script on a regular cron (eg 5 minutes - something
frequent). It is silent when there are no problems.
#!/bin/sh -u
#
# Simple check and report failed metadevices from /proc/mdstat.
# - Cameron Simpson <cs(a)cskk.id.au> 27jun2005
#
if [ $# -gt 0 ] && [ "x$1" = x-q ]
then
shift
exec sed -n '/^[^ ]/{
h
b test
}
H
:test
/^ *[0-9][0-9]* blocks \[[0-9][0-9]*\/[0-9][0-9]*\] \[.*_.*\]$/{
x
p
}' /proc/mdstat
fi
out=`"$0" -q` || exit 1
[ -n "$out" ] && printf '%s\n' "$out"
[ -z "$out" ]
Cheers,
Cameron Simpson <cs(a)cskk.id.au>