Help, my disk array has one dead member

Karl Auer kauer at biplane.com.au
Wed Mar 22 03:19:15 UTC 2017


On Tue, 2017-03-21 at 19:06 -0700, Kevin O'Gorman wrote:
> I have a stripe array under mdadm, and one of the disks is dead or
> dying.
> [...]
> I'm looking for a way to copy the whole directory structure, just
> omitting any file or directory that reports an error in the process.

Get an external drive (USB3.0 or eSATA if you can support that) that is
as large or larger than the RAID's capacity. You will need to format
the drive to ext4 because you will be creating a very large file.

If you have plenty of network attached storage that allows huge files
you can put the destination file there instead - adjust the following
instructions accordingly.

Then use dd to take an image of the failing array; use the option to
skip errors rather than fail on them.

   dd if=/dev/XXX \
      of=/ext/drive/bigfile.dat \
      conv=noerror,fsync \
      bs=10M

...where XX is the SOURCE (your RAID device) and
/ext/drive/bigfile.data is the DESTIANTION - a file on the external
drive (probably /media/whatever). It may take quite a long time.

Do NOT confuse "if" and "of" in the dd command, or you will be most
royally screwed.

If you possibly can, do all this while booted off a live CD, so you can
copy the source without it being active.

Use (e.g.) /dev/sda as the source to get the whole drive, or /dev/sda1
to get just one partition (those are NOT the actual device names you
will need - use the correct device names for your RAID or partitions on
it).

The end result will be a huge file on the external drive. The huge file
will be a block-for-block copy of the failing RAID (or partition if you
went that way). You can mount this on a loopback and look around it at
your leisure. It will be as good as or better than the original, with
no risk of further loss.

Regards, K.

-- 
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Karl Auer (kauer at biplane.com.au)
http://www.biplane.com.au/kauer
http://twitter.com/kauer389

GPG fingerprint: A52E F6B9 708B 51C4 85E6 1634 0571 ADF9 3C1C 6A3A
Old fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B






More information about the ubuntu-users mailing list