(original article)

Re: Converting RAID5 to RAID6 and other shape changing in md/raid

05 October 2010, 04:14 UTC

hi Brad,

The short answer is that I completely agree.

The longer answer includes:

1/ if you can make the underlying device larger while md is still using it, you can tell md to see more of it by writing to /sys/block/mdXXX/md/dev-YYY/size. Writing '0' means 'use all the space'. After doing this to all devices, you can "mdadm --grow --size max" to make use of it. However it is not possible to resize regular partitions, only 'dm' partitions. Certainly it would also help if mdadm did more of this for you.

2/ The default metadata with most recent mdadm is 1.2 - at the start of the device. However Debian patched it back to 1.0 because grub/lilo cannot boot from a 1.2 array.

3/ Moving the metadata to the front requires shuffling all the data down a bit. That could be done, but would take a lot of time (and some new code). I'll keep it in mind.

4/ With 1.1 or 1.2 metadata this is very easy to do off-line. Simply stop the array, resize all the devices, the assemble the array with "--update=devicesize"

5/ To do this off-line with 1.0 or 0.90 metadata you would need to backup the metadata, then resize the device, then restore the metadata. I hope to add that functionality to mdadm-3.2

6/ I could probably add an ioctl to the block layer so that partitions can be resized... I'll look into that.

Thanks for your valuable feed back.