linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Daniel Iliev <daniel.iliev@gmail.com>
To: linux-raid@vger.kernel.org
Subject: raid10 problem with spare disk
Date: Sat, 08 Aug 2009 21:24:12 +0300	[thread overview]
Message-ID: <1249755852.5095.86.camel@ilievnet.com> (raw)

Hi,

I have (had!?) a raid10 built of sd[a-d]3, with 2 far copies
on /dev/md2.

sda died.
Next the ext4 on md2 got damaged beyond fsck repair. This has nothing to
do with the raid, but is still relevant. The FS had 2 dirs for which
fsck was reporting "have null as parent" Fix<y>", but couldn't really
fix it. Anyway the FS is/was still mountable and readable and I decided
to get smart. The idea was:

physically attach the new sda (I've already received the replacement
disk)
mdadm /dev/md2 --fail /dev/sdc3
mdadm /dev/md2 --remove /dev/sdc3

(to use its space together with sda for backup & restore)

mkfs.ext4 /dev/sda
mkfs.ext4 /dev/sdc

mkdir -r /mnt/sd{a,c}
mount /dev/sda /mnt/sda
mount /dev/sdc /mnt/sdc

tar cpf /mnt/sda/backup1.tar /home/data/<half/the/data/>
tar cpf /mnt/sdc/backup2.tar /home/data/<the/rest>

umount /dev/md2
mkfs.ext4 /dev/md2
mount /dev/md2

tar xpf /mnt/sda/backup1.tar -C /home/data/
tar xpf /mnt/sdc/backup2.tar -C /home/data/
umount /mnt/*
rm -r /mnt/sd?

sfdisk -d /dev/sdb | sfdisk /dev/sda
sfdisk -d /dev/sdb | sfdisk /dev/sdc

mdadm /dev/md2 -add /dev/sda3
mdadm /dev/md2 -add /dev/sdc3


What happened is that I removed sdc3, mounted md2, saw the data,
unmounted md2 and tried to "mdadm /dev/md2 --re-add /dev/sdc3", so I'd
go trough the backup & restore routine later.

Unfortunately for some reason mdadm added sdc3 as spare. I stopped md2
and tried to assemble it again, but this time mdadm said there wera no
eneough drives to start the array and sdc3 was still marked as spare.

Is there any chance to get this array working with sd[b-d]3 only and
execute the initial plan?


             reply	other threads:[~2009-08-08 18:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-08-08 18:24 Daniel Iliev [this message]
2009-08-08 21:17 ` raid10 problem with spare disk NeilBrown
2009-08-09  7:55   ` Daniel Iliev
2009-08-09 10:43     ` NeilBrown
2009-08-10  7:14       ` Daniel Iliev

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=1249755852.5095.86.camel@ilievnet.com \
    --to=daniel.iliev@gmail.com \
    --cc=linux-raid@vger.kernel.org \
    /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;
as well as URLs for NNTP newsgroup(s).