Start a ZFS RAIDZ zpool with two discs then add a third

hard driveraidraid-zzfs

Let's say I have two 2TB HDDs and I want to start my first ZFS zpool. Is it possible to create a RAIDZ with just those two discs, giving me 2TB of usable storage (if I understand it right) and then later add another 2TB HDD bringing the total to 4TB of usable storage. Am I correct or does there need to be three HDDs to start with?

The reason I ask is I already have one 2TB drive I'm using that's full of files. I want to transition to a zpool but I'd rather only buy two more 2TB drives if I can. From what I understand, RAIDZ behaves similarly to RAID5 (with some major differences, I know, but in terms of capacity). However, RAID5 requires 3+ drives. I was wondering if RAIDZ has the same requirement.

If I have to, I can buy the three drives and just start there, later adding the fourth, but if I could start with two and move to three that would save me $80.

Best Answer

A method some people use, but that is not recommended:

  1. Create a pool with 2 drives and a sparse file (of the right, virtual size to match the other drives), and then immediately offline the sparse file. This will create a degraded RAID-Z1 pool with two drives worth of capacity and no redundancy.
  2. Copy data to the degraded pool.
  3. Replace the offlined sparse-file with the third disk and resilver.

The number of "devices" that a vdev is created with, is permanent after creation. Therefore, you must have three "disks" at the time of creation. This method gives a way to create a degraded RAID-Z1 pool and later restore the absent redundancy.

This method is not recommended, because while copying and while the 3rd drive is absent, there is no redundancy/parity. But it can work.