can't delete docker containers in lxd: Driver btrfs failed to remove root filesystem
Bug #1574363 reported by
Reinhard Tartler
This bug affects 3 people
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
docker.io (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
System uses / on btrfs.
System: Xenial
Testcase:
apt install lxd
lxc launch -e ubuntu:x x
lxc exec apt update
lxc exec apt install docker.io
lxc exec docker -ti run debian:latest uptime
lxc exec bash
root@x:~# docker rm $(docker ps -a -q)
Failed to remove container (79afad5c75bc): Error response from daemon: Driver btrfs failed to remove root filesystem 79afad5c75bc356
To post a comment you must log in.
Docker is supposed to always be using aufs inside LXD containers, the output above suggests it's not the case.
btrfs doesn't allow for unprivileged btrfs subvolume delete by default, only subvolume creation (yes, that's a bit odd). So the failure you're getting is absolutely normal except for the fact that I was told Docker would always do aufs inside unprivileged LXD containers.
As a workaround to keep having docker do btrfs inside LXD, you may want to change the host btrfs mountpoint to have user_subvol_ rm_allowed as a mount option, then restart the LXD container and it should be able to both create and delete subvolumes.
Note that a bunch more btrfs functions will still fail in the container, so it'll likely only make things slightly better for you.