I decided to make this blog entry because I could not find any information on growing (/resizing) an mdraid RAID10 array. It is important to start with a disclaimer, as follows:
- Do not try this at home
- Your mileage may vary
- -ALWAYS- — back up your data before trying to do any of this
- This guide is not for the faint of heart, and does not cover in-depth commands
This guide’s purpose is to state that it is possible to resize a mdraid RAID10 array, and to tell you how I did it.
Definitions and Tools
resize — for the purpose of this guide is the operation in which we replace each of the individual disks in a raid10 array with a larger one.
raid10 — in this example I resized a very special case of RAID10 – the 2-disk RAID10 using the near layout. This is equivalent to a raid1, but with better performance according to some guides from the distant past
mdadm — this guide was performed using mdadm version 4.1 on Xubuntu 20.04 liveusb with kernel 5.4.0
Preparation
I chose to copy each disk first to the larger replacement keeping the partitions intact. My disks had 2 partitions, both mdadm, the first a boot partition and the second the system partition. This operation was completed with clonezilla. Clonezilla made a mess out of the first partition using disk-to-disk local copy, but did it’s job for the second, the one that was later resized.
Gparted helped out with the copy operation of the first partition, using it’s nice copy-paste function. GParted did not have a bar of resizing the fd (Linux raid autodetect) partition however. Luckily parted did it without batting an eyelid.
By this stage you need to have your raid disks copied to their larger siblings and partitions resized.
Doing the deed
When you assemble the raid, the size is same with what you’ve started from. The little video below will show you the result when you assemble, then grow your array.
Conclusions
You can resize mdraid raid10 arrays, but I suggest you consider the time+fear factor and wonder whether you should.