geerlingguy / arm-nas

Arm NAS configuration with ZFS.
GNU General Public License v3.0
123 stars 6 forks source link

Monitor replicated snapshots and verify pruning works #12

Closed geerlingguy closed 3 months ago

geerlingguy commented 7 months ago

In #10, I set up ZFS replication via snapshots with syncoid and sanoid. It seems to be working well, but to verify snapshots are synced and pruned on the target (nas02 / Raspberry Pi), I am leaving this issue open for a few days/weeks.

I want to make sure snapshots are pruned because not doing so could lead to it running out of disk space, especially if thousands of snapshots build up. That would be less than ideal!

Check on snapshot health with:

nas02 should show the same snapshots as on nas01, except there will be an additional syncoid_ prefixed snapshot for the last syncoid-initiated backup.

geerlingguy commented 6 months ago

Right now I see on the Pi:

pi@nas02:~ $ zfs list -t snapshot
NAME                                                                 USED  AVAIL  REFER  MOUNTPOINT
ssdpool/backup/jupiter@autosnap_2024-04-27_03:15:00_monthly            0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-04-27_03:15:00_daily              0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-04-29_15:45:01_daily            667K      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-04-30_00:00:01_daily            637K      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_00:00:01_monthly            0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_00:00:01_daily              0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_12:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_13:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_14:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_15:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_16:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_17:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_18:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_19:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_20:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_21:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_22:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-01_23:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_00:00:01_daily              0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_00:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_01:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_02:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_03:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_04:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_05:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_06:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_07:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_08:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_09:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_10:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_11:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_12:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_13:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_14:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_15:00:01_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_17:23:11_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_18:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_19:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_20:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_21:00:18_hourly           133K      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_22:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-02_23:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_00:00:18_daily              0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_00:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_01:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_02:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_03:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_04:00:13_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_05:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_06:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_07:00:10_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_08:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_09:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_10:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_11:00:11_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-05-03_12:00:18_hourly             0B      -  10.9T  -
ssdpool/backup/jupiter@syncoid_nas02_2024-05-03:07:13:03-GMT-05:00     0B      -  10.9T  -

It looks like it is keeping 48 hourly backups... which I'm realizing is the default for sanoid: https://github.com/jimsalterjrs/sanoid/blob/master/sanoid.defaults.conf#L50

So I should probably match the config options from nas01 for sanoid on nas02:

    frequently = 0
    hourly = 24
    daily = 30
    monthly = 3
    yearly = 0
geerlingguy commented 3 months ago

Checking today:

pi@nas02:~ $ zfs list -t snapshot
NAME                                                                 USED  AVAIL  REFER  MOUNTPOINT
ssdpool/backup/jupiter@autosnap_2024-05-01_00:00:01_monthly         27.1M      -  10.9T  -
ssdpool/backup/jupiter@autosnap_2024-06-01_00:00:26_monthly         16.7M      -  11.3T  -
ssdpool/backup/jupiter@autosnap_2024-07-01_00:00:14_monthly            0B      -  11.6T  -
ssdpool/backup/jupiter@autosnap_2024-07-03_00:00:14_daily              0B      -  11.6T  -
ssdpool/backup/jupiter@autosnap_2024-07-04_00:00:14_daily            685K      -  11.6T  -
ssdpool/backup/jupiter@autosnap_2024-07-05_00:00:14_daily            741K      -  11.6T  -
ssdpool/backup/jupiter@autosnap_2024-07-06_00:00:14_daily            657K      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-07_00:00:12_daily            118K      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-08_00:00:14_daily           18.0K      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-09_00:00:14_daily           53.9K      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-10_00:00:02_daily            138K      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-11_00:00:14_daily            559M      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-12_00:00:14_daily           1.09M      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-13_00:00:14_daily           80.8K      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-14_00:00:14_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-15_00:00:14_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-16_00:00:14_daily            931K      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-17_00:00:14_daily           1.09M      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-18_00:00:07_daily           1.18M      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-19_00:00:14_daily           1.23M      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-20_00:00:09_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-21_00:00:10_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-22_00:00:11_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-23_00:00:02_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-24_00:00:14_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-25_00:00:14_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-26_00:00:03_daily            901K      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-27_00:00:17_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-28_00:00:17_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-29_00:00:17_daily              0B      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-30_00:00:17_daily            747K      -  11.8T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_00:00:11_daily            824K      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_13:00:11_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_14:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_15:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_16:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_17:00:01_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_18:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_19:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_20:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_21:00:11_hourly           278K      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_22:00:18_hourly           102K      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-07-31_23:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_00:00:13_monthly            0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_00:00:13_daily              0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_00:00:13_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_01:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_02:00:02_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_03:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_04:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_05:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_06:00:01_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_07:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_08:00:12_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_09:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_10:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_11:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@autosnap_2024-08-01_12:00:17_hourly             0B      -  11.9T  -
ssdpool/backup/jupiter@syncoid_nas02_2024-08-01:07:13:02-GMT-05:00     0B      -  11.9T  -

I'd say it's working great!