10

I have a running freenas zfs on raid-z1. For safety i though of increasing parity. Enough spare space is available.

Is it possible to upgrade a zfs raid-z1 to raid-z2 or raid-z3?

thx for your help

  • No, this isn't possible. – ewwhite Mar 14 '14 at 19:47
10

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.

| improve this answer | |
  • The linked article was especially helpful for those who want a deeper understanding of things. It'd be great if this answer could reproduce and/or quote a bit more from the linked article, in case the URL ends up disappearing at some point. (A link within the linked article is already returning 404 Not Found errors.) – code_dredd May 10 '18 at 20:32
  • Can you provide a citation for the claims about adding a single-disk to raid-z? My understanding is ZFS won't write without parity to a parity vdev, so functionally adding a disk doesn't increase capacity right away if there aren't free blocks on the other disks, but once there are new data will be written taking advantage of it. – Haravikk May 29 at 17:07
  • Nice answer! Thanks for that. – Citizen Jul 29 at 14:22
9

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.

| improve this answer | |
  • in times of distributed filesystems and stuff like cassandra this is somehow a missing feature ... but as I read it may be implemented in future verions – Manuel Mar 14 '14 at 20:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.