Ubuntu – How to plan your hard drives in a ZFS pool

filesystemsraidUbuntuzfs

So I'm planning my hard drives for ZFS on ubuntu. One point I'm very confused is the number of hard drives that are needed to create a zpool.

Say I am creating a raidz1 with 5 hard drives. The number of hard drives required is actually 6 because I need 1 to run ubuntu and create the zpool in the other 5 drives.

But in raid (non ZFS), you actually don't need the extra hard drive for your OS and raid can be configure during installation.

So my question is, is it possible to use zfs without extra drive? Any advice or point to tutorials would be appreciated.

sources: https://pthree.org/2012/12/05/zfs-administration-part-ii-raidz/

Best Answer

You can use zfs as a boot device. There is a nice little page explaining this on https://github.com/zfsonlinux/zfs/wiki/Ubuntu-16.04-Root-on-ZFS

The trick is to NOT install ubuntu directly (that is not yet possible) but to go into "Try Linux" mode and then prepare the system from there. Once the zpool is setup, you can then install ubuntu into the new pool and also install grub to boot from it.

A word of caution: Most people who use ZFS, do so in rather large setups, where they don't care about shelling out a few bucks for extra boot disks ... and thus this process is probably not as well honed as it would be if zfs was your plain old consumer-level filesystem.

You could also just install your ubuntu on a usb stick and boot from there ...