How to use ZFS on Linux
· Category: Linux
Short answer
ZFS is an advanced filesystem and volume manager with built-in snapshots, compression, and data integrity checking.
Steps
- Install ZFS:
sudo apt install zfsutils-linux
- Create a pool:
sudo zpool create mypool /dev/sdb
- Create a dataset:
sudo zfs create mypool/data
- Enable compression:
sudo zfs set compression=lz4 mypool/data
- Snapshot:
sudo zfs snapshot mypool/data@today
Tips
- Scrub pools regularly to detect and repair bit rot.
- Send snapshots incrementally for efficient backups.
- ARC cache uses RAM; size it appropriately for your workload.
Common issues
- ZFS is memory hungry; allocate sufficient RAM for the ARC.
- Licensing concerns prevent ZFS from being included in the mainline Linux kernel.