Maintaining a system build on ZFS
ZFS opens up novel methods to safely maintain a system. In this blog entry we will outline these methods in the form of an update protocol. To keep your system healthy this protocol should be executed on a weekly/monthly basis.
Pre-update
To be able to rollback the system after a system update, one may create a snapshot of the root filesystem:
Furthermore, zfs list -t snapshot can be used to list snapshots and zfs destroy can be used to remove snapshots.
Update
We may perform a system update:
If the system does not behave accordingly after reboot, one may rollback to the previous snapshot:
Post-update
To maintain the performance of the SSDs in the system, perform a trim on the ZFS-pool:
- Some devices may not support the option
--secure.
A scrub on the ZFS-pool checks and repairs the data in the pool and is usually performed after a trim:
A scrub may take a while, its progress can be checked with:
A ZFS scrub only repairs if
mirroror azraidmode is set in the pool.