Help! RAID-Z1 with no parity?

Here is a snippet from my zpool. My problem is raidz1-40: it contains two disks so there is no parity. The disks were added there by an accident. Is there any way to add parity to raidz1-40??
Code:
          raidz1-38  ONLINE       0     0     0
            da232    ONLINE       0     0     0
            da233    ONLINE       0     0     0
            da234    ONLINE       0     0     0
            da235    ONLINE       0     0     0
            da236    ONLINE       0     0     0
            da237    ONLINE       0     0     0
          raidz1-39  ONLINE       0     0     0
            da239    ONLINE       0     0     0
            da250    ONLINE       0     0     0
            da251    ONLINE       0     0     0
            da252    ONLINE       0     0     0
            da254    ONLINE       0     0     0
            da255    ONLINE       0     0     0
          raidz1-40  ONLINE       0     0     0
            da260    ONLINE       0     0     0
            da259    ONLINE       0     0     0
          raidz1-41  ONLINE       0     0     0
            da261    ONLINE       0     0     0
            da218    ONLINE       0     0     0
            da217    ONLINE       0     0     0
            da220    ONLINE       0     0     0
          mirror-42  ONLINE       0     0     0
            da221    ONLINE       0     0     0
            da253    ONLINE       0     0     0
          raidz1-43  ONLINE       0     0     0
            da177    ONLINE       0     0     0
            da180    ONLINE       0     0     0
            da157    ONLINE       0     0     0
            da175    ONLINE       0     0     0
            da176    ONLINE       0     0     0
            da272    ONLINE       0     0     0
          raidz1-44  ONLINE       0     0     0
 
You wouldn't be able to make a RAID-Z without parity in ZFS. You have a two-disk RAID-Z, which will provide the storage space of one disk. Of course it doesn't make much sense to create a two- disk RAID-Z instead of a mirror, but there's not a lot you can do about it now without rebuilding the pool from scratch.

It's quite a strange pool design to have so many disks and mix RAID-Z/mirrors. I also would highly advise RAID-Z2 over RAID-Z1 for most uses, especially ones this large.
 
Aside from what @usdmatt already said, you'll have to recreate this pool to get rid of the two-disk RAID-Z1 vdevs.

Please do consider scalability and data safety when setting up the new pool.
 
Last edited by a moderator:
I know it's strange but the pool has been growing for a long time and the design of the jbods changed with the number of disks over the years. So when space was needed we had to add the mirror, it's a long story. But the raidz1-40 was added by accident.

Is there a way that I can maybe attach another disk or bring in parity on that mirror somehow? .??
 
RaidZ1-40 should have a single drive parity. Since it has two drives, it has one data drive and one parity drive. Whereas the RaidZ1-38 has six total drives, which means five data drives and one parity drive. This is somewhat simplified, of course.

Edit: The more I think about it, the less certain I am about this vdev actually having parity. I'll defer to others opinions on this. I also thought ZFS (at least on FreeBSD) wouldn't allow creation of two-disk RAID-Z1 vdevs?
 
I am not sure but I think the drives were forced. Because normally ZFS wont allow creating of RAID-Z with less than five drives as I recall.
 
ZFS certainly does allow creating a RAID-Z vdev with two disks. I tried it before originally replying. There is no way to modify a RAID-Z vdev once created. You cannot make it bigger or smaller. You'll either have to put up with it or rebuild the pool.

Considering the size of the pool, I would suggest taking a lot more care in the initial design of the pool, and any zpool add/attach commands.

Edit: Just to add, It's quite strange that it works but it does. With two disks it appears ZFS is able to rebuild missing data using purely the parity information. With a two-disk RAID-Z1 I can take either disk offline and the pool is still available, so you do have redundancy.

Code:
config:

        NAME                      STATE     READ WRITE CKSUM
        test                      DEGRADED     0     0     0
          raidz1-0                DEGRADED     0     0     0
            md0                   ONLINE       0     0     0
            18019298618035362061  OFFLINE      0     0     0  was /dev/md1

Of course, as mentioned previously, there really is nothing you can do to change this vdev now short of destroying the pool and re-creating it.

Is there a way that I can maybe attach another disk or bring in parity on that mirror somehow?

It does have parity and it is not a mirror. A mirror stores the same thing on two disks. This is writing the data to one disk and calculating parity information to write to the other. (Unless ZFS is treating 2 disk RAID-Z1 as a special case and actually mirroring the data, although that would be a bit of a strange thing to do. It would make more sense to just not allow creation of 2 disk RAID-Z1 if that was what it was doing)
 
Assuming parity is calculated on a bit by bit basis, then the "parity" of a single disk will simply be the bitwise inverse (if parity has to be odd) or the same data (if parity has to be even).

I'm not sure how ZFS parity information works, but that's the only way I can think of to re-construct from parity with a 2 disk RAID-Z?

Due to the way parity works - a 2 disk RAID-Z VDEV will either essentially BE a mirror, or very close to it. Except for the inability to add disks to it.
 
Back
Top