Is it possible to change zfs raid-z1 to raid-z2 or raid-z3 on freenas?

Solution 1:

Reshaping a RAID-Z to a different RAID-Z Level is not possible.

As explained by Shane, you have to determine the RAID-Z level on creation. the RAID level cannot be changed at any time later. It may be changed by recreating the raid, however. Adding drives to a RAID-Z is also limited and should be avoided.

Adding a single drive to RAID-Z: DON'T!!!!

NEVER, ever add a single drive to a RAID-Z.

Adding a single HDD to a RAID-Z is a really bad idea. Assuming the first RAID-Z is full and ZFS stripes data, all data is written to the single drive. The single drive does not have any mirror and thus may get lost on a failure. Thus, it does not provide any integrity or parity correction!

Adding multiple HDDs to RAID-Z

This is possible, but probably not recommended either. Adding drives to an existing RAID-Z will create an additional RAID-Z and stripe the data over both RAID-Zs. If the first RAID-Z is full, all data will be written to the newly-added RAID-Z. ZFS does not rebalance the data. If you'd like to get a performance increase by adding new drives, you are probably better off fully recreating the RAID.

Best practise: Use striped mirrors instead of RAID-Z

A really good explanation why can be found in the blog post ZFS: You should use mirror vdevs, not RAIDZ.

Simplified, there are several reasons:

  1. Higher availability
  2. ZFS RAID does not degrade on single failed drives and stays accessible
  3. Makes it faster to recover and resilver
  4. Avoids recovery problems
  5. Provides better scaling and increasing of storage volume, even though this is not recommended. (Properly size your RAID during initialization or add drives as early as possible.)

Need scalability? Consider BTRFS.

This is just for completeness. I'm not affiliated with Rockstor or FreeNAS, just evaluating both for myself.

In the future, butterfs or btrfs may solve these problems. An alternative to FreeNAS may become Rockstor. Synology and other NAS systems have integrated it lately in their solutions.

ATTENTION: As of Aug. 2016, btrfs has bugs in the raid code and is not stable. As I understand it, consider only using it with stripped mirrors.

Solution 2:

Unfortunately, no; you cannot re-shape a RAID-Z group to a different level of RAID-Z, you'd need to move the data elsewhere and add the disks to the pool with the desired level at the time of creation.

Tags:

Zfs

Freenas