This is a continuation of the “Setting up a RAID Array with mdadm”

In this article, I will show you how to add two more drives (in my case, two more 1.5TB drives) and expand the array to use the new space.

So I’ve got my two new drives, /dev/sdf and /dev/sdg

1: Use fdisk to partition them with one single partition using the “Linux Raid Autodetect” option. Make sure to use “w” to write the options to the drive. 2: # umount /raid (or wherever your array is mounted) 3: # mdadm –add /dev/md0 /dev/sdf 4: # mdadm –add /dev/md0 /dev/sdg 5: # mdadm –grow /dev/md0 –raid-devices=6 6: Wait for the grow operation to end. During this time, cat /proc/mdstat to view progress. After this is done, move on. 7: # mount /dev/md0 /raid 8: # mount -o remount,resize /raid

And thats it.. Go ahead and run df -h to see the new size of your array!

Note: Your partitions will probably be /dev/sdfp1 instead of just /dev/sdf like mine were. That’s fine and make sure you specify that partition to mdadm.

Mario Loria is a builder of diverse infrastructure with modern workloads on both bare-metal and cloud platforms. He's traversed roles in system administration, network engineering, and DevOps. You can learn more about him here.