Skip to content

Instantly share code, notes, and snippets.

@guanix
Last active July 10, 2016 16:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save guanix/1e6cfb8a9011f945b312d8c1fe41be41 to your computer and use it in GitHub Desktop.
Save guanix/1e6cfb8a9011f945b312d8c1fe41be41 to your computer and use it in GitHub Desktop.

Notes on using ZFS on a Mac

I decided to move a big chunk of the data on my everyday Mac to ZFS. Here are some of my notes.

Why ZFS?

Compression

Compression is the killer feature for casual users. I only have 1TB of storage in my MacBook Pro, and I was constantly running out of space. A lot of the files I store compress very well, for example my Mail archive, source code, applications and Parallels virtual machines. The overall compression ratio for my pool is currently 2.06×.

The LZ4 compression algorithm that is usually recommended is very fast, and usually does not incur a performance penalty. Even though the CPU has to work a little to compress and decompress, less data has to be read from or written to the disk.

Checksums

ZFS checksums everything—by default, using the fletcher4 algorithm, so I can have confidence that corrupted data will never be used.

Snapshots

Atomic snapshots allow me to roll back changes. I can snapshot a dataset, install some weird piece of software, and quickly roll back if there is something wrong. It’s like Git for your filesystem.

Flexible datasets

Send/receive

The zfs send and zfs receive commands allow you to serialize a pool, dataset or snapshot, preserving almost every aspect of the filesystem, and copy it to another system, or for later recovery of backups. If you have a NAS or backup server that also uses ZFS, you can receive these snapshots on the NAS, delete them from the original system to save space, and restore them later if necessary.

Case insensitive datasets

Individual datasets can be set as case insensitive, which gives me a little confidence that various Mac applications won’t freak out.

Resources

Here is what I read about ZFS before first setting it up on a Linux server and then on my MacBook Pro:

Setting up ZFS

Install OpenZFS

Preparing a partition for ZFS

Creating the ZFS pool

Mount on boot

Datasets and mountpoints

Dataset options

Using ZFS features

Snapshots

Send/receive

Other stuff

  • zvols
  • Clones
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment