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

1
  • 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
    Commented Sep 12, 2022 at 17:57

2 Answers 2

9
sudo su
cd /var/lib/docker/btrfs/subvolumes
ls /var/lib/docker/btrfs/subvolumes | xargs btrfs subvolume delete
1
  • Thank you, this is working on Fedora 38. Seems Docker always left the subvolume without any explanation. It's sucks so much. Commented May 23, 2023 at 2:32
1

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

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .