80 lines
3.0 KiB
Markdown
80 lines
3.0 KiB
Markdown
---
|
||
category:
|
||
- "[[Note]]"
|
||
- "[[Software]]"
|
||
type:
|
||
title: " Sanoid and Syncoid Setup"
|
||
created: 2026-05-12T21:09:25
|
||
tags:
|
||
- project
|
||
---
|
||
## resources
|
||
|
||
- [github](https://github.com/jimsalterjrs/sanoid)
|
||
- [forum](https://discourse.practicalzfs.com/)
|
||
|
||
## intro
|
||
|
||
I've set this up on on a [[Proxmox]] backup machine, it creates the [[OpenZFS|zfs]] snapshots on the remote machine and them pulls them into it's own zfs pool.
|
||
|
||
## important
|
||
|
||
- the source of the datasets should be the only one taking snapshots (i.e. `autosnap = yes`), the destinations only replicate these snapshots, see Jim Salter's comments [here](https://discourse.practicalzfs.com/t/setting-up-syncoid-for-offsite-backup/1611/3).
|
||
|
||
## initial setup
|
||
|
||
install Sanoid on backup and source host (not strictly required on both, but Sanoid uses tools on both machine for fast and reliable connection)
|
||
```
|
||
apt install sanoid
|
||
```
|
||
|
||
if you don't run Sanoid on one machine, ensure the following folders are created on it
|
||
```
|
||
mkdir -p /var/cache/sanoid /var/run/sanoid
|
||
```
|
||
|
||
use root accounts for ssh connections, the zfs commands need root access (tried to get it to work without and it was turtles all the way down)
|
||
|
||
add conf files and populate from [github](https://github.com/jimsalterjrs/sanoid)
|
||
```
|
||
/etc/sanoid/sanoid.conf
|
||
/etc/sanoid/sanoid.defaults.conf
|
||
/usr/local/bin/zfs-nightly-backup.sh
|
||
```
|
||
|
||
run manual backup (add `--debug` flag for more info)
|
||
```
|
||
syncoid -r --use-hold --preserve-recordsize --preserve-properties root@192.168.1.43:noggapool/music stanleypool/music
|
||
```
|
||
|
||
commands for nightly script
|
||
```
|
||
/usr/sbin/syncoid -r --use-hold --preserve-recordsize --preserve-properties root@pve-thinkstation:noggapool/dataset stanleypool/dataset
|
||
```
|
||
```
|
||
/usr/sbin/syncoid -r --no-sync-snap --create-bookmark --use-hold --preserve-recordsize --preserve-properties stanleypool/dataset root@pve-shug9:bathpool/dataset
|
||
```
|
||
|
||
## scheduled snapshots and prune
|
||
|
||
by default, when installing via `apt` it starts a timer service that executes every 15minutes. for my requirements i need to disable this for now
|
||
```
|
||
systemctl stop timer.sanoid.service
|
||
systemctl disable time.sanoid.service
|
||
```
|
||
|
||
- i've set both backup machines to come on at 00:00 UTC
|
||
## on zfs bookmarks
|
||
|
||
The creator of sanoid, Jim Salter, gave a good overview of bookmarks [here](https://discourse.practicalzfs.com/t/can-sanoid-leave-bookmarks-behind-after-deleting-snaphots/4381/4)
|
||
|
||
> [!NOTE] Jim Salter
|
||
> Bookmarks are only useful in a **single** scenario:
|
||
>
|
||
> When you already have a common snapshot between source and target–note, you must **already** have the common snapshot on both sides–you may first create a bookmark **on the source** and then destroy the snapshot **on the source** without breaking the replication chain.
|
||
>
|
||
> However, the snapshot still has to be present **in full** on the target.
|
||
>
|
||
> ...
|
||
>
|
||
> This allows you to more easily keep much shallower archive depth on a source system with a few (or one) small, fast drives, while keeping much deeper archives on a target system with many more, or larger drives. |