Native ZFS Configuration on Ubuntu

partitionzfszpool

I'm experimenting with Native-ZFS on Ubuntu right now. Here are the drives installed on the system:

  • 2 x 2TB
  • 3 x 1TB
  • a 200GB operating system disk

I've got the OS installed and the stable ZFS RC for 12.04 installed via the PPA.

In terms of ZFS configuration, I'd like to get the maximum theoretical capacity with 1 drive failure protection (so 5TB). I was planning on this configuration:

  • 1 zpool:
    • 1 4TB RAIDZ vdev:
      • 3 x 1TB drives
      • 2 x 1TB partitions, one from each of the 2TB drives
    • 1 1TB Mirrored vdev:
      • 2 x 1TB partitions, one from each of the 2TB drives

First off, does this configuration make sense? Is there a better way to achieve 5TB (such as a 7 x 1TB RAIDZ2)? I'm not terribly concerned with performance (although I am somewhat concerned with upgradeability).

Secondly, can anybody point me to a guide (or show me) the ZFS incantations to create such a (mildly complicated) pool? All of the guides I've found create a 1-1 zpool-vdev and use the entire raw disk, not partitions. Most of the documentation I've found for ZFS regarding partitions is BSD or Solaris dependent, and I'm not sure how much of it applies to Linux.

Thanks!

Best Answer

the only difference between using the whole disk to create a pool and part of a disk is that you have to partition the disk first. so on your 2 TB drives, create 2 partitions, each 1 TB, using whatever partition tool you choose. (that would not be a zfs utility, but instead something like fdisk.)

then when you issue your zpool command, pass the partition instead of the drive:

zpool create tank1 raidz /dev/sda /dev/sdb /dev/sdc /dev/sde1 /dev/sdf1

and the same for the 1 TB mirror:

zpool create tank2 mirror /dev/sde2 /dev/sdf2