sanoid/README.md

60 lines
2.8 KiB
Markdown
Raw Normal View History

2014-11-20 18:04:29 +01:00
<p align="center"><img src="http://www.openoid.net/wp-content/themes/openoid/images/sanoid_logo.png" alt="sanoid logo" title="sanoid logo"></p>
2014-11-20 17:50:52 +01:00
======
2014-11-20 17:50:15 +01:00
2016-07-04 22:09:46 +02:00
<img src="http://openoid.net/gplv3-127x51.png" width=127 height=51 align="right">Sanoid is a policy-driven snapshot management tool for ZFS filesystems. When combined with the Linux KVM hypervisor, you can use it to make your systems <a href="http://openoid.net/transcend" target="_blank">functionally immortal</a>. (Want an example? Watch a short real time demo of <a href="https://youtu.be/ZgowLNBsu00" target="_blank">rolling back a full-scale cryptomalware infection in seconds</a>!)
2014-11-17 16:59:25 +01:00
2015-09-16 23:29:02 +02:00
More prosaically, you can use Sanoid to create, automatically thin, and monitor snapshots and pool health from a single eminently human-readable TOML config file at /etc/sanoid/sanoid.conf. (Sanoid also requires a "defaults" file located at /etc/sanoid/sanoid.defaults.conf, which is not user-editable.) A typical Sanoid system would have a single cron job:
2014-11-17 16:59:25 +01:00
```
* * * * * /usr/local/bin/sanoid --cron
```
And its /etc/sanoid/sanoid.conf might look something like this:
```
[data/home]
use_template = production
[data/images]
2014-11-17 16:59:25 +01:00
use_template = production
recursive = yes
process_children_only = yes
[data/images/win7]
2014-11-17 16:59:25 +01:00
hourly = 4
#############################
# templates below this line #
#############################
[template_production]
hourly = 36
daily = 30
monthly = 3
yearly = 0
autosnap = yes
autoprune = yes
```
Which would be enough to tell sanoid to take and keep 36 hourly snapshots, 30 dailies, 3 monthlies, and no yearlies for all datasets under data/images (but not data/images itself, since process_children_only is set). Except in the case of data/images/win7-spice, which follows the same template (since it's a child of data/images) but only keeps 4 hourlies for whatever reason.
2014-11-17 16:59:25 +01:00
Sanoid also includes a replication tool, syncoid, which facilitates the asynchronous incremental replication of ZFS filesystems. A typical syncoid command might look like this:
```
syncoid data/images/vm backup/images/vm
```
Which would replicate the specified ZFS filesystem (aka dataset) from the data pool to the backup pool on the local system, or
```
syncoid data/images/vm root@remotehost:backup/images/vm
```
Which would push-replicate the specified ZFS filesystem from the local host to remotehost over an SSH tunnel, or
```
syncoid root@remotehost:data/images/vm backup/images/vm
```
Which would pull-replicate the filesystem from the remote host to the local system over an SSH tunnel.
Syncoid supports recursive replication (replication of a dataset and all its child datasets) and uses mbuffer buffering, lzop compression, and pv progress bars if the utilities are available on the systems used.