10

I am planning on setting up a FreeNAS ZFS pool using two 2 tb drives and two 1tb drives. I would like to have data redundancy somehow. I read this post which seems to suggest my two options are to lose 1tb per 2tb drive using RAIDZ or to use this command (which doubles the space required for data redundancy):

zfs set copies=2 poolname

Is there a better way to handle this and acheive something more like Drobo's Beyond RAID or Netgear's XRAID? Alternately, could I partition each 2tb drive into 1 tb partitions and put both partitions in the pool?

Timothy R. Butler
  • 703
  • 2
  • 11
  • 22

3 Answers3

15

There is a better way, create a single 3 TB pool composed of two mirrors.

zpool create test mirror disk1 disk2 mirror disk3 disk4

with disk1 and disk2 being the 1TB disks and disk3 and disk4 being the 2 TB ones.

Edit:

Should you want to maximize size and do not care that much about performance or best practices, you can partition all the drives with equal size partitions (or slices) and create a 4 TB hybrid pool with a 4 vdev RAIDZ and a 2 vdev mirror.

zpool create -f test raidz d0p1 d1p1 d2p1 d3p1 mirror d0p2 d1p2

Note the "-f" option required to force the command to accept the replication level mismatch.

jlliagre
  • 8,861
  • 18
  • 36
  • 1
    Thanks for the information. So that would be like normal mirroring where redundancy "costs" 100% extra, it appears? Is there a way to achieve a RAID5-like 50% "cost" for parity instead? How is the performance of this configuration versus performance of a ZRAID/RAID5 setup with 4 equal sized drives? – Timothy R. Butler Jan 01 '12 at 19:28
  • @TimothyR.Butler You can't create a mirror of the 1TB and apply RAIDZ over the two 2TB and the 2TB mirror, it just doesn't work that way. To use RAIDZ you need to have equal size drives (or you'll give up the extra space on the larger drives, or you'll have to start getting into non-recommended configurations). The two mirror configurations recommended by these answers are your best recommended configurations. – Chris S Jan 01 '12 at 20:12
  • Thanks jilliagre and @chriss for the comments. I think I may just buy two more drives and call it a day. That second command jilliagre just added is intriguing though... Would I be correct in assuming performance would be as good or better than anything mentioned above if I did a 4x2TB RAIDZ? – Timothy R. Butler Jan 01 '12 at 22:53
  • @TimothyR.Butler A 4x2TB RAIDZ would have a slight performance hit compared to dual 2x2TB Mirrors (RAID10 basically). Those two would have the best performance of anything we've discussed here. – Chris S Jan 02 '12 at 00:05
6

From the ZFS admin guide:

"The devices can be individual slices on a preformatted disk, or they can be entire disks that ZFS formats as a single large slice."

So yes, you could create two 1-TB partitions on those 2TB drives, use them for RAID-Z vdev and the remaining space for non-redundant storage.

However, according to the ZFS Best Practices Guide, you may experience degraded performance:

For production systems, use whole disks rather than slices for storage pools for the following reasons:

  • Allows ZFS to enable the disk's write cache for those disks that have write caches. If you are using a RAID array with a non-volatile write cache, then this is less of an issue and slices as vdevs should still gain the benefit of the array's write cache.

  • For JBOD attached storage, having an enabled disk cache, allows some synchronous writes to be issued as multiple disk writes followed by a single cache flush allowing the disk controller to optimize I/O scheduling. Separately, for systems that lacks proper support for SATA NCQ or SCSI TCQ, having an enabled write cache allows the host to issue single I/O operation asynchronously from physical I/O.

  • The recovery process of replacing a failed disk is more complex when disks contain both ZFS and UFS file systems on slices.

slm
  • 7,615
  • 16
  • 56
  • 76
Terlisimo
  • 61
  • 1
4

This depends on how much data storage you need. You can create two pools of 1TB and 2TB each, using RAID 1. If not, see if you can acquire like-sized disks and try RAID 1+0 or RAIDZ.

ewwhite
  • 197,159
  • 92
  • 443
  • 809
  • Thanks. Would two pools be better than one pool with two RAIDZ's in it? – Timothy R. Butler Jan 01 '12 at 19:23
  • @TimothyR.Butler Each mirror of disks is a vdev in ZFS. You can't remove vdevs from a zfs pool; so once the pool has two mirrors in it, it must always have at least those two (you can add more, just not remove). If you ever wanted to switch to something with less vdevs you'd have to destroy the pool and start from scratch. So by starting with two zpools you have the flexibility of separating them later if you want, but you lose the flexibility of sharing the storage space automatically (you'd have to put files on one pool or the other as they fill). – Chris S Jan 01 '12 at 19:54
  • @ewwhite, I know what you mean by "RAID 1+0" but there's no way to explicitly do this in ZFS... some may be confused by the difference. – Chris S Jan 01 '12 at 19:59