This document is a WORK IN PROGRESS.
This is just a quick personal cheat sheet: treat its contents with caution!
ZFS¶
ZFS is a combined file system and logical volume manager (designed by Sun Microsystems). ZFS is
scalable, and includes extensive protection against data corruption, support for high storage
capacities, efficient data compression, integration of the concepts of file system and volume
management, snapshots and CoW clones, continuous integrity checking and automatic repair, RAID Z,
native NFSv4 ACLs
, and can be very precisely configured.
Reference(s)
Table of contents¶
Install¶
TODO
Config¶
TODO
Use¶
TODO
-
Show disk space utilization info:
-
Show all properties for
or : -
Check zpool status of all pools with extra verbose information:
-
Check zpool status of specific pool
with extra verbose information: -
Show verbose information about pools filesystem statistics:
-
Show verbose IO statistics for all pools:
-
Show verbose IO statistics for a specific pool
: -
Show useful and advanced information on how ZFS's ARC Cache is being used:
sanoid¶
Sanoid is a policy-driven snapshot management tool for ZFS filesystems.
-
How to install (see https://repology.org/project/sanoid/versions):
TODO
TODO
Install with AUR:
$ mkdir -p ~/apps/aur-apps $ cd ~/apps/aur-apps $ git https://aur.archlinux.org/sanoid.git $ cd sanoid $ makepkg -is # --syncdeps to auto-install deps, --install to install after building
For Artix users
If you are not using systemd, you might have to translate the
sanoid
systemd services and timer yourselfTODO
TODO
-
How to use / configure:
-
After installing sanoid, you will find a simple example configuration file in
/etc/sanoid/sanoid.conf
or in/usr/share/doc/sanoid/examples/sanoid.conf
.
You will also find a more detailed example in
/etc/sanoid/sanoid.defaults.conf
or/usr/share/sanoid/sanoid.defaults.conf
, in order to consult all possible options for thetemplate
part of the configuration file.-
Now let's list the available pool(s) for ZFS snapshots:
-
Let's say you want to snapshot the
production_data
pool. In order to do so, you can create your own configuration file in/etc/sanoid/sanoid.conf
, e.g. :
This configuration will keep a weekly, a monthly and a yearly snapshot.
You will have to wait for a 15mn (maximum) before the
sanoid.timer
applies your configuration and start to take snapshots.-
You can list your snapshots like so:
-
ℹ️ Note about systemd: by default,
sanoid
will work with systemd, i.e. after installation, a systemd timer and two systemd services will be up and running:
The sanoid.timer
timer unit runs sanoid-prune.service
followed by sanoid.service
every 15 minutes.
To edit any of the command-line options,
you can edit these service files.
- ℹ️ Note about snapshots location: by default,
all snapshots are saved to the
sanoid
cache directory:/var/cache/sanoid
RAIDZ expansion¶
TODO
If this cheat sheet has been useful to you, then please consider leaving a star here.