6

I was playing with docker and then I found with btrfs list many docker subvolumes like this one:

ID 23305 gen 3405505 top level 22147 path var/lib/docker/btrfs/subvolumes/1464e922.....

I do not use docker. How to get rid off of these subvolumes? There is too many to just delete it one by one... Thanks

Jan
  • 357
  • 1
    You can change Docker's storage driver to overlay2 to prevent this from happening. That's the driver that Docker will (usually) use if /var/lib/docker is not on a btrfs filesystem. – gronostaj Sep 12 '22 at 17:57

2 Answers2

8
sudo su
cd /var/lib/docker/btrfs/subvolumes
ls /var/lib/docker/btrfs/subvolumes | xargs btrfs subvolume delete
Jan
  • 357
2

Docker leaves these lying around even though the images and volumes have been removed, ask docker to clean them up:

docker system prune 

Source: https://github.com/moby/moby/issues/9939