The file server I'm building will host a ZFS pool datapool made from 3 disks, configured as double-parity RAID-Z pool. There is a dataset, datapool/home created on the pool. The dataset datapool/home is exported as an NFS share. This is what I have done:

1. zpool create datapool mirror /dev/sdb /dev/sdc /dev/sdd
2. zfs create datapool/doc

I created the zpool with 3 disks, and a dataset datapool/doc. I know that RAID can be created by running:

mdadm --create --verbose /dev/md0 --level=5 --raid-level=3 /dev/sdb /dev/sdc /dev/sdd

But, I am confused about how to configure my 3 disks as a double-parity RAID-Z pool.


To create a RAID-Z pool with 2 parity disks (raidz2), you can run:

zpool create datapool raidz2 <disk1> <disk2> <disk3> ...

You shouldn't use mdadm in this configuration at all. ZFS implements volume management itself -- using mdadm on the same devices ZFS is using will corrupt your data. Also, once you've created the pool, you can't change the data redundancy settings (unless it's on new disks you're adding, or unless you copy the data out of the existing pool, wipe, and rebuild the pool from scratch).

However, you still can't run the command above for only 3 disks if you want raidz2. The idea behind RAID-Z is basically the same as mirroring -- you want to reduce the chances that disks failing will result in data loss by storing redundant information -- except that it's supposed to reduce the total amount of redundant information you have to store to reconstruct the data if disks die. But, if you want to survive failures of all but one disk, you must have all your data on that last surviving disk, since there is no another disk you can read to reconstruct the data.

Therefore, mirroring is the best you can do with only 3 disks, if you want 2-failure redundancy:

zpool create datapool mirror <disk1> <disk2> <disk3>

However, I believe you could use raidz1 instead if 1-failure redundancy is ok:

zpool create datapool raidz1 <disk1> <disk2> <disk3>
| improve this answer | |

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.