Re: Reshape 3-drive RAID1 into 3-drive RAID-5

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 17 Nov 2011 13:44:04 -0800 Mark Knecht <markknecht@xxxxxxxxx> 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: signature.asc
Description: PGP signature


[Index of Archives]     [Linux RAID Wiki]     [ATA RAID]     [Linux SCSI Target Infrastructure]     [Linux Block]     [Linux IDE]     [Linux SCSI]     [Linux Hams]     [Device Mapper]     [Device Mapper Cryptographics]     [Kernel]     [Linux Admin]     [Linux Net]     [GFS]     [RPM]     [git]     [Yosemite Forum]


  Powered by Linux