Ever wanted to extend the available space in your RAID 5 array? Whenever I do, I'm missing a consistent recipe how to do it. The following applies to OpenSuSE 10.2 and a 3ware 9550SX controller with 8 lanes. If your setup is different, adjust as necessary. Here are the steps:
- Add the drive in a free slot.
- If it doesn't show up in the web gui (Management -> Maintenance under "Available Drives"), click "Rescan Controller"
- Select the RAID-5 array you want to expand (not the free disk!)
- Click on "Migrate Unit". The web gui should offer you a list of drives to add and a few other settings you can change in the process.
- Click OK to start the migration. If your array is large, this can take a long time. I migrated from 1.3TB to 1.6TB. This took 24h.
- After the migration has completed, you'll have to reboot. Linux will see the new bytes only after the reboot but there is no danger in using the drive in this strange state for as long as you like. You just can't claim the new space but you can't loose any data, either.
- After reboot, make sure that no filesystems on the expanded RAID array are mounted. If they are, unmount them.
- If you run "vgdisplay" as root, it should show you the old size.
- Run "pvresize /dev/sdb" as root (replace the device name with yours). This will make Linux notice the new size. Note that it is safe to run this command without a reboot. It just won't do anything in this case. It will only print "1 physical volume resized" but when you run "vgdisplay", the size won't have changed.
- Run "vgdisplay" again to make sure the new size is correct.
- Run "yast2 lvm_config" to add the free space to any existing file systems or to create new ones.
That's all, folks.