Moving existing RAID5 disks to an alternate server

Moving existing RAID5 disks to an alternate server

am 20.01.2011 04:05:52 von John Powell

So practically speaking I don't have hardly any experience managing
RAID volumes. I have used some LSI web bios's to create RAID volumes
of various forms for functional dev/test and am familiar enough with
the terminology and implementation but when left with the choice of
building my own home NAS or buying some proprietary piece of hardware
pre-configured I chose the later in the interest of time and money.
Perhaps I made a poor choice there as my proprietary hardware died and
has left me with a seemingly intact RAID 5 volume spanned over 4 500GB
PATA disks. Seeing as how the hardware is bricked I am going to
attempt to pull out those disks and configure a RAID5 volume on a
custom built machine, (something I constructed over 5 years ago.. it
still as PATA interfaces :D ). The goal here is to copy the contents
of this volume to an alternate server that I will be using for backups
with some more updated hardware.

Anyhow, the point of my post: Is it really as simple as it sounds? Use
mdadm to recreate the RAID5 volume and away I go? Are there any
details that one can offer that I may need to be aware of or is simply
reading the man pages and various HOWTO's out on the net enough to get
started? Obviously I am taking this slow as the data on the disks is
important to me.

Thanks for your time in advance!
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Moving existing RAID5 disks to an alternate server

am 20.01.2011 05:48:04 von NeilBrown

On Wed, 19 Jan 2011 19:05:52 -0800 John Powell wrote:

> So practically speaking I don't have hardly any experience managing
> RAID volumes. I have used some LSI web bios's to create RAID volumes
> of various forms for functional dev/test and am familiar enough with
> the terminology and implementation but when left with the choice of
> building my own home NAS or buying some proprietary piece of hardware
> pre-configured I chose the later in the interest of time and money.
> Perhaps I made a poor choice there as my proprietary hardware died and
> has left me with a seemingly intact RAID 5 volume spanned over 4 500GB
> PATA disks. Seeing as how the hardware is bricked I am going to
> attempt to pull out those disks and configure a RAID5 volume on a
> custom built machine, (something I constructed over 5 years ago.. it
> still as PATA interfaces :D ). The goal here is to copy the contents
> of this volume to an alternate server that I will be using for backups
> with some more updated hardware.
>
> Anyhow, the point of my post: Is it really as simple as it sounds? Use
> mdadm to recreate the RAID5 volume and away I go? Are there any
> details that one can offer that I may need to be aware of or is simply
> reading the man pages and various HOWTO's out on the net enough to get
> started? Obviously I am taking this slow as the data on the disks is
> important to me.
>

"slowly" is good. You could easily make a mess. But with suitable care you
will probably be able to get access to all of your data.

The issues are:
1/ you need to know the correct order of the devices. They might be in the
"obvious" order, though if you have ever had a device fail and had to
replace it, they might not.

2/ you need to know the 'chunk size' and 'layout'. It is possible to
discover these by trial and error, but much easier if you can know for
certain somehow.

3/ you need to know which parts of the devices container data and which
parts contain metadata. Typically the metadata is at the end and the data
is at the start of the device. This is certainly easiest to work with and
is most likely, but safest not to assume.


If you can answer all those questions with certainty it is quite easy to get
your data back.

As a first step I would see if the metadata is recognised by mdadm or dmraid.
e.g.
mdadm --examine /dev/sdXXX
or
dmraid --raid-devices /dev/sdXXX

If you get something informative, report that and we'll go from there. Don't
assume that just because either of them recognise the format, that they can
work.

If not you will need to try something like:

mdadm -C /dev/md0 -e 1.0 -l5 -n4 --chunk=128 --layout=ra \
--assume-clean /dev/sdXX /dev/sdYY ....

and then examine the data on /dev/md0. If it doesn't look perfect, change
the chunk size, the layout, or the order of the devices until you find
something that works.

Note that this over-writes about 8K at the end of each device. This probably
does not container important data, but a paranoid person might take a copy of
the last megabyte from each device first, just to be on the safe side.

Note that if you leave out 'assume-clean' then you might be in trouble ... or
you might not, but I cannot make any promises.

NeilBrown
--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: Moving existing RAID5 disks to an alternate server

am 20.01.2011 11:28:42 von John Robinson

On 20/01/2011 03:05, John Powell wrote:
[...]
> Anyhow, the point of my post: Is it really as simple as it sounds? Use
> mdadm to recreate the RAID5 volume and away I go? Are there any
> details that one can offer that I may need to be aware of or is simply
> reading the man pages and various HOWTO's out on the net enough to get
> started? Obviously I am taking this slow as the data on the disks is
> important to me.

Well, you might be really lucky and find that a few mdadm --examine
commands give you all you need to know, or even that whatever distro you
run auto-detects and starts your array, but given that the data is
valuable, I'd recommend making images of the discs and working with
those instead.

First up, use smartctl to check the drives don't have bad sectors. If
they do, and perhaps even if they don't, ddrescue or dd_rescue is your
friend (I don't know which is better).

Then, if you have another 4 drives of exactly the same size, that's
perfect, but you probably don't. If your PATA drives are relatively
small, you might be as well dd'ing or dd_rescuing all four drives to
images on a new larger SATA drive, then mounting the images via loopback
devices.

If you have trouble reading any of the drives for any reason, you might
make a backup copy of the image before starting to test it, or look at
some previous ideas on this list about making Copy-on-Write devices on
top of your loopback devices. This may be paranoia but may be worth
reading about, just to give you the option.

Then you can start poking the images with mdadm, dmraid, and perhaps
kpartx to activate any partitions, and report back as Neil suggested in
his post.

Best of luck.

Cheers,

John.

--
To unsubscribe from this list: send the line "unsubscribe linux-raid" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html