Docker installation issue : Failed to mount overlay: no such device storage-driver=overlay2

7k views Asked by At

I am trying to install docker on Ubuntu 20.04.3 LTS. I installing from *.deb packages. While installing docker, it runs into the following error.

Failed to mount overlay: no such device storage-driver=overlay2

I created

{
  "storage-driver": "overlay2"
}

as per https://docs.docker.com/storage/storagedriver/overlayfs-driver/ but that did not help either.

Edit 1:

lsmod | grep overlay returns empty.

sudo modprobe overlay' returns fatal error. In fact, there are no module files under /lib/modules/' for the 'uname -a' version of the kernel.

1

There are 1 answers

0
IMAD OUCHAIB On

for me the error was thrown when trying to start the docker.service, I found out that it was because I have upgraded the kernel and not yet rebooted the system, modprobe will fail with no error message, because the path /usr/lib/modules/$(uname -r)/ no longer exists.

I rebooted the system and the service starts normally again.