Arto's Notes re: ZFS

# Ubuntu 16.04 LTS and newer:
$ sudo apt install zfsutils-linux
$ zpool list
$ zpool create hdd /dev/vdb -f -m /mnt/hdd -o ashift=12
$ zpool create ssd /dev/vdc -f -m /mnt/ssd -o ashift=12
$ zpool status

$ zfs set mountpoint=/mnt/hdd hdd
$ zfs set mountpoint=/mnt/ssd ssd
$ zpool history
$ zdb
$ zpool iostat 1
$ zpool scrub hdd && zpool status
$ zfs mount -a
$ zfs get mounted

Principles

  • Copy-on-write: never overwrite an existing block.
  • The file system is always consistent.
  • The file system state advances atomically at checkpoints.
  • Cheap snapshots (read-only) and clones (read/write).
  • Metadata redundancy and data checksums.
  • Selective data compression and deduplication.
  • Pooled storage shared among file systems.
  • Mirroring and single, double, and triple parity RAIDZ.
  • Space management with quotas and reservations.
  • Fast remote replication and backups.