Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question

migrated from stackoverflow.com May 11 '11 at 0:30

This question came from our site for professional and enthusiast programmers.

add comment

4 Answers

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.

share|improve this answer
add comment

Unfortunately, at the moment it is not possible:

It is not possible to add a disk as a column to a RAID-Z, RAID-Z2, or RAID-Z3 vdev. This feature depends on the block pointer rewrite functionality due to be added soon. One can however create a new RAID-Z vdev and add it to the zpool.

RAID-Z1 might work with just 2 drives, but clearly this is not very useful if extra drives cannot be added later. RAID-Z (like RAID 5) becomes more efficient, in terms of usable storage space, the more drives that are used.

share|improve this answer
    
Here we are three years later, and the Wikipedia page still says "due to be added soon" ... :( –  Icydog May 22 at 0:19
add comment

RAID-Z1 can be used with only two disks but there is no advantage at all compared to mirroring - unless your two disks have different sector sizes, so that they can't be mirrored (e.g.: a new 4K sector disk and an older 512 byte disk).

As already stated, adding a device to a RAID-Z isn't supported. Should you want to add a disk to an existing RAID-Z, the only way is to backup your data elsewhere, destroy the the pool and recreate it with the extra disk added then restore your data.

share|improve this answer
add comment

Don't have enough "reputation" to comment, so putting this in as a separate answer

RE: Holger G suggestion

while I agree that this is NOT safe... I found this thread looking for a way to go from RAIDZ1 to RAIDZ2 at a later date when extra drive can be acquired.

So Holgers suggestion works great for me - create a RAIDZ2 with one dev as sparse file, offline the file device and have effectively RAIDZ1 for a while and then add a real device at some point to double the redundancy

Also works for the situation where the one drive holds the data that is to be copied to the new raid, as the OP has.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.