On 01/06/16 02:49, Wols Lists wrote:
When the new drives arrive, copy each old drive in turn onto a new drive...
dd if=/dev/sda of=/dev/sde
etc etc. Expect it to take a little while ... (others may chime in and
tell you to use ddrescue rather than dd - I don't know which one is
best, both should work).
Do NOT use dd on a drive with bad sectors.... ever....
Using dd like you prescribe above will simply abort when it hits the
first read error. Using dd with the 'noerror' option will appear to work
and make you feel all warm and fuzzy, until you eventually realize that
when it encounters a read error, it skips that input block but does
*not* pad the output appropriately. So you wind up with everything after
the first read error in the wrong place on the disk. That will never end
well.
Use one of the ddrescue style of applications to guarantee everything
comes out where it needs to be regardless of input read errors.
Now, having said that :
Much better to try and get the array running in a read-only state with
all disks in place and clone the data from the array rather than the
disks after they've been ddrescued. In the case of a running array, a
read error on one of the array members will see the RAID attempt to get
the data from elsewhere (a reconstruction), whereas a read from a disc
cloned with ddrescue will happily just report what was a faulty sector
as a big pile of zeros, and *poof* your data is gone.
Set the timeouts appropriately (and conservatively) to give the disks
time to actually report they can't read the sector. This will allow md
to try and get it elsewhere rather than kicking the disc out because the
storage stack timed it out as faulty.
Brad.
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html