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.

One Response to Resizing a 3ware RAID-5 Array With Linux

  1. APz says:

    An old post, but for a future reference for anyone googling:

    You don’t need to reboot after the controller finishes resizing. Instead you can just rescan the device. Find the right array under /sys/bus/scsi/drivers/sd/, then do echo 1 > resize in the device’s directory (which is 0:0:0:0 or similar).

    The result in dmesg:
    sd 0:0:0:1: [sdb] 14553958401 512-byte logical blocks: (7.45 TB/6.77 TiB)
    sdb: detected capacity change from 5951637684736 to 7451626701312

    Now you're ready to resize the physical volume or whatever you need to do.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: