Skip to main content

Extending RAID

Prepare new disk
                Need to partition? Do it now. I'll wait...

Setup: The current RAID has 4 drives and we want to add a 5th drive. The current array is "md111" and we have already checked drives on the system lsblk to see which drive we will be adding "sdd1"

Add disk to RAID
mdadm --add /dev/md111 /dev/sdd1

mdadm --add /current/drive/array (array that already has the other raid dirves in it) /new/drive/to/add (the 1 drive that you will be adding)

Grow RAID:
mdadm --grow --raid-devices=4 /dev/md111 This will grow your current array to accept a new drive

Now that you have expanded the underlying partition, you must now resize your filesystem to take advantage of it.
You may want to perform an fsck on the file system first to make sure there are no underlying issues before attempting to resize the file system

Integrity Check: e2fsck -f /dev/md111

Resize array: resize2fs /dev/md111

Mount it: mount /dev/md111 /your/new/local/location

Check RAID rebuild status or Current status
cat /proc/mdstat

Sources you can use:
https://raid.wiki.kernel.org/index.php/Growing