moby: docker run fails with "invalid argument" when using overlay driver on top of xfs
$ docker version
Client version: 1.4.1
Client API version: 1.16
Go version (client): go1.3.3
Git commit (client): 5bc2ff8/1.4.1
OS/Arch (client): linux/amd64
Server version: 1.4.1
Server API version: 1.16
Go version (server): go1.3.3
Git commit (server): 5bc2ff8/1.4.1
$ docker info
Containers: 0
Images: 0
Storage Driver: overlay
Execution Driver: native-0.2
Kernel Version: 3.18.2-200.playground.fc21.x86_64
Operating System: Fedora 21 (Twenty One)
CPUs: 4
Total Memory: 3.646 GiB
Name: zannon
ID: ST2Y:3CA3:RYLL:QW67:55K6:BVVX:LQWB:Q4JL:XOE6:JNKH:JIQJ:MC7A
$ docker run --rm -ti ubuntu:14.04 bin/bash
FATA[0000] Error response from daemon: mkdir /var/lib/docker/overlay/c4a8f5e516d401534f2d994f5546f7e08639ffd675eb3573267f76d79394f172-init/merged/dev/shm: invalid argument
This does not happen if /var/lib/docker
is on ext4
About this issue
- Original URL
- State: closed
- Created 9 years ago
- Reactions: 1
- Comments: 75 (24 by maintainers)
Fixed…
from docker official site.
so, update kernel from 3.10.0 to 3.18.0 + fixed the issue.
presently is not supported. Red Hat is tracking getting xfs to support overlayfs here: https://bugzilla.redhat.com/show_bug.cgi?id=1158888
I wanted to share some internal findings. We’ve tried linux 4.9 and found this in dmesg:
Let’s see what’s that: https://patchwork.kernel.org/patch/8377611/
To see what we have:
http://man7.org/linux/man-pages/man8/mkfs.xfs.8.html
CRC sounds useful and should be cheap on modern CPUs.
I’ve reformatted disk with crc=1 and it fixed the issue we were facing. It may have been a different issue, but a very similar one.
Centos 7.2 + extfs ===> docker: Error response from daemon: mkdir /var/lib/docker/overlay/xxxx-init/merged/dev/shm: invalid argument.
Hello,
we also experiment the same issue with Centos 7.2 + extfs [root]# docker info > Server Version: 1.11.1 > Storage Driver: overlay > Backing Filesystem: extfs > Kernel Version: 3.10.0-327.4.5.el7.x86_64 > Operating System: CentOS Linux 7 (Core)
Would somebody know a workaround on Centos 7.2 + extfs ?
Regards
PS : I recommend you this test from https://github.com/docker/docker/issues/15668 that reveales the OverlayFS regression: mkdir lower upper work merged mount -t overlay overlay -olowerdir=lower,upperdir=upper,workdir=work merged touch lower/foo rm merged/foo mkdir merged/foo <- Invalid argument
@bobrik that’s a known issue indeed; in future, docker will refuse to use overlay in that situation, see https://github.com/docker/docker/blob/v1.13.0-rc4/docs/deprecated.md#backing-filesystem-without-d_type-support-for-overlayoverlay2, and https://github.com/docker/docker/issues/27358
Someone want to update the issue title to mention ext4? Sounds like overlay on xfs works, but overlay on ext4 doesn’t.
I have test in centos 7 with 3.10.0-229 kernel, I change the fs/namei.c --> vfs_rename() 4085 line number:
to:
and it work ok, overlayfs can work in 3.10.0-229. I check that overlayfs use ovl_do_rename() , for example
the inode wdir has not rename2 member. I don’t know why, but I check that 3.18.22 ,when create /dev/shm , ovl_rename2() is not called, so I think this place should not just test the rename2 function.
Confirmed the issue using home made ext4 image on amazon with Cent OS 7. Note: this is a locally built ova that I use as a base for some vagrant boxes, which don’t have the problem. As well, I have an opensuse host that doesn’t have the issue.
Update: I am not sure why this does not cause a problem in my virtual box instance, based on the same image, but I noticed that the documentation specifically mentions overlayfs only having been merged, officially, in 3.18.0.
Checking
uname -r
reveled that centos 7.1 is still using 3.10 and I could not find anything online about centos having back ported. Installing the newer 4.2 kernel got things working as expected.@dserodio afaik, CentOS / RHEL 7.2, (and the kernel that comes with that). According to the release notes. In version 7.1, EXT4 was still recommended