Docker will not start with the overlay2 storage driver: no such device
failed to mount overlay: no such device storage-driver=overlay2Short answer
overlay2 needs a kernel that supports overlayfs and a backing filesystem that can carry it. Run docker info to see what the daemon picked, then check the kernel version, whether /var/lib/docker is xfs without d_type, or on a filesystem without extended attributes. The fix depends on which of the three it is.
Fix it fast
1Find out which cause you have
Ask the machine which kernel it runs, which filesystem holds /var/lib/docker and whether xfs has ftype=1.
uname -r df -T /var/lib/docker sudo xfs_info /var/lib/docker | grep ftype2Match what you see, then jump to its fix
- 1
uname -r shows a kernel below 4.0 (or below 3.10.0-514 on RHEL and CentOS)The kernel is too old for overlay2Fix - 2
xfs_info shows ftype=0/var/lib/docker is on xfs created without ftype=1Fix - 3
/var/lib/docker sits on NFS or on another filesystem without extended attributes or valid d_typeThe backing filesystem cannot hold overlayfs upper layersFix
- 1
What does the error look like?
failed to mount overlay: no such device storage-driver=overlay2
Cause 1 of 3
The kernel is too old for overlay2
1Check
Docker documents Linux kernel 4.0 or later for overlay2, and 3.10.0-514 or later on RHEL and CentOS.
uname -r2Fix
Install a newer kernel from your distribution's repositories and reboot into it. Then confirm the version again.
sudo reboot
# after the reboot
uname -r3Verify
The daemon starts and docker info shows overlay2.
sudo systemctl restart docker
docker info | grep -E "Storage Driver|Backing Filesystem|Supports d_type"Confirmed by docs.docker.com
Cause 2 of 3
/var/lib/docker is on xfs created without ftype=1
1Check
On xfs, Docker supports overlay2 only when d_type is on, which xfs_info reports as ftype=1.
sudo xfs_info /var/lib/docker | grep ftype2Fix
Back up what you need, format a new xfs filesystem with ftype=1, mount it on /var/lib/docker and add it to /etc/fstab. The device name below is an example.
sudo systemctl stop docker
sudo mkfs.xfs -n ftype=1 /dev/sdb13Verify
docker info reports d_type as supported.
sudo systemctl start docker
docker info | grep "Supports d_type"Confirmed by docs.docker.com
Cause 3 of 3
The backing filesystem cannot hold overlayfs upper layers
1Check
The kernel documents that the upper layer must support trusted.* or user.* extended attributes and must return a valid d_type. It names NFS as unsuitable.
df -T /var/lib/docker
findmnt -T /var/lib/docker2Fix
Move the Docker data directory to a local ext4 or xfs disk, or mount a suitable filesystem on /var/lib/docker.
sudo systemctl stop docker
# mount a local ext4/xfs filesystem on /var/lib/docker, add it to /etc/fstab
sudo systemctl start docker3Verify
docker info shows overlay2 on a supported backing filesystem.
docker info | grep -E 'Storage Driver|Backing Filesystem'Confirmed by docs.kernel.org
How do I stop it coming back?
- Put /var/lib/docker on a local ext4 or xfs (ftype=1) disk when you design the server.
- Read docker info after every install or kernel change.
- Back up or push images before you reformat or move /var/lib/docker.
Sources
How was this page made?
I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.
Which stack is behind this page?
Projects of mine built on the same technologies:
Related fixes
Servers
systemctl cannot start the Docker service on Linux
unable to configure the Docker daemon with file /etc/docker/daemon.json
The message only says dockerd exited.
3 causes, each with a fixServers
Apache logs SIGWINCH and exits on its own
the httpd container stops although nothing crashed
SIGWINCH is Apache's graceful-stop signal.
2 causes, each with a fixServers
sam local fails: Running AWS SAM projects locally requires Docker
Cannot connect to the Docker daemon. Is the docker daemon running on this host?
sam local start-api and sam local invoke run your function inside a Docker container, so SAM stops if it cannot talk to Docker.
3 causes, each with a fixServers
dnf fails to download repo metadata in a CentOS 8 Docker build
The same Dockerfile built fine before 2022
CentOS Linux 8 reached end of life on 31 December 2021 and its content left the mirrors.
2 causes, each with a fixServers
pip install confluent-kafka fails because librdkafka/rdkafka.h is missing
pip stops while building confluent-kafka from source
The error means pip is compiling confluent-kafka from source, and the compiler cannot find the librdkafka C headers.
3 causes, each with a fixServers
Cypress says the npm package is installed but the binary is missing
Cypress binary is missing after npm install in CI or in a Docker build
The npm package is only a launcher.
3 causes, each with a fix