Hi. I’m using sanoid to manage automatic ZFS snapshots. It mostly works, but I’m seeing some weird behavior with snapshots. Here’s my layout:
# zfs list
NAME USED AVAIL REFER MOUNTPOINT
pool 53.0G 1.67T 96K none
pool/home 178M 1.67T 165M none
pool/nix 39.6G 1.67T 10.2G none
pool/root 390M 1.67T 4.48M none
pool/var 12.6G 1.67T 9.35G none
and an abbreviated version of my sanoid nix config:
services.sanoid = {
enable = true;
datasets."pool/root" = {
useTemplate = [
"daily"
"weekly"
"monthly"
];
};
datasets."pool/nix" = {
useTemplate = [
"weekly"
];
};
templates."hourly" = {
hourly = 24;
autosnap = true;
autoprune = true;
};
templates."daily" = {
daily = 7;
autosnap = true;
autoprune = true;
};
templates."weekly" = {
weekly = 4;
autosnap = true;
autoprune = true;
};
So, root is snapshotted daily, weekly, and monthly, but nix is only snapshotted weekly. The templates all have autosnao and autoprune enabled, and I have an hourly template for other datasets like home..
The problem is hourly snapshots are being created for root, and both daily and hourly snapshots are taken for nix. They’re also not being pruned properly - for root, where daily is defined, there are 7 snapshots as expected… but for nix, I have 67 daily snapshots, when there should be 0.
Any ideas what’s going on here? I’m new to sanoid so certainly could be missing something, but not seeing any obvious misconfiguration.
Would appreciate any guidance. Thanks.