My backup HDD is completely full. Now, how to prune?

My mistake, my 4 TB backup USB HDD is completely full with restic backup data (3 MB left…)
Now I’m looking for a way to forget some snapshots and to prune. Forget is OK, but when prunning, not enough free space error.
How to deal with that?
Thanks.

C:\Windows\system32> restic -r h:\resticbackup prune
repository ead1de7c opened successfully, password is correct
loading indexes…
loading all snapshots…
finding data that is still in use for 109 snapshots
[0:16] 100.00% 109 / 109 snapshots
searching used packs…
collecting packs for deletion and repacking
[1:56] 100.00% 824245 / 824245 packs processed

to repack: 505 blobs / 13.887 MiB
this removes 315 blobs / 13.605 MiB
to delete: 43057 blobs / 50.145 GiB
total prune: 43372 blobs / 50.158 GiB
remaining: 4626647 blobs / 3.586 TiB
unused size after prune: 4.676 GiB (0.13% of remaining size)

deleting unreferenced packs
[0:00] 100.00% 37 / 37 files deleted
repacking packs
[0:00] 100.00% 3 / 3 packs repacked
rebuilding index
Save(<index/7e4e2f967c>) returned error, retrying after 720.254544ms: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 552.330144ms: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 582.280027ms: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 703.28564ms: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 462.318748ms: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 890.117305ms: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 636.341646ms: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/7e4e2f967c>) returned error, retrying after 492.389441ms: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 447.727139ms: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/7e4e2f967c>) returned error, retrying after 901.025843ms: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 1.713171311s: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 1.477844956s: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/7e4e2f967c>) returned error, retrying after 1.205320285s: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 990.739338ms: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 2.070709754s: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 1.635001613s: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 1.32137013s: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/7e4e2f967c>) returned error, retrying after 2.007539076s: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 4.476837129s: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 1.818837414s: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/7e4e2f967c>) returned error, retrying after 2.669912672s: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 2.179080774s: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 4.065212595s: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 5.173209677s: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/7e4e2f967c>) returned error, retrying after 4.517033471s: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 4.539634288s: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 7.133794867s: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 4.024209066s: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/7e4e2f967c>) returned error, retrying after 11.66401435s: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 10.223534436s: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 8.74646488s: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 4.513276731s: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 8.436116856s: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 14.188847299s: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/7e4e2f967c>) returned error, retrying after 18.904414573s: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 7.425381294s: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/38ff73735c>) returned error, retrying after 21.044060183s: write \?\h:\resticbackup\index\38ff73735c0c22c31fd0bc1deb19f426629ee5d000dbcb2d6f870488bb2fe529: Espace insuffisant sur le disque.
Save(<index/beffce2e02>) returned error, retrying after 10.747238066s: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.
Save(<index/693648c5f6>) returned error, retrying after 22.912714797s: write \?\h:\resticbackup\index\693648c5f6a15a7ebac858a6ab7d8c53a08cb03b6c20395588df43a0b2655224: Espace insuffisant sur le disque.
Save(<index/7e4e2f967c>) returned error, retrying after 15.406612236s: write \?\h:\resticbackup\index\7e4e2f967cbce82256ba9d08c960099d092e4efb8809933563eaa0046e69d8c2: Espace insuffisant sur le disque.
[1:11] 36.97% 300881 / 813784 packs processed
Fatal: write \?\h:\resticbackup\index\beffce2e02588e0b7472d218dc5029195ad7b9ec9665aba677fda4054559ca92: Espace insuffisant sur le disque.

Is there anything else on that disk that you can move off the disk or delete?

Each snapshot file which you can remove without issue is probably only worth a few hundred KB, but you can check the files in the snapshots/ folder and see how much space you’d gain by removing e.g. all but one. If you are fine with having just the most recent snapshot you could run the forget --keep-last 1 command to remove all the other snapshots, which could free up a (relatively tiny) bit of space.

EDIT: I removed a couple of paragraphs with bad advice from this post, sorry about that.

You could use PR Recover from no free space errors by MichaelEischer · Pull Request #3481 · restic/restic · GitHub which should be able to solve the problem of being stuck. Feel free to ask if you need help with building that PR.

Limiting the repack size problem doesn’t help here as prune only wants to repack 13 MB anyways. The “rebuilding index” step on the other hand requires a few GB of free space.

4 Likes

Is there anything else on that disk that you can move off the disk or delete?

No, the disk contains only the Restic repo

you can check the files in the snapshots/ folder and see how much space you’d gain by removing e.g. all but one.

The Snapshots folder is only 30KB, so nothing…

Feel free to ask if you need help with building that PR.

Yes please, could you tell me how to build the PR and the prune option to use? Thanks.

Building the PR requires the following steps:

  • Download and install the go compiler from Downloads - The Go Programming Language (just use the latest version for windows)
  • Download the PR from GitHub - MichaelEischer/restic at recover-enospace . You can do this by either cloning the repository using git and then switching to the recover-enospace branch or just download the branch as a zip file by clicking on “Code” > “Download ZIP” on Github.
  • Then on cmd / powershell navigate to the directory containing the restic source code and run go build ./cmd/restic (You might have to specify the full path to the go compiler, probably C:\Program Files\go\bin or similar). Afterwards there should be a new restic.exe binary.

The instructions on how to recover the repository are listed https://github.com/restic/restic/pull/3481/files#diff-c0b1dda475ae12a7084d87c21be099522bf1797f474e04b550aad44d0c44a8f7 in the last two paragraphs.

1 Like

Many thanks.
Well, I’ve chosen to delete completely the repo and to re-create it. More straightforward for me… I have another backup / repo in another disk if needed.
But thanks again for the help.

To prevent a similar problem in the future you could store a 10 or 20GB file on the backup HDD which you can delete if it becomes necessary.

7 Likes