Disk full - Snapshot delete not possible !?

Hi there,

the following happened to me: i made a backup to an external usb hard disk. The usb disk filled up and the backup was interrupted in kopia.
Now i wanted to delete this snapshot. but i can’t, because kopia tells me, that there is no space left on the disk when i try to delete.
And now?

Check FR - Native way for kopia to recover from underlying storage running out of space · Issue #1738 · kopia/kopia · GitHub

FR? This is not a feature. This is basic functionality of a fundamental operation.

Three (3) years since it was acknowledged on a project/product began nine (9) years ago.

Incredibility related:

If its a deal breaker to you, just don’t use it and move on.

Another brilliant insight. Thank you for your non-input.

Well… I just looked at that problem and decided to check it out on a small test repo on an external drive. I was actually not filling the drive, but instead tried to determine, what files would be “safe” to delete from the drive.

Of course this is only a general approach and one would have to play close attention, but what worked for me was this:

  • run a snapshot
  • find the latest files in the repo’s folder hierachy
  • remove some of them
  • run snapshot fix invalid-files --commit
  • check with snapshot verify

So, the issue boils down to actually finding the latest blobs written when running kopia snapshot. This can be done rather easily on any *nix type system like this:

find  [path to kopia repo] -type file -not -path "*/xn0/*" -newermt "2025-04-05 10:54:00" \! -newermt "2025-04-06" -exec ls -lh {} \;

This will spill out a list of all files that have been created after 2025/04/05 10:54 along with the date and size. Of course you would adjust that time to somewhat just before you ran your snapshot. From there you could go ahead and remove the blobs - which should be up to 20MB in size (unless you changed that for the repo). Please note as well, that I excluded the xn0 directory, as I think that this holds the indexes from the repo and we wouldn’t remove those.

After removing some - or even all of the listed blobs, you can run

kopia snapshot verify

to see the damage you have caused… :wink: Now, running

kopia snapshot fix invalid-files --commit

Brought the repo back into shape.

2 Likes

You’re onto something.

-newermt '10 minutes ago' # other formats/ranges supported, see `date input formats`

Assuming GNU’s version, find [path to kopia repo] -type file -not -path "*/xn0/*" -newermt '10 minutes ago' -delete && kopia snapshot verify && kopia snapshot fix invalid-files --commit might well be the way to do it all in one shot.

Anyone stuck saddled with Windows should give MobaXterm serious consideration. That version of find should be up to date.