How can I grow my mdadm RAID and LVM?
Extending an mdadm RAID and then growing your LVM can be done in a few simple steps, but you'll need to set aside some time to allow the RAID to re-sync.
Below are the steps that were taken to grow a 6 drive RAID6 with XFS, to a 9 drive RAID6 and then growing our LVM from 100Gb to 1000Gb.
1. Add 3 more drives to the RAID
* 'mdadm --add /dev/md0 /dev/sd[ghi]' (where /dev/md0 is the RAID, and /dev/sd[ghi] are the 3 drives being added) * 'mdadm --grow --raid-devices=9 /dev/md0' * This process was rather slow (~500-600 minutes)
2. Resize the Physical Volume
* 'pvresize /dev/md0'
3. Resize the Logical Volume
* 'lvextend -L +X /dev/lvm/root' (where X is the amount of space to be added, and /dev/lvm/root is the location of the Logical Volume)
4. Mount the volume
* 'mount -t xfs /dev/lvm/root /Volume' (where /Volume is the mount point for our logical volume)
5. Extend the filesystem to include the added space
* 'xfs growfs /Volume'
6. Check to see that the mounted volume is now updated
* 'df -h' * This should result in showing your volume mounted at your chosen mount point with the additional space added.