Error using overlay2 driver: "failed to mount overlay"

I geht the following error:
failed to mount overlay: invalid argument" storage-driver=overlay2

I followed these instructions, but docker failes afterwards. I deleted the changes by deleting the content of
/etc/docker/daemon.json
again, but still have the error.

Here is more logs:

Mar 10 16:42:06 simon-itx dockerd[85643]: time="2025-03-10T16:42:06.444103144+01:00" level=info msg="Starting up"
Mar 10 16:42:06 simon-itx dockerd[85643]: time="2025-03-10T16:42:06.445924584+01:00" level=info msg="OTEL tracing is not configured, using no-op tracer provider"
Mar 10 16:42:06 simon-itx dockerd[85643]: time="2025-03-10T16:42:06.446208057+01:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so usin>
Mar 10 16:42:06 simon-itx dockerd[85643]: time="2025-03-10T16:42:06.664119191+01:00" level=info msg="[graphdriver] trying configured driver: overlay2"
Mar 10 16:42:06 simon-itx dockerd[85643]: time="2025-03-10T16:42:06.670194756+01:00" level=error msg="failed to mount overlay: invalid argument" storage-driver=overlay2
Mar 10 16:42:06 simon-itx dockerd[85643]: failed to start daemon: error initializing graphdriver: driver not supported: overlay2
Mar 10 16:42:06 simon-itx systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
░░ Subject: Unit process exited
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ An ExecStart= process belonging to unit docker.service has exited.
░░
░░ The process' exit code is 'exited' and its exit status is 1.
Mar 10 16:42:06 simon-itx systemd[1]: docker.service: Failed with result 'exit-code'.
░░ Subject: Unit failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ The unit docker.service has entered the 'failed' state with result 'exit-code'.
Mar 10 16:42:06 simon-itx systemd[1]: Failed to start Docker Application Container Engine.
░░ Subject: A start job for unit docker.service has failed
░░ Defined-By: systemd
░░ Support: http://www.ubuntu.com/support
░░
░░ A start job for unit docker.service has finished with a failure.
░░

Can you paste you exact daemon.json file?

According to the error “msg=“failed to mount overlay: invalid argument” storage-driver=overlay2”, it would seem that you’re not following the json format, but instead a key=value one
(just a guess)

The invalid argument message can be misleading. The following is more important:

failed to mount overlay message appears when you want to use the overlay storage driver on a not supported backing filesystem.

https://docs.docker.com/engine/storage/drivers/select-storage-driver/#supported-backing-filesystems

At least I believe an invalid json would give you a json parse error.

Many thanks.

I am using zfs, but I am pretty sure I used overlay2 in the past.
The problem with using zfs driver is it creates hundreds of datasets. Thats not necessary and difficult to maintain.

You could use fuse-overlayfs, but that would be slower. If you don’t want to use the ZFS storage driver, the best would be if you could give Docker a disk or a partition formatted to ext4 or xfs and everything else could be on ZFS on your host.

1 Like