Linux RAID subsystem development
 help / color / mirror / Atom feed
From: John Robinson <john.robinson@anonymous.org.uk>
To: Alex <mysqlstudent@gmail.com>
Cc: linux-raid@vger.kernel.org
Subject: Re: Assembling array with missing members
Date: Mon, 01 Aug 2011 10:37:06 +0100	[thread overview]
Message-ID: <4E3673C2.7070607@anonymous.org.uk> (raw)
In-Reply-To: <CAB1R3sjuUEVAPLgGNdnwnyHVir3bEGOT9iOSdYBz+QSs+2fhaA@mail.gmail.com>

On 01/08/2011 05:51, Alex wrote:
> Hi,
> I have an old fedora server with a raid1 and raid5 array comprised of
> four disks. One of the disks just died, and in the process of trying
> to replace the disk, the server will for some reason no longer boot. I
> think it was a problem with my initrd. I've since replaced the
> defective disk (sdd) with a new one and created the fd partitions the
> same size as they were originally.

The usual way to do this is
   sfdisk -d /dev/originaldevice | sfdisk /dev/newdevice

But I usually do it as follows, to copy the rest of the boot sector and 
grub stuff:
   dd if=/dev/originaldevice of=/dev/newdevice bs=512 count=63
   blockdev --rereadpt /dev/newdevice

(If the original partitions started at 1MB instead of the second 
cylinder, it would have been count=2048 above.)

In both cases, originaldevice is a still-existing original RAID member disc.

> Booting from a current rescue CDROM
> and trying to use mdadm to reassmble the raid5 array, and I'm having a
> problem:
>
> % mdadm --assemble --auto=yes  /dev/md1 /dev/sd[abcd]2
> mdadm: no RAID superblock on /dev/sdd2
> mdadm: /dev/sdd2 has no superblock - assembly aborted

That's right, you shouldn't have asked it to include sdd2 as it doesn't 
yet have a RAID superblock on it.

[...]
> I'm really not sure what to do next and obviously would like to do
> everything possible to save the array.
>
> How can I either have mdadm rebuild the array using the new disk or
> start in degraded mode so I can rescue the data? Perhaps there's
> another option?

Assemble it without sdd2 which currently has no superblock, then add the 
new drive:

mdadm --stop /dev/md1
mdadm --assemble /dev/md1 --auto=yes /dev/sd[abc]2
mdadm --manage /dev/md1 --add /dev/sdd2

This will start the rebuild process and after a while (with 1TB drives, 
maybe a day) and assuming the rebuild goes well, you'll be fully 
operational again.

I imagine you will also want to add sdd1 to md0 in a similar manner.

Cheers,

John.


  reply	other threads:[~2011-08-01  9:37 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAB1R3siG=FOXXq5kRx5N8O7ExCiM=0ic0xakYpfKZH1FOROXoQ@mail.gmail.com>
2011-08-01  4:51 ` Assembling array with missing members Alex
2011-08-01  9:37   ` John Robinson [this message]
2011-08-01 11:12     ` Alex
2011-08-01 11:17       ` Mikael Abrahamsson
2011-08-02  4:26         ` Alex

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4E3673C2.7070607@anonymous.org.uk \
    --to=john.robinson@anonymous.org.uk \
    --cc=linux-raid@vger.kernel.org \
    --cc=mysqlstudent@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox