Time Machine, freeing space and snapshots

Some years back I created a Time Machine dataset using the “Multi-user Time Machine” SMB preset. It’s been working really well. But recently I’ve noticed the dataset has significantly grown, and I realised I failed to set a dataset quota when I created it.

Knowing that Time Machine will free up space by pruning old backups when it approaches full capacity, I figured I’d just set a quota limit and let it fix itself.

Sure enough, after setting the quota (not much bigger than the space it already has) Time Machine went through its “freeing space” process. But then when the subsequent backup occurred, it failed with “Insufficient Space”.

On inspection, the “data written” was smaller, but the “Space Available” had not changed. And the reason is snapshots.
Time Machine smbd service creates 7 days of snapshots. On my Truenas that’s about 60+ snapshots. The snapshots are there so you can roll back if Time Machine process fails and corrupts the sparse bundle. You can just fix it by rolling back to a working snapshot. Given the erratic problems I’ve had with Time Machine, this is a good thing!

The problem is that although Time Machine frees up space, its not released because its held by the snapshots, and the dataset quota includes the snapshot data.

So now I’m in this Catch-22 situation where Time Machine keeps trying to free up space, but snapshots a retaining the space…. Subsequent backup fails with no space. And its going to be 7 days before those snapshots are deleted… That’s 7 days of no backups.

I’ve overcome the problem for now by playing around with the quota and deleting a bunch of snapshots.

So my question is if this is a problem because I didn’t set quotas from the beginning, or is there an inherent conflict here between the way Time Machine works (i.e freeing space), and Truenas setup (i.e snapshots).

Yeah. I’m still trying to work this one out myself.

You can delete the oldest snapshots safely if you want, and that may help.

Yea, that’s what I ended up doing.

  1. force a “freeing space” with a tight quota, then
  2. increase the size of the quota to allow backups ( with now smaller snapshots).
  3. leave it a few days to get a few snapshots, then delete a bunch of older snapshots to get to the smaller sized snapshots.
  4. reduce dasaset quota.
  5. repeat above process if required.

Very messy though. I guess the alternative is to wait the 7 days (with no backups working) for all the snapshots to be flushed out. Down side is you have no backups for 7 days and no snapshots at the end.

1 Like