I am trying to get rid of some data, which accumulated in a number of incomplete snapshots. I was able to remove these incomplete snapshots and I also tried to get the unreferenced content removed, like this:
[root@jvmhh-archiv ~]# kopia snapshot gc --delete --min-age=1h
12:06:48.964 [snapshotgc] looking for active contents
12:06:48.964 [snapshotfs] processed(0/1) active 1
12:06:48.966 [snapshotgc] looking for unreferenced contents
12:06:50.744 [snapshotgc] ... found 100000 unused contents so far (265.6 GiB bytes)
12:06:52.900 [snapshotgc] ... found 200000 unused contents so far (531.2 GiB bytes)
12:06:55.016 [snapshotgc] ... found 300000 unused contents so far (796.6 GiB bytes)
12:06:57.262 [snapshotgc] ... found 400000 unused contents so far (1 TiB bytes)
12:06:59.596 [snapshotgc] ... found 500000 unused contents so far (1.3 TiB bytes)
12:07:01.955 [snapshotgc] ... found 600000 unused contents so far (1.6 TiB bytes)
12:07:04.320 [snapshotgc] ... found 700000 unused contents so far (1.8 TiB bytes)
12:07:06.718 [snapshotgc] ... found 800000 unused contents so far (2.1 TiB bytes)
12:07:09.260 [snapshotgc] ... found 900000 unused contents so far (2.3 TiB bytes)
12:07:11.115 [kopia/cli] GC found 968747 unused contents (2.5 TiB bytes)
12:07:11.115 [kopia/cli] GC found 14 unused contents that are too recent to delete (3.6 MiB bytes)
12:07:11.115 [kopia/cli] GC found 26 in-use contents (46.9 KiB bytes)
12:07:11.115 [kopia/cli] GC found 5 in-use system-contents (2.3 KiB bytes)
However, the conten still doesn’t get deleted from the repo and there seems no other command which should be used for that, is there?
kopia maintenance --full should take care of everything. It will delete all repository contents that are no longer referenced. Due to safety protocols that require passage of time to support concurrency this is not immediate but if you run maintenance regularly it will clean your repository.
Is there a way to force deletion sooner? I would like to change which folders go in to which snapshot but I need to free up space from my previous backups. I’ve deleted the snapshots and ran maintenance --full but as you say, the safety protocols prevent deletion straight away.
I would be happy with just an idea of time scale here. Are we talking 1 minute/5 minutes/1 hour?
I recognize this is an edge case, but the kopia maintenance run output could be made more explicit: when it says GC found 171436 unused contents that are too recent to delete (34.4 GiB bytes), it could say (34.4 GiB; less than 10 minutes old). (Also, micro-nitpick: “GiB bytes” is redundant.)
Hmm, I just reran the maintenance, and there’s a new message that wasn’t there a couple minutes ago: Skipping blob deletion because not enough time has passed yet (59m59s left).
kopia maintenance run --full --safety=none will force deletion of unreferenced blobs… but be very careful when using it, cause it may corrupt your repository if used incorrectly. To the point where it is absolutely not recommended to use; just be patient and wait for Kopia’s regular full maintenance to get rid of unreferenced blobs. See Maintenance | Kopia