ZFS Upgrade 2 mirrored drives to 3 drive raidz?

I'm about to do this and found an old blog that indicates that it can be done.

Caution: this process puts the raid in a degraded state while migrating. This significantly increases data loss probability!

The idea is to:

  1. Break the existing mirror by removing one of the existing disks
  2. Create a sparse file and mount it as a loopback device
  3. Create the new Raid-Z1 using the new disk, the one just removed and the sparse file
  4. Immediately degrade the raid by removing the sparse file device
  5. copy all the data across from the degraded mirror to the degraded raid-z1
  6. destroy the mirror and add the disk into the raid-z1 and let it resilver.

Admittedly I'm going to be doing this on SmartOS rather than Linux, but I assume Linux ZFS is advanced enough to do this.

More info on the approach can be found at https://blogs.oracle.com/zhangfan/entry/how_to_turn_a_mirror


Short answer is no, you can't convert it. You'll need to backup, destroy the mirror, create a raidz and restore the filesystems from backup.

ZFS supports adding drives to pools without upsetting the original data but you cannot change the configuration (mirror, raidz, etc.) of existing drives in the pool.

In your case you could (although I don't recommend it) add the third drive to your existing pool and the extra space would become available to all ZFS filesystems in the pool but you wouldn't have redundancy on the entire pool.

You could add two drives as another mirror to the same pool and then you'd have additional space with mirror redundancy across the whole pool.

I have run raidz (home use, not production) in the past but I now prefer mirrors for their simplicity and performance (particularly on scrubs), despite lower usable capacity.

Tags:

Debian

Zfs