ZFS Management¶
tuinix uses ZFS with encryption as its root filesystem. This guide covers day-to-day ZFS operations.
Pool status¶
Snapshots¶
Snapshots capture the state of a dataset at a point in time. They're instant and initially consume no additional space.
Creating snapshots¶
# Snapshot the root dataset
sudo zfs snapshot NIXROOT/root@before-change
# Snapshot with a date-based name
sudo zfs snapshot NIXROOT/root@$(date +%Y-%m-%d)
# Snapshot all datasets recursively
sudo zfs snapshot -r NIXROOT@backup
Listing snapshots¶
Rolling back¶
Warning
Rolling back destroys all changes made after the snapshot.
Deleting old snapshots¶
Compression¶
ZFS compression is enabled by default. Check the compression ratio:
Scrubbing¶
Scrubs verify data integrity by reading all blocks and checking checksums. Run periodically:
Recovery¶
If your system won't boot:
- Boot from the installation USB
- Import and unlock:
- Chroot in:
- Fix and rebuild: