OPINIONATED OMARCHY
TROUBLESHOOTING CORPUS
790
RECORDS
790
AUDITED
0
UNCHECKED
2388
SOURCES
LIVE
apps-services high occasional DISPUTE

Keep Docker data out of Omarchy's root snapshots so a rollback does not revert it

omarchybtrfssnapperdockerlimine
CORRECTED An auditor found the fix wrong or incomplete and rewrote it. · checked against Omarchy omarchy 4.0.4-1 on 2026-10-05
AUDIT NOTE

The cause and fix hold. Confirmed locally: fstab carries the four subvolumes with rw,relatime,compress=zstd:3,ssd,space_cache=v2, findmnt -no SOURCE / prints /dev/mapper/root[/@] so the sed strip works, default/snapper/root has NUMBER_LIMIT=5, omarchy-update calls omarchy-snapshot create, omarchy-snapshot restore runs limine-snapper-restore, and /etc/limine-snapper-sync.conf sets RESTORE_METHOD=replace, which builds a new @ from the snapshot, so nested subvolumes stay with the old @ as PR #8994 says. docker.service.d/no-block-boot.conf sets DefaultDependencies=no. The Arch wiki confirms the containerd image store in /var/lib/containerd since Docker 29. PR #8994 and #8953 are both open. One gap in the danger: a restore replaces @ with the snapshot's own /etc, so restoring a snapshot taken BEFORE this move brings back an fstab with no @docker or @containerd line, the drop-ins vanish, and Docker starts on the old pre-move copy inside @. The new subvolumes are not deleted, only unmounted. Only snapshots taken after the move protect the data. Danger rewritten to say so. Not exercised: the move or a restore.

The cause above was rewritten on 2026-10-04 to match this note; the fix was corrected by the audit itself.
RISK

This edits /etc/fstab and moves the whole Docker data tree. A wrong fstab line can drop boot to an emergency shell, so run sudo findmnt --verify before rebooting and keep the backup the fix makes. Do not delete the .old directories until containers, images and volumes are confirmed present. The protection covers only snapshots taken after the move. A restore replaces @, including /etc, with the snapshot, so restoring a snapshot taken before the move brings back an fstab with no @docker or @containerd line and no RequiresMountsFor drop-ins, and Docker then starts on the old copy of its data that the snapshot holds inside @. The @docker and @containerd subvolumes survive that restore but are no longer mounted. Re-add the two fstab lines and drop-ins before starting Docker again.

Symptom

An update broke something, so I booted an older snapshot from the Limine menu and restored it. The system is fine, but my Docker databases lost days of rows, and containers and volumes I created after that snapshot are gone. Separately, the root filesystem keeps growing even after docker system prune.

Cause

Omarchy's layout has four subvolumes, @ for /, @home, @log and @pkg. Everything else under /var lives inside @, including /var/lib/docker (container metadata, named volumes, and on older installs the overlay2 image layers) and /var/lib/containerd, where Docker 29 and newer keep images and container layers on a new install because the containerd image store became the default. Snapper's root config snapshots @ before every omarchy update, and the restore (omarchy-snapshot restore, which runs limine-snapper-restore) replaces @ with the snapshot, so volumes, containers and images roll back with the system. The same snapshots pin old image layers, so pruning does not free space until they expire. Reported as omacom/omarchy#8953. The fix proposed upstream (PR #8994, open as of 2026-10-04) uses a top-level @docker subvolume mounted from fstab, and its author reports that a subvolume nested under @ is left behind with the old @ when a restore replaces it. That PR does not cover /var/lib/containerd.

Fix

Move Docker's data onto top-level subvolumes. First see which image store is in use and read your / mount options (Omarchy's fstab uses tabs, so query it with findmnt rather than grep):


sudo docker info -f '{{ .DriverStatus }}'   # [[driver-type io.containerd.snapshotter.v1]] means images are in /var/lib/containerd
sudo du -sh /var/lib/docker /var/lib/containerd 2>/dev/null
findmnt --fstab -no SOURCE,OPTIONS /

Stop everything that writes there:


sudo systemctl stop docker.socket docker.service containerd.service

Create the subvolumes at the top level, next to @home:


uuid=$(findmnt -no UUID /)
dev=$(findmnt -no SOURCE / | sed 's/\[.*\]//')
sudo mkdir -p /mnt/btrfs-top
sudo mount -o subvolid=5 "$dev" /mnt/btrfs-top
sudo btrfs subvolume create /mnt/btrfs-top/@docker
sudo btrfs subvolume create /mnt/btrfs-top/@containerd
sudo umount /mnt/btrfs-top

Move the old directories aside and mount the new ones. The options below are the stock Omarchy ones. Use whatever your / line carries and change only subvol=:


sudo mv /var/lib/docker /var/lib/docker.old
sudo mkdir /var/lib/docker
sudo cp -a /etc/fstab /etc/fstab.$(date +%Y%m%d%H%M%S).back
printf 'UUID=%s /var/lib/docker btrfs rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvol=/@docker 0 0\n' "$uuid" | sudo tee -a /etc/fstab

if [ -d /var/lib/containerd ]; then
  sudo mv /var/lib/containerd /var/lib/containerd.old
fi
sudo mkdir /var/lib/containerd
printf 'UUID=%s /var/lib/containerd btrfs rw,relatime,compress=zstd:3,ssd,space_cache=v2,subvol=/@containerd 0 0\n' "$uuid" | sudo tee -a /etc/fstab

sudo findmnt --verify
sudo systemctl daemon-reload
sudo mount /var/lib/docker
sudo mount /var/lib/containerd

Omarchy's /etc/systemd/system/docker.service.d/no-block-boot.conf sets DefaultDependencies=no, so tell both services to wait for the mounts:


sudo mkdir -p /etc/systemd/system/docker.service.d /etc/systemd/system/containerd.service.d
printf '[Unit]\nRequiresMountsFor=/var/lib/docker /var/lib/containerd\n' | sudo tee /etc/systemd/system/docker.service.d/50-data-subvolume.conf
printf '[Unit]\nRequiresMountsFor=/var/lib/containerd\n' | sudo tee /etc/systemd/system/containerd.service.d/50-data-subvolume.conf
sudo systemctl daemon-reload

Copy the data in and start Docker:


sudo cp -a --reflink=auto /var/lib/docker.old/. /var/lib/docker/
[ -d /var/lib/containerd.old ] && sudo cp -a --reflink=auto /var/lib/containerd.old/. /var/lib/containerd/
sudo systemctl start docker.socket docker.service
sudo docker ps -a
sudo docker images
sudo docker volume ls

Only after the containers start, the images are listed and the data is there:


sudo rm -rf /var/lib/docker.old /var/lib/containerd.old

Snapshots taken before the move still hold the old copy, so the space comes back as Omarchy's NUMBER_LIMIT=5 expires them. The same move works for /var/lib/libvirt/images if VM disks live there.

**Plain Arch:** this applies only if / is btrfs and snapper snapshots it. The same steps work with your own subvolume names, and the RequiresMountsFor drop-ins are harmless where docker.service keeps its default dependencies.

Verify

findmnt /var/lib/docker shows subvol=/@docker, sudo btrfs subvolume show /var/lib/docker reports a subvolume, and sudo docker ps -a lists the old containers. After the next omarchy update, the new snapshot does not contain var/lib/docker content.

Sources

omarchy-docker-data-reverted-by-snapshot-restore