Stop Snapper snapshots from pinning deleted Docker images and VM disks
Confirmed on this 4.0.4-1 workstation: /etc/snapper/configs/root has SUBVOLUME="/" and NUMBER_LIMIT="5" (matching quattro default/snapper/root and install/config/snapper.sh, which configures root only), omarchy-update line 36 calls omarchy-snapshot create, which runs snapper create -c number then cleanup number. fstab has only @ @home @pkg @log on the system btrfs, and /var/lib/docker (inode 418487, mode 710), /var/lib/containerd (418461, 700) and /var/lib/libvirt/images (438976) are plain directories inside @, so the expected stat modes in the fix match. The Arch wiki Snapper page (raw) says a snapshot of @ never includes other subvolumes and suggests a subvolume for /var/lib/docker. The Arch wiki Docker page confirms Docker 29 puts images in /var/lib/containerd for new installs and /var/lib/docker for upgraded ones, so moving both is right. ROOTDEV parsing yields /dev/mapper/root here, findmnt UUID is the btrfs UUID used in fstab. Nothing was exercised: no snapshot was deleted, no subvolume created, no service stopped.
A typo in a new fstab line can drop boot to an emergency shell. Run sudo findmnt --verify before rebooting. Deleting snapshots removes those rollback points for good. Deleting the .old directories before checking the copy loses images, containers and volumes. Stopping Docker stops every container.
Symptom
sudo docker system prune -a reports Total reclaimed space: 31.4GB but df -h / does not move. Deleting a 60 GB VM disk in virt-manager frees nothing either. The root filesystem keeps creeping toward full even though I keep cleaning up containers.
Cause
Omarchy 4 configures Snapper on the @ subvolume (/etc/snapper/configs/root, SUBVOLUME="/", NUMBER_LIMIT="5") and omarchy update takes a snapshot before each update through omarchy-snapshot create. The default layout has only @ @home @log @pkg, so /var/lib/containerd, /var/lib/docker and /var/lib/libvirt/images are ordinary directories inside @ (on a 4.0.4-1 install none of them is a subvolume, their inode numbers are not 256). Every snapshot therefore holds references to the image layers and VM disk extents that existed when it was taken. Deleting the files from the live system frees no blocks until every snapshot containing them has also been deleted, and Docker image churn makes that a lot of data. The Arch wiki Snapper page notes that a snapshot of @ never includes other subvolumes, and suggests separate subvolumes for directories such as /var/lib/docker. A side effect worth knowing: restoring an Omarchy snapshot also rolls Docker's and libvirt's state back to that point.
Fix
**1. Measure with btrfs, not df:**
sudo snapper -c root list
sudo btrfs filesystem usage /
**2. Free space now** by deleting older snapshots you do not need (keep the newest):
sudo snapper -c root delete <number>
sudo btrfs filesystem usage /
**3. Keep it from coming back** by putting the container stores in their own top-level subvolumes, mounted from fstab. A flat subvolume survives a rollback of @. A nested one would be left behind inside the old @.
sudo systemctl stop docker.socket docker.service containerd.service
ROOTDEV=$(findmnt -no SOURCE / | sed 's/\[.*//')
findmnt -no UUID / # note this UUID for fstab
sudo mount -o subvolid=5 "$ROOTDEV" /mnt
sudo btrfs subvolume create /mnt/@containerd
sudo btrfs subvolume create /mnt/@docker
sudo cp -a --reflink=auto /var/lib/containerd/. /mnt/@containerd/
sudo cp -a --reflink=auto /var/lib/docker/. /mnt/@docker/
sudo umount /mnt
sudo mv /var/lib/containerd /var/lib/containerd.old
sudo mv /var/lib/docker /var/lib/docker.old
sudo mkdir /var/lib/containerd /var/lib/docker
Add two lines to /etc/fstab, copying the options from your existing / line and changing only the mount point and subvol=:
UUID=<uuid from findmnt> /var/lib/containerd btrfs rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvol=/@containerd 0 0
UUID=<uuid from findmnt> /var/lib/docker btrfs rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvol=/@docker 0 0
sudo systemctl daemon-reload
sudo mount /var/lib/containerd && sudo mount /var/lib/docker
stat -c '%a %U %n' /var/lib/containerd /var/lib/docker # expect 700 and 710, owner root
sudo systemctl start containerd.service docker.socket docker.service
sudo docker image ls
When everything works, sudo rm -rf /var/lib/containerd.old /var/lib/docker.old. Their blocks are only released once the snapshots taken before the move rotate out. The same pattern works for /var/lib/libvirt/images with a @libvirt-images subvolume (shut the VMs off and stop libvirtd first).
On plain Arch this applies only if you run Snapper (or another snapshot tool) on a root subvolume that contains these directories.
Verify
findmnt /var/lib/containerd /var/lib/docker shows the new subvolumes. After the next omarchy update snapshot, sudo docker image prune -a followed by sudo btrfs filesystem usage / shows the freed space immediately.