All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Tóth Csaba" <csaba.toth@i3rendszerhaz.hu>
To: Neil Brown <neilb@suse.de>
Cc: linux-raid@vger.kernel.org
Subject: Re: convert raid10 to raid0
Date: Thu, 08 Jul 2010 01:34:03 +0200	[thread overview]
Message-ID: <4C350EEB.1060302@i3rendszerhaz.hu> (raw)
In-Reply-To: <20100708085034.2bc8272e@notabene.brown>

Hi,

2010.07.08. 0:50 keltezéssel, Neil Brown írta:
> On Wed, 07 Jul 2010 21:29:49 +0200
> Tóth Csaba <csaba.toth@i3rendszerhaz.hu> wrote:
> 
>> Hey List,
>>
>> i have a serious problem: have a file server with 4 disk (4x750GB),
>> using them in a software RAID10 array. One of the HDDs have a bad sector
>> (because some administration problems, i cannot replace them), and the
>> motherboard sometimes drops the connection with two HDDs. Not with the
>> same as the bad sector has, but with a resync i always managed the
>> problem. But now 3 drive form the RAID10 array dropped.
>>
>> In the past the sdc6 and the sdd6 partitions were the partitions i
>> resynced the others, so i know exactly where to look for the proper
>> datas. Can i use them as a RAID0 array somehow?
> 
> It should be sufficient to:
>   mdadm -S /dev/md5
>   mdadm -C /dev/md5 --level raid0 --raid-devices 2 --chunk 512 \
>       --metadata=1.1 /dev/sdc6 /dev/sdd6
> 
> to get your data available.
> There is a possible small complication though.  If you use a different
> version of mdadm to the one you used to create the array at first, it might
> choose a different 'data offset'.
> To be sure this doesn't happen, use
> 
>  mdadm -E /dev/sdc6
> 
> and take note of the "Data Offset".  It would probably be a good idea to keep
> a copy of "mdadm -E" of all of the devices, just to be on the same side.
> 
> Then after you create the raid0, use the same command
>    mdadm -E /dev/sdc6
> to check the Data Offset again and make sure it is the same.
> I suspect it will be, so everything will be fine.
> However if it isn't don't try to access the array.   Post the details and I'll
> figure out what to do next.
> 

i have made a small test case:

DTADIR=/mnt/data
MDF=/dev/md8

dd bs=512 count=180000 if=/dev/zero of=${DTADIR}/a
dd bs=512 count=180000 if=/dev/zero of=${DTADIR}/b
dd bs=512 count=180000 if=/dev/zero of=${DTADIR}/c
dd bs=512 count=180000 if=/dev/zero of=${DTADIR}/d

losetup /dev/loop0 ${DTADIR}/a
losetup /dev/loop1 ${DTADIR}/b
losetup /dev/loop2 ${DTADIR}/c
losetup /dev/loop3 ${DTADIR}/d

mdadm --create ${MDF} --level=10 --metadata=1.1 \
 --raid-devices=4 /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3
mkfs.ext4 ${MDF}

mkdir ${DTADIR}/tmp
mount ${MDF} ${DTADIR}/tmp
cp -a /etc ${DTADIR}/tmp
umount ${MDF}

mdadm -S ${MDF}
mdadm -C /dev/md5 --level raid0 --raid-devices 2 --chunk 512 \
--metadata=1.1 /dev/loop0 /dev/loop3

mount ${MDF} ${DTADIR}/tmp
ls -al ${DTADIR}/tmp

umount ${MDF}
mdadm -S ${MDF}
losetup --detach /dev/loop0 /dev/loop1 /dev/loop2 /dev/loop3



i used loop0 and loop3 to construct the raid0 array, because they were
at the same (0 and 3) position than the devices i had in my real raid10
array. so this should work, but not :(
but after i made a raid0 array, and than recreate the raid10 array it
worked well. can't i create a raid10 array with two drives?

regards,
Csaba
--
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

  reply	other threads:[~2010-07-07 23:34 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-07 19:29 convert raid10 to raid0 Tóth Csaba
2010-07-07 22:50 ` Neil Brown
2010-07-07 23:34   ` Tóth Csaba [this message]
2010-07-08  7:58   ` Tóth Csaba
2010-07-08  8:27     ` Tóth Csaba
2010-07-08 23:15       ` Neil Brown
2010-07-12 13:26         ` Tóth Csaba
2010-07-07 22:51 ` Tóth Csaba

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=4C350EEB.1060302@i3rendszerhaz.hu \
    --to=csaba.toth@i3rendszerhaz.hu \
    --cc=linux-raid@vger.kernel.org \
    --cc=neilb@suse.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.