How do you create zpools? Via @michaeldexter


Michael asked in an online poll whether we create zpools:

  • Artisanally by hand
  • With scripts
  • With a GUI
  • After cursing and wasting another morning on ext4

For personal and family stuff, I use the (definitely not nasty) script below. I run ZFS on full drives which I’ve first configured with gpart(8) with a freebsd-zfs partition and a label (though I don’t think that’s strictly necessary anymore?). Normalisation is a big deal for us.

zpool create -o ashift=12 \
	-O atime=off \
	-O exec=off \
	-O compression=lz4 \
	-O utf8only=on \
	-O normalization=formD \
	-O casesensitivity=insensitive \
	mirror "/dev/gpt/$1" "/dev/gpt/$2"

For work pools, I use orchestration scripts that the client can grok, such as Saltstack. Same goes for zfs datasets and, unfortunately, ext4.

Author bio and support


Ruben Schade is a technical writer and infrastructure architect in Sydney, Australia who refers to himself in the third person. Hi!

The site is powered by Hugo, FreeBSD, and OpenZFS on OrionVM, everyone’s favourite bespoke cloud infrastructure provider.

If you found this post helpful or entertaining, you can shout me a coffee or send a comment. Thanks ☺️.