linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: NeilBrown <neilb@suse.de>
To: Mark Knecht <markknecht@gmail.com>
Cc: Phil Turmel <philip@turmel.org>, Linux-RAID <linux-raid@vger.kernel.org>
Subject: Re: Reshape 3-drive RAID1 into 3-drive RAID-5
Date: Fri, 18 Nov 2011 13:24:50 +1100	[thread overview]
Message-ID: <20111118132450.3299aec8@notabene.brown> (raw)
In-Reply-To: <CAK2H+ee27ukAK08X+ZVPh6t-KH+A0013DR657PJtsuTbq=95gw@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1736 bytes --]

On Thu, 17 Nov 2011 13:44:04 -0800 Mark Knecht <markknecht@gmail.com> wrote:


> Hi all,
>    After reading through your responses and going over the man pages I
> got started. Here's the set of commands I have executed so far:
> 
> mdadm /dev/md6 --fail /dev/sdc6 --remove /dev/sdc6
> mdadm --zero-superblock /dev/sdc6
> mdadm --grow /dev/md6 --raid-devices=2
> 
> At this point I appear to have a good 2-drive RAID-1:
> 
> md6 : active raid1 sda6[0] sdb6[1]
>       247416933 blocks super 1.1 [2/2] [UU]
> 
> The next command was supposed to convert it to RAID-5 but doesn't work
> for me so far:
> 
> c2stable ~ # mdadm --grow /dev/md6 --level=5
> mdadm: /dev/md6: could not set level to raid5
> c2stable ~ #

This is because:

> /dev/md6:
>         Version : 1.1
>   Creation Time : Thu Apr 15 10:45:35 2010
>      Raid Level : raid1
>      Array Size : 247416933 (235.96 GiB 253.35 GB)
                    ^^^^^^^^^


This number is not a multiple of a usable chunk size.  I keep forgetting
about that issue.  I'll get mdadm to be more helpful in a future release.

You need to reduce the size of the array a little bit first.  That might mean
shrinking a filesystem that you have on it.

If you reduce it by 101K it will be a multiple of 1M which is good.

If the filesystem is extX, you can use resize2fs to make the filesystem
smaller first.  If it is something else ... you might have difficulty.

Once you think you are ready I would:

 mdadm -G /dev/md6 --size 241618M

 fsck /dev/md6  # just to me sure - if something is wrong you can
                # still increase the size again and nothing will be
                # lost
 mdadm -G /dev/md6 --level 5

NeilBrown



[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]

      reply	other threads:[~2011-11-18  2:24 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-11-15 15:13 Reshape 3-drive RAID1 into 3-drive RAID-5 Mark Knecht
2011-11-15 21:11 ` Phil Turmel
2011-11-15 23:40   ` NeilBrown
2011-11-17 21:44     ` Mark Knecht
2011-11-18  2:24       ` NeilBrown [this message]

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=20111118132450.3299aec8@notabene.brown \
    --to=neilb@suse.de \
    --cc=linux-raid@vger.kernel.org \
    --cc=markknecht@gmail.com \
    --cc=philip@turmel.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).