[TUTORIAL] What to do when your store runs out of space

VTOLfreak

Renowned Member
Nov 14, 2017
12
5
68
39
I'm testing out PBS and I'm very impressed. I wanted to see what happens if the store runs out of space.

I created a 2TB zpool [backup] for my backup store.
In this zpool I also created a dataset [reservation] and set a space reservation on it:
zfs set reservation=200G backup/reservation
This prevents the zfs pool from fragmenting and gives me some space for emergencies.

I then proceeded to take backups until I got an out of space error.
The zpool shows a 100% usage and 5MB free space.
I deleted some backups and then launched a prune and garbage collection job.
The job got stuck at 2% and sat there for an hour.
I freed up some space in the zpool by running zfs set reservation=100G backup/reservation
In less than 10 seconds the job completed and marked 1,5TB pending removals.
Now I just have to wait for the 24h grace period to pass before they will be cleaned up from the store.

TLDR: Prune and garbage collection job can get stuck on a full store. Create a ZFS reservation in advance for emergencies.