restic: prune: There is not enough space on the disk.

Output of restic version

restic 0.7.1 compiled with go1.8.3 on windows/amd64

How did you start restic exactly? (Include the complete command line)

d:\restic\restic -r d:\restic\ prune

What backend/server/service did you use?

Filesystem (local usb windows, ntfs partition)

Expected behavior

reduce disk usage

Actual behavior

λ d:\restic\restic -r d:\restic\ prune
counting files in repo
building new index for repo
[44:35] 100.00%  99865 / 99865 packs
incomplete pack file (will be removed): 7de8bd2c65eacc121bb689d748caa95139b1ad84e6a661bbe9704b86774949d9
repository contains 99864 packs (7063132 blobs) with 459.184 GiB bytes
processed 7063132 blobs: 203673 duplicate blobs, 14.243 GiB duplicate
load all snapshots
find data that is still in use for 30 snapshots
[33:27] 100.00%  30 / 30 snapshots
found 3338752 of 7063132 data blobs still in use, removing 3724380 blobs
will remove 1 invalid files
will delete 15626 packs and rewrite 12427 packs, this frees 106.755 GiB
write \\?\d:\restic\data\9c\9c620cef19836b6f78fb9cbcc99353756f94e13d277e3a5981f3c871b9700be5: There is not enough space on the disk.
Write
restic/backend/local.(*Local).Save
        src/restic/backend/local/local.go:110
restic/repository.(*Repository).savePacker
        src/restic/repository/packer_manager.go:122
restic/repository.(*Repository).SaveAndEncrypt
        src/restic/repository/repository.go:203
restic/repository.(*Repository).SaveBlob
        src/restic/repository/repository.go:529
restic/repository.Repack
        src/restic/repository/repack.go:103
main.pruneRepository
        src/cmds/restic/cmd_prune.go:242
main.runPrune
        src/cmds/restic/cmd_prune.go:83
main.glob..func14
        src/cmds/restic/cmd_prune.go:23
github.com/spf13/cobra.(*Command).execute
        src/github.com/spf13/cobra/command.go:647
github.com/spf13/cobra.(*Command).ExecuteC
        src/github.com/spf13/cobra/command.go:726
github.com/spf13/cobra.(*Command).Execute
        src/github.com/spf13/cobra/command.go:685
main.main
        src/cmds/restic/main.go:63
runtime.main
        /usr/local/go/src/runtime/proc.go:185
runtime.goexit
        /usr/local/go/src/runtime/asm_amd64.s:2197

Steps to reproduce the behavior

Having a small partition while pruning a lot of files.

What I did was exactly:

  • had some space on the partition
  • run forget, which marked several backups.
  • tried to prune
  • got above error
  • removed other files on the partition
  • retried to prune
  • got above error again.
  • Again the device is completely filled.

Now I’m stuck, is there anything that can be savely removed?

Do you have any idea what may have caused this?

as mentioned in #725 previous files are backuped but not removed in case of an error.

About this issue

  • Original URL
  • State: closed
  • Created 7 years ago
  • Reactions: 3
  • Comments: 25 (11 by maintainers)

Most upvoted comments

I found a temporary solution: use overlayfs and rsync them back

mkdir /tmp/{upper,overlay,workdir}
mount -t overlay overlay -o upperdir=/tmp/upper,lowerdir=/mnt/backup,workdir=/tmp/workdir /tmp/overlay
restic -r /tmp/overlay prune
rsync --delete -rulHtv /tmp/overlay/ /mnt/backup/
umount /tmp/overlay
rm -r /tmp/{upper,overlay,workdir}

FWIW, I’ve been hit by this as well. I’ve increased the backup partition size several times, but not enough… And each time it fails, the repository gets bigger.

The repository is now 5 times its usual size 😕

I wish there was at least a proper way to clean up failed prunes (or redundant data).