-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Docker disables btrfs quotas creating an unrecoverable broken btrfs volume #78
Comments
I have already tracked this issue down to some code which I believe is at least contributing to the problem: file: docker-ce/components/engine/daemon/graphdriver/btrfs/btrfs.go This procedure:
It looks like the btrfs storage backend tries to enable/disable the quotas on a subvolume base. But with all I have read about btrfs I don't think that is at all possible. Sure you can set/delete the quotas on a subvolume base, but the quota support itself (enabling/disabling qgroups) seems to be a setting that applies to the whole btrfs volume. I even tried to uncomment the line I marked above and the resulting dockerd is not creating the problem any more. I don't say that this is a valid fix for the problem but at least it proves that the problem might be located there. By the way, the procedure subvolEnableQuota() has the same issue. The root cause is probably a combination of docker trying to do something it should not do and btrfs causing some havoc as a result of that. |
This just happened to me and my btrfs quotas are gone:
My data is still there, which is nice. This happened after removing two docker volumes resulting in 0 docker volumes left and a VM reboot. I was just saying today to my friend that I've had 0 problems with btrfs and these VMs. Operating system: CentOS 7.7.1908 x86_64 Storage Driver: btrfs |
I think I have been beaten by the same problem. I use the same BTRFS filesystem for docker graph driver and for other things (data files of a DB). I have been playing with brtfs quota enable / disable and quota groups for this other thing not realizing that docker also does something with quotas. Suddenly (perhaps accidentaly at the same time as stoping and removing a docker container) I experienced some BTRFS errors and the filesystem entered read-only mode (the docker stop command reported error not being able to remove a subvolume due to read-only filesystem). I unmounted the silesystem did a btrfs check which found inconsistencies in free block cache and in quota groups. I repeated the check with --repair option to try to repair the inconsistencies. All but quota groups managed to get repaired but btrfs check dumped core (an assert failed) when checking the quota groups. I briefly mounted the filesystem just to disable quotas and unmounted it again. After that, btrfs check skipped checking quota groups and the filesystem was fully checked without errors (including CRC check on data blocks). So I'm now using it with quotas disabled. |
yep, just mount it on |
Expected behavior
When using docker on a btrfs volume where the quotas are enabled and certain limits on certain qgroups are set those should be retained and still be there after a reboot of the system.
Actual behavior
When using docker on a btrfs volume where quotas are enabled and certain limits on certain qgroups are set the btrfs volume gets corrupted in a way that seems unrecoverable as soon as you start the first container. This behavior does not show immediately but after a reboot the quotas are disabled and the qgroup limits are gone. I found no other way to recover from that state except to reformat the btrfs volume.
Steps to reproduce the behavior
Output of
docker version
:Output of
docker info
:Steps to reproduce (run all commands as root for simplicity):
=> You see the limit is set!
=> All seems still fine up to here.
10. reboot the system
11. check quota
=> Quota support is gone.
12. re-enable quota to see what it does
=> The previously set quota is gone!
The text was updated successfully, but these errors were encountered: