linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bryce <bryce@zeniv.linux.org.uk>
To: Dragos <dragos@mpigani.org>
Cc: linux-raid@vger.kernel.org
Subject: Re: assemble vs create an array.......
Date: Fri, 30 Nov 2007 14:53:58 +0000	[thread overview]
Message-ID: <47502406.8080809@zeniv.linux.org.uk> (raw)
In-Reply-To: <474F869D.5040503@mpigani.org>

Dragos wrote:
> Hello,
> I had created a raid 5 array on 3 232GB SATA drives. I had created one 
> partition (for /home) formatted with either xfs or reiserfs (I do not 
> recall).
> Last week I reinstalled my box from scratch with Ubuntu 7.10, with 
> mdadm v. 2.6.2-1ubuntu2.
> Then I made a rookie mistake: I --create instead of --assemble. The 
> recovery completed. I then stopped the array, realizing the mistake.
>
> 1. Please make the warning more descriptive: ALL DATA WILL BE LOST, 
> when attempting to created an array over an existing one.
> 2. Do you know of any way to recover from this mistake? Or at least 
> what filesystem it was formated with.
>
> Any help would be greatly appreciated. I have hundreds of family 
> digital pictures and videos that are irreplaceable.
> Thank you in advance,
> Dragos
>
> -
> 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

Meh,...
I do that all the time for testing
The raid metadata is separate from the FS in that you can trash it as 
much as you like and the FS it refers to will be fine as long as you 
don't decide to mkfs over it
If you've an old /var/log/messages kicking around from when the raid was 
correct you should be able to extract the order eg,

RAID5 conf printout:
 --- rd:5 wd:5
 disk 0, o:1, dev:sdf1
 disk 1, o:1, dev:sde1
 disk 2, o:1, dev:sdg1
 disk 3, o:1, dev:sdc1
 disk 4, o:1, dev:sdd1

Unfortunately, there is no point looking at mdadm -E <participating 
disk> as you've already trashed the information there
Anyway From the above the recreation of the array would be

mdadm -C -l5 -n5 -c128  /dev/md0 /dev/sdf1 /dev/sde1 /dev/sdg1 /dev/sdc1 
/dev/sdd1
(where -l5 = raid 5, -n5 = number of participating drives and -c128 = 
chunk size of 128K)

IF you don't have the configuration printout, then you're left with 
exhaustive brute force searching of the combinations
disks. Unfortunately possible combinations increase geometrically and 
going beyond 8 disks is a suicidally *bad* idea

2=2
3=6
4=24
5=120
6=720
7=5040
8=40320

You only have 3 drives so only 6 possible combinations to try (unlike 
myself with 5)

So, just write yourself a small script with all 6 combinations and run 
them through a piece of shell similar to this pseudo script

lvchange -an /dev/VolGroup01/LogVol00 # if you use lvm at all (change as 
appropriate or discard)
mdadm --stop --scan
yes | mdadm -C -l5 -n3 /dev/md0  /dev/sdd1 /dev/sde1 /dev/sdf1 # 
(replaceable combinations)
lvchange -ay  /dev/VolGroup01/LogVol00 # if you use lvm (or discard)
mount /dev/md0 /mnt
# Lets use the success return code for mount to indicate we're able to 
mount the FS again and bail out (man mount)
if [ $? eq 0 ] ; then
     exit 0
fi




  parent reply	other threads:[~2007-11-30 14:53 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30  3:42 assemble vs create an array Dragos
2007-11-30  5:32 ` Neil Brown
2007-11-30 14:26   ` David Greaves
2007-12-01  6:48     ` Dragos
2007-12-01  7:23       ` Dragos
2007-12-04 13:14     ` Dragos
2007-12-05 11:39       ` David Greaves
2007-12-06 15:17         ` Dragos
2007-12-06 16:39           ` Michael Tokarev
2007-12-06 17:12             ` Eric Sandeen
2007-12-06 21:22             ` David Chinner
2008-02-03  7:42               ` Dragos
2007-11-30 14:53 ` Bryce [this message]
2007-11-30 17:40   ` Michael Tokarev
  -- strict thread matches above, loose matches on Subject: below --
2008-01-28  7:21 Dragos
2008-01-28  7:25 Dragos

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=47502406.8080809@zeniv.linux.org.uk \
    --to=bryce@zeniv.linux.org.uk \
    --cc=dragos@mpigani.org \
    --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).