RAID5 / RAIDZ - is it possible to enlarge without losing data?

If I have a RAID5 with 4x1TB drives, and then in, say, a year I decide to upgrade to 4x2TB, can I swap out one drive at a time, then let the parity rebuild, even if it's mixed-size drives?

Obviously I don't want to have to backup all 4TB to another RAID in order to expand.

Is there a difference in this regard between RAID5 and RAIDZ?


Solution 1:

This is possible with RAID-Z, as described by the ZFS Administration Guide:

When a replacement device that is greater in size than the device it is replacing is added to a pool, is not automatically expanded to its full size. The autoexpand pool property value determines whether a pool is expanded to its full size when the disk is added to the pool. By default, the autoexpand property is disabled. You can enable this property to expand a pool's size before or after the larger disk is added to the pool.

This is not necessarily recommended, because resilvering the drives after each replacement can take a long time, and the process can be stressful on the drives.

Solution 2:

Sure, you can enlarge your RAID5 volume this way. I've did it with Linux MD RAID and with hardware RAID card.

Just don't forget, that after enlarging RAID volume, you need to resize partition table and then resize the filesystem.