Thread (6 messages) 6 messages, 3 authors, 2013-07-25

Re: Preparing for mdadm-3.3

From: NeilBrown <hidden>
Date: 2013-06-24 23:38:24

On Mon, 24 Jun 2013 06:44:25 -0700 Mark Knecht [off-list ref] wrote:
On Mon, Jun 24, 2013 at 12:18 AM, NeilBrown [off-list ref] wrote:
<SNIP>
quoted
I somehow got unsubscribed from linux-raid (again) a few weeks back, so if
anything was sent to the list and not me that I should know about, now might
be a good time to resend that too.

Thanks,
NeilBrown
Neil,
   Welcome back. :-)

   I currently run mdadm-3.1.4 which is Gentoo stable. It seems that I
cannot change chunk size if the new chunk size doesn't divide evenly
into the number of sectors on the partition, or at least that's the
way I understand the message. Is that anything you've either worked on
or considered for mdadm?
In my mind, it should "obviously" work the way it does.  As you seem to think
differently, at least one of us must be missing something.

Each device (in a striped array) must contribute an integer number of chunks
to the array, otherwise you will get holes in the data.
So if you set the chunk size to something that doesn't divide into the size
of the device, then you will end up using less of the device.  And that means
that they array will become smaller.

Making the array smaller will mostly likely cause you to lose data.

If you really want to do that, you can.  Just set the size to something
appropriate and then change the chunk size.
  mdadm -G /dev/mdXX --size=smaller
  mdadm -G /dev/mdXX --chunk=different

Of course the "something appropriate" must be a multiple of both the old and
the new chunk sizes.  As chunk sizes are mostly powers of 2, that shouldn't be
a problem.

Maybe when mdadm reports that the chunk size doesn't divide the device size,
it could suggest a "--grow --size=" command to reduce the array size so that
it will.

Obviously you would need to resize any file system before resizing the array.

Does that address your issue?  Is there something that you are thinking that
I am missing?

Thanks,
NeilBrown

Attachments

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help