Thursday, October 25, 2007

Resizing a 3ware RAID-5 Array With Linux

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:

  1. Add the drive in a free slot.
  2. If it doesn't show up in the web gui (Management -> Maintenance under "Available Drives"), click "Rescan Controller"
  3. Select the RAID-5 array you want to expand (not the free disk!)
  4. 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.
  5. 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.
  6. 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.
  7. After reboot, make sure that no filesystems on the expanded RAID array are mounted. If they are, unmount them.
  8. If you run "vgdisplay" as root, it should show you the old size.
  9. 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.
  10. Run "vgdisplay" again to make sure the new size is correct.
  11. Run "yast2 lvm_config" to add the free space to any existing file systems or to create new ones.

That's all, folks.

No comments: