4

I manually deleted a docker managed subvolumes

btrfs subvolume delete /var/lib/docker/btrfs/subvolumes/<subvolume id>

but when I try to recreate it gives me this error that I'm not able to solve without nuclearize the docker installation

Error response from daemon: stat /var/lib/docker/btrfs/subvolumes/<subvolume id>: no such file or directory

already tried to stop/rm -f the container, docker system prune -f and systemctl restart docker.service to no avail

Hio
  • 61
  • 4
  • 1
    You usually shouldn't manually modify anything in `/var/lib/docker` at all. If you've corrupted that tree, it usually works to stop the Docker daemon, delete all of `/var/lib/docker` and restart the daemon; you'll have to rebuild/re-pull any images you had locally and recreate containers and named volumes. – David Maze Jan 04 '22 at 11:32
  • 1
    Thank you for clarifying me that. What brought me to delete the subvolumes was an uncorrectable btrfs error as a result of a device scrub. After locating the subvolumes that had the corrupted file in its directory tree I deleted it: there's a way to safely remove the subvolume through docker console? – Hio Jan 04 '22 at 11:58
  • See https://stackoverflow.com/questions/46672001/is-it-safe-to-clean-docker-overlay2/ – BMitch Jan 04 '22 at 12:07

1 Answers1

0

I also ended up with the error after deleting btrfs subvolumes myself (the bug that subvolumes are not freed by docker system prune still exists).

To recover, you have to delete /var/lib/docker as well:

systemctl stop docker
rm -rf /var/lib/docker
systemctl start docker
Philipp Claßen
  • 37,290
  • 26
  • 139
  • 220