Skip to content

Instantly share code, notes, and snippets.

@jordelver
Last active December 21, 2015 05:59
Show Gist options
  • Save jordelver/6260618 to your computer and use it in GitHub Desktop.
Save jordelver/6260618 to your computer and use it in GitHub Desktop.
Add a new disk to a RAID 5 array

Add a new disk to a RAID 5 array

Create a new partition

Create new primary partition

fdisk /dev/sdf

Set partition to Linux RAID Autodetect which is fd

Add the new disk as a spare to the RAID array

sudo mdadm --add /dev/md0 /dev/sdf1

Grow the array onto the new disk

This will task appoximately forever.

sudo mdadm --grow /dev/md0 --raid-devices=5 # (amount of disks before + 1)

Watch the progress with

watch cat /proc/mdstat

Grow the filesystem

I am using xfs and my mount point is at /storage

sudo xfs_growfs /storage
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment