From: NeilBrown <neilb@suse.de>
To: Craig Curtin <craigc@prosis.com.au>
Cc: Andy Smith <andy@strugglers.net>,
"linux-raid@vger.kernel.org" <linux-raid@vger.kernel.org>
Subject: Re: Shrinking number of devices on a RAID-10 (near 2) array
Date: Sun, 24 Aug 2014 16:45:07 +1000 [thread overview]
Message-ID: <20140824164507.4954df45@notabene.brown> (raw)
In-Reply-To: <E78FE8BDBAD07C43A60163E7D1716EEC0183A72805@PROSIS-W2K8-1.prosis.local>
[-- Attachment #1: Type: text/plain, Size: 4992 bytes --]
On Sun, 24 Aug 2014 06:28:25 +0000 Craig Curtin <craigc@prosis.com.au> wrote:
> Neil,
>
> I assume you would need to shrink the filesystem first before this ? or does MDADM nicely do that as part of the process also ?
mdadm is not a jack-of-all-trades. It won't touch your filesystem.
A careful look at Andy's "mdadm --detail" shows:
> > Array Size : 471859200 (450.00 GiB 483.18 GB)
> > Used Dev Size : 309363520 (295.03 GiB 316.79 GB)
This is a near=2 6 drive RAID10, so Array Size should be 3 times Used Dev
Size.
The fact that it isn't shows that he has already explicitly set the
--array-size to something appropriate. I'm sure he reduced the size of the
filesystem first as the man page says:
Before reducing the size of the array you should make sure that
space isn't needed. If the device holds a filesystem, you would
need to resize the filesystem to use less space.
If you try to resize an array to fewer drives and you haven't adjusted the
--array-size already, mdadm will tell you what --array-size you need. This
forces you into a two (at least) step process to minimize the chance of doing
something silly.
The idea is that you "--grow --array-size" first, then use "fsck" to make
sure the filesystem is still happy. Then use "--grow --raid-disks" to
reshape the array without changing the size.
If you change the array size and get it wrong, you can always put it back.
But once you start the reshape happening, you will have lost any data beyond
"array-size".
NeilBrown
>
> Craig
>
> -----Original Message-----
> From: linux-raid-owner@vger.kernel.org [mailto:linux-raid-owner@vger.kernel.org] On Behalf Of NeilBrown
> Sent: Sunday, 24 August 2014 1:10 PM
> To: Andy Smith
> Cc: linux-raid@vger.kernel.org
> Subject: Re: Shrinking number of devices on a RAID-10 (near 2) array
>
> On Sat, 23 Aug 2014 16:31:10 +0000 Andy Smith <andy@strugglers.net> wrote:
>
> > Hi,
> >
> > I am aware that for a very long time it was not possible to change the
> > number of devices in an mdadm RAID-10. But then recently I am sure I
> > saw threads here alluding to this being possible. e.g.:
> >
> > http://marc.info/?l=linux-raid&m=140768923829685&w=2
> >
> > I have a 6 device RAID-10 near=2 array that I would like to shrink
> > down to 4 devices.
> >
> > I have compiled mdadm 3.3.2 and am using kernel 3.16.0.
> >
> > $ sudo mdadm --detail /dev/md2
> > /dev/md2:
> > Version : 0.90
> > Creation Time : Sun Jun 4 08:18:58 2006
> > Raid Level : raid10
> > Array Size : 471859200 (450.00 GiB 483.18 GB)
> > Used Dev Size : 309363520 (295.03 GiB 316.79 GB)
> > Raid Devices : 6
> > Total Devices : 6
> > Preferred Minor : 2
> > Persistence : Superblock is persistent
> >
> > Update Time : Sat Aug 23 15:23:38 2014
> > State : active
> > Active Devices : 6
> > Working Devices : 6
> > Failed Devices : 0
> > Spare Devices : 0
> >
> > Layout : near=2
> > Chunk Size : 64K
> >
> > UUID : 3905b303:ca604b72:be5949c4:ab051b7a
> > Events : 0.312149991
> >
> > Number Major Minor RaidDevice State
> > 0 8 51 0 active sync /dev/sdd3
> > 1 8 67 1 active sync /dev/sde3
> > 2 8 83 2 active sync /dev/sdf3
> > 3 8 19 3 active sync /dev/sdb3
> > 4 8 35 4 active sync /dev/sdc3
> > 5 8 3 5 active sync /dev/sda3
> >
> > $ sudo ./mdadm --grow -n4 /dev/md2 --backup-file /var/tmp/mdadm.backup
> > mdadm: Cannot set new_data_offset: RAID10 reshape not
> > supported on this kernel
> >
> > Is that not yet possible, then?
> >
> > (Each device is 320GB so it should all fit with only four of them)
>
> raid10 reshape is only supported for v1.x metadata, and you have 0.90.
> This is because it needs to move the data_offset and 0.90 cannot do that.
>
> I see you have already adjusted the --array-size correctly - good.
>
> You can achieve your result by:
>
> 1/ stop the array and assemble with --update=metadata. This will convert the
> array to v1.0
> 2/ "mdadm /dev/md2 --grow --disks=4" That should perform the reshape.
> You don't need a --backup-file with RAID10 ... or with other arrays if you
> have recent tools and enough space before or after.
>
> I guess the error message could be better....
>
> NeilBrown
>
> Disclaimer
>
> CONFIDENTIAL
>
> This message contains confidential information and is intended only for the intended recipients. If you are not the named addressee you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately by e-mail if you have received this e-mail by mistake and delete this e-mail from your system.
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 828 bytes --]
next prev parent reply other threads:[~2014-08-24 6:45 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-08-23 16:31 Shrinking number of devices on a RAID-10 (near 2) array Andy Smith
2014-08-24 3:09 ` NeilBrown
2014-08-24 6:28 ` Craig Curtin
2014-08-24 6:45 ` NeilBrown [this message]
2014-08-24 13:19 ` Andy Smith
2014-08-24 14:39 ` Andy Smith
2014-08-25 10:32 ` Andy Smith
2014-08-25 11:26 ` NeilBrown
2014-08-25 11:34 ` Andy Smith
2014-08-28 9:53 ` Andy Smith
2014-08-29 3:53 ` NeilBrown
2014-08-29 4:02 ` Andy Smith
2014-08-29 4:18 ` NeilBrown
2014-08-29 4:26 ` Andy Smith
2014-08-29 4:35 ` NeilBrown
2014-08-29 4:42 ` Andy Smith
2014-08-29 6:04 ` NeilBrown
2014-08-29 20:45 ` Andy Smith
2014-08-29 20:47 ` [PATCH 1/1] Grow: Report when grow needs metadata update Andy Smith
2014-09-03 3:28 ` NeilBrown
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=20140824164507.4954df45@notabene.brown \
--to=neilb@suse.de \
--cc=andy@strugglers.net \
--cc=craigc@prosis.com.au \
--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).