Linux RAID subsystem development
 help / color / mirror / Atom feed
From: Neil Brown <neilb@suse.de>
To: "Tóth Csaba" <csaba.toth@i3rendszerhaz.hu>
Cc: linux-raid@vger.kernel.org
Subject: Re: convert raid10 to raid0
Date: Fri, 9 Jul 2010 09:15:48 +1000	[thread overview]
Message-ID: <20100709091548.38d32082@notabene.brown> (raw)
In-Reply-To: <4C358C02.7020109@i3rendszerhaz.hu>

On Thu, 08 Jul 2010 10:27:46 +0200
Tóth Csaba <csaba.toth@i3rendszerhaz.hu> wrote:

> 2010.07.08. 9:58 keltezéssel, Tóth Csaba írta:
> > 2010.07.08. 0:50 keltezéssel, Neil Brown írta:
> >> 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.
> >>
> > 
> > It doesn't work, [...]
> 
> forget to explain what i did: my idea was to create a new array with
> --assume-clean, than kick out the knowed bad members:
> 
> minerva data-bck # mdadm --create /dev/md5 --assume-clean --metadata=1.1
> --level=10 --raid-devices=4 /dev/sdb6 /dev/sda6 /dev/sdc6 /dev/sdd6
> mdadm: /dev/sdb6 appears to be part of a raid array:
>     level=raid10 devices=4 ctime=Thu Jul  8 09:47:43 2010
> mdadm: /dev/sda6 appears to be part of a raid array:
>     level=raid10 devices=4 ctime=Thu Jul  8 09:47:43 2010
> mdadm: /dev/sdc6 appears to be part of a raid array:
>     level=raid10 devices=4 ctime=Thu Jul  8 09:47:43 2010
> mdadm: /dev/sdd6 appears to be part of a raid array:
>     level=raid10 devices=4 ctime=Thu Jul  8 09:47:43 2010
> Continue creating array? yes
> mdadm: array /dev/md5 started.
> minerva data-bck #
> minerva data-bck # man mdadm
> minerva data-bck # mdadm /dev/md5 --fail /dev/sda6 --fail /dev/sdc6
> mdadm: set /dev/sda6 faulty in /dev/md5
> mdadm: set /dev/sdc6 faulty in /dev/md5
> minerva data-bck # cat /proc/mdstat
> Personalities : [linear] [raid0] [raid1] [raid10] [raid6] [raid5]
> [raid4] [multipath] [faulty]
> md5 : active raid10 sdd6[3] sdc6[2](F) sda6[1](F) sdb6[0]
>       1434617856 blocks super 1.1 512K chunks 2 near-copies [4/2] [U__U]
> 
> 
> this is exactly the same layout as i had before, just the data offset
> doesn't match.
>

OK, there are two things you can do - both might be interesting.

1/ You can temporarily adjust the data offset by writing directly to sysfs.

   cd /sys/block/md5/md
   echo inactive > array_state
   echo 592 > dev-sdb6/offset
   echo 264 > dev-sdd6/offset
   echo readonly > array_state

   Now you should be able to examine you data and assure yourself that it is
   all there.  However this doesn't change the metadata so when you stop and
   restart the array the offset will be back where it started.

2/ hack the code in 'super1.c' and re-create the array.
   in write_init_super1, after the 'switch' statement that set data_offset,
   put
     if (strcmp(di->devname, "/dev/sdb6") ==0) sb->data_offset =  __cpu_to_le64(592);
     if (strcmp(di->devname, "/dev/sdd6") ==0) sb->data_offset =  __cpu_to_le64(264);

   ofcourse you should check that code and make sure you agree that I have
   written it correctly.

I plan to enhance mdadm so you can 'recreate' and array - it then takes
offsets etc out of current metadata and only changes the bits you ask it to
change.  Had I done this already this would have been a lot easier for you,
but unfortunately I haven't.

good luck,
NeilBrown

--
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-08 23:15 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
2010-07-08  7:58   ` Tóth Csaba
2010-07-08  8:27     ` Tóth Csaba
2010-07-08 23:15       ` Neil Brown [this message]
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=20100709091548.38d32082@notabene.brown \
    --to=neilb@suse.de \
    --cc=csaba.toth@i3rendszerhaz.hu \
    --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