I'm about the build a Solaris NAS system, currently we have two drives and are planning on adding two more at a later date (2TB enterprise level HDD are a bit expensive!).

Whats the best configuration for setting up these drives bearing in mind I want to expand in the future?

I was thinking of mirroring the drives and then converting to raidz some how?

It will only be a max of 4 drives, the second two of which will be bought later.

Any ideas?


Mirroring is the way to go here. It'll let you easily add additional mirrored pairs to extend your existing volume. No downtime, no tricks, just add more disks and you're on your way. Unless you really need the 6TB of 4x2TB in RAIDZ, the 4TB of 4x2TB mirrored is a better bet. Mirroring also has the benefit of lowered CPU overhead, better performance and easier recovery in case of failure.

But seeing as people prefer to live on the edge and save a couple bucks here's how migrate your data from a two drive mirror to a four drive raidz setup:

  • Create a 2 drive mirror zpool create mirror cXt1d0 cXt2d0 yourPool
  • Happily fill your drives with data
  • Buy drives 3, 4 (same size as drives 1, 2)
  • Take a deep breath, you're about to forgo redundancy cause you're cheap.
  • Break the mirror removing drive 2: zpool detach cXt2d0 yourPool
  • Create a sparse file the same size as your drives: mkfile -n 500GB /path/file.img
  • Create a four drive raidz pool using drives 2, 3, 4 and the sparse file: zpool create raidz cXt2d0 cXt3d0 cXt4d0 /path/file.img newPool
  • Degrade the raidz array by detaching the sparse file: zpool detach /path/file.img newPool
  • Copy data from yourPool to newPool with zfs send/zfs recv (or just rsync/cp it)
  • Destroy the original mirrored pool: zpool destroy yourPool
  • Attach drive1 to the raidz pool: zpool attach cXt1d0 newPool
  • Wait for ZFS to resilver the drive (it'll take hours, don't be fooled by the status % not moving, there's a bug. Just let it grind.)
  • Exhale that deep breath, you again have a redundant pool.
  • 1
    Another advantage of adding mirrored pairs (assuming you are willing to forgo redundancy for the duration of a rebuild) is that you can increase the size of a given pair by breaking/resilvering onto a larger disk only twice. If you had a large raidz and wanted to get bigger drives, you'd have to replace all the drives before you get more usable space. Plus each replacement is a full resilver, which can be a lot of IO. – jwiz Jul 15 '10 at 4:41
  • I think mirroring is the way to go, we are willing to drop the extra 2TB in exchange for flexibility and the ability to upgrade the existing hard drives to bigger ones without rebuilding everything. Thanks! – Snowpoch Jul 18 '10 at 9:44

Unless you want to back up the contents and recreate the zpool, I don't think this can be done. While you can create a raidz pool with just two devices, you can't expand it later to raidz with 4 drives. What you can do is create a mirror with the first two drives and add a second mirror to the pool with the second two drives, but this doesn't get you as much space as you seem to want.


You can also set it as a raidz, create/using a sparse file as your last drive, offline that file immediately, then when you get the drive, replace the sparse file with your new drive where it will actually become a raidz, as opposed to a zfs linear span, after you replace the offlined sparse file with your drive.

Although you wont have the parity, you will have most the power of ZFS online, including scrubbing and some auto repair ability.

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.