linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shaohua Li <shli@kernel.org>
To: Santiago DIEZ <santiago.diez@caoba.fr>
Cc: Linux Raid LIST <linux-raid@vger.kernel.org>,
	songliubraving@fb.com, Jes.Sorensen@redhat.com
Subject: Re: How to fix mistake on raid: mdadm create instead of assemble?
Date: Fri, 21 Oct 2016 15:35:24 -0700	[thread overview]
Message-ID: <20161021223524.GB105663@kernel.org> (raw)
In-Reply-To: <CAJh8RqU7kcTrp_1Rgorx02OR5H5bm-a8=DSvQz-Bkrg7S3357w@mail.gmail.com>

On Fri, Oct 21, 2016 at 10:45:10AM +0200, Santiago DIEZ wrote:
> Hi,
> 
> Thanks Andreas,
> 
> Yes apparently, 3/4 of the original disks seem to be safe. But I'm
> terrified at the idea of doing something wrong assembling them.
> Incidentally, I indeed did a mistake trying to assemble the ddrescue
> images of the 3 safe disks. I tried to create again with proper
> metadata and chunck but it did not work. I'm still scared at the idea
> of restarting the original raid. I'm currently ddrescuing again the 3
> partitions to then try and *assemble* them rather than *create*.
> 
> 
> Thanks Wol,
> 
> I use loop devices because I work on partition images, not on actual partitions:
> I use ddrescue to copy data from /dev/sd[abc]10 to
> some.other.server:/home/sd[abc].img
> Then I go to some.other.server and turn the images into loop devices :
> losetup /dev/loop0 /home/sda10.img
> losetup /dev/loop1 /home/sdb10.img
> losetup /dev/loop2 /home/sdc10.img
> Then I tried to created the raid, it worked but as I said, the
> filesystem was unreadable.
> I know the idea of using loop devices works because I tested it before.
> I'm doing the whole procedure all over again (takes 5 days to ddrescue
> the 3 partitions to another server) and then I will use the command
> you recommended :
> mdadm --assemble /dev/md0 /dev/loop0 /dev/loop1 /dev/loop2 --force
> 
> 
> Will keep you posted
> 
> -------------------------
> Santiago DIEZ
> Quark Systems & CAOBA
> 23 rue du Buisson Saint-Louis, 75010 Paris
> -------------------------
> 
> On Mon, Oct 10, 2016 at 12:39 AM, Wols Lists <antlists@youngman.org.uk> wrote:
> >
> > On 08/10/16 13:30, Andreas Klauer wrote:
> > > On Fri, Oct 07, 2016 at 05:37:32PM +0200, Santiago DIEZ wrote:
> > >> > First thing I did is ddrescue the remaining partitions sd[abc]10 .
> > >> > ddrescue did not stumble into any read error so I assume all remaining
> > >> > partitions are perfectly safe.
> > > So ... don't you still have a good copy?
> > >
> > > You only killed one of them, right? Did not make same mistake twice?
> > >
> > >> > There comes my mistake: I ran the --create command instead of --assemble :
> > >> >
> > >> > ================================================================================
> > >> > # mdadm --create --verbose /dev/md1 --raid-devices=4 --level=raid5
> > >> > --run --readonly /dev/loop0 /dev/loop1 /dev/loop2 missing
> >
> > One oddity I've noticed. You've created the array using loop devices.
> > What are these?
> >
> > The reason I ask is that using loopback devices is a standard technique
> > for rebuilding a damaged array, specifically to prevent md from actually
> > writing to the drive. So is it possible that "mdadm --create" only wrote
> > to ram, and a reboot will recover your ddrescue copies untouched?
> >
> > My raid-fu isn't enough to tell me whether I'm right or not ... :-)
> >
> > If necessary you'll have to do another ddrescue from the original
> > drives, and you should then be able to assemble the array from the
> > copies. Don't use "missing", use "--force" and you should get a working,
> > degraded, array to which you can add a new drive and rebuild the array.
> >
> > mdadm --assemble /dev/md0 /dev/sd[efg]10 --force
> >
> > if I'm right ... so long as it's the copies, you can always recover
> > again from the original disks, and if there's a problem with the copies
> > mdadm should complain when it assembles the array.

Hmm, those commands work for me. I'm adding Song and Jes if they have ideas.

Thanks,
Shaohua

  reply	other threads:[~2016-10-21 22:35 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-10-07 15:37 How to fix mistake on raid: mdadm create instead of assemble? Santiago DIEZ
2016-10-08 12:30 ` Andreas Klauer
2016-10-09 22:39   ` Wols Lists
2016-10-21  8:45     ` Santiago DIEZ
2016-10-21 22:35       ` Shaohua Li [this message]
2016-10-24 13:02         ` Santiago DIEZ

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=20161021223524.GB105663@kernel.org \
    --to=shli@kernel.org \
    --cc=Jes.Sorensen@redhat.com \
    --cc=linux-raid@vger.kernel.org \
    --cc=santiago.diez@caoba.fr \
    --cc=songliubraving@fb.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;
as well as URLs for NNTP newsgroup(s).