This episode teaches array capacity expansion with mdadm --grow, adding devices to RAID 1/5/6/10, filesystem resize with resize2fs and xfs_growfs, plus reshape between levels and changing the chunk size along with its risks.

Episode 6 taught you how to replace disks. Episode 7 answers the question that usually comes next: how do you enlarge an array's capacity without rebuilding everything from scratch? The answer lies in two mdadm abilities: grow to add devices and reshape to change the array's structure.
Both operations are risky — your data survives during the process, but a single mistake can destroy the array. That's why this episode also emphasizes preparation: backup, carefully measuring components, and the patience to wait for the process to finish. Let's start with grow.
Grow is the process of increasing the number of active devices in a running array. For example, turning a two-disk RAID 1 into four disks, or a five-disk RAID 5 into six disks.
sudo mdadm --add /dev/md0 /dev/sdd
sudo mdadm --grow /dev/md0 --raid-devices=3The sequence above adds /dev/sdd as a member, then expands the array with --grow --raid-devices=3. The kernel starts a reshape to redistribute the data and parity across all disks — this process can run for hours depending on capacity.
While the grow runs, monitor it with:
cat /proc/mdstatThe /proc/mdstat output shows reshape = 33.2% with finish and speed. Let the process finish before touching the array. Don't cut the power in the middle of a reshape without a safety mechanism such as a UPS.
For RAID 5 and 6, grow only adds capacity if the reshape recalculates the stripe. After the reshape completes, mdadm --detail will show the enlarged size. But remember, the filesystem on top doesn't know about it yet — we'll adjust it in the next section.
After the array grows, the next step is to enlarge the filesystem. For ext4:
sudo resize2fs /dev/md0The resize2fs /dev/md0 command expands the filesystem to the array's full size without unmounting on modern ext4. Verify with df -h and blockdev --getsize64 /dev/md0.
For XFS, the resize must be done while mounted and uses a dedicated tool:
sudo xfs_growfs /mnt/raidThe xfs_growfs /mnt/raid output shows data blocks changed from ... to .... XFS cannot shrink, so make sure the target size is final before running this command.
Reshape changes the array's architecture: from RAID 5 to RAID 6, from RAID 1 to RAID 5, or changing the chunk size. Here's an example of moving from a three-disk RAID 5 to a four-disk RAID 6 (needs one additional disk):
sudo mdadm --add /dev/md0 /dev/sde
sudo mdadm --grow /dev/md0 --level=6 --raid-devices=4The --grow --level=6 command starts a reshape that takes a long time because the second parity must be calculated for all data. Make sure the resulting capacity matches your calculation: a four-disk RAID 6 leaves N-2 capacity.
The chunk size can also be changed without rebuilding:
sudo mdadm --grow /dev/md0 --chunk=128The mdadm --grow --chunk=128 command changes the stripe size, which affects performance. Large chunks suit sequential workloads, small chunks are better for random access. We'll discuss the performance impact in episode 18.
Reshape is the riskiest operation on this list:
Warning
Before growing or reshaping, make sure of three things: an up-to-date backup, stable power or a UPS, and a correctly calculated final capacity. Never start a reshape if the array is degraded or already in the middle of a rebuild.
Secure the conditions before growing or reshaping:
sudo mdadm --detail /dev/md0 | head -20
sudo smartctl -H /dev/sdbThe smartctl -H command shows the overall health status of a disk. Don't start any operation if a disk reports SMART overall-health self-assessment test result: FAILED or if the array is degraded.
Episode 7 equips you with growth skills: enlarging an array with --grow, adjusting the filesystem with resize2fs and xfs_growfs, and changing levels and chunk sizes via reshape — all without tearing the array down from scratch, but with strict preparation discipline.
Key takeaways:
mdadm --grow --raid-devices adds devices to a running array.resize2fs for ext4, xfs_growfs for xfs.smartctl before major operations.In the next episode, episode 8, we'll discuss ZFS RAIDZ (dRAID, AnyRaid) — ZFS filesystem-based parity, comparing RAIDZ1/2/3, RAIDZ expansion, plus dRAID and AnyRaid for large-scale storage. You'll see another side of RAID beyond mdadm.