Docker and overlayroot

i tried this solution

Docker uses an overlay2 file system in /var/lib/docker. An overlay2 filesystem cannot be used on an overlay file system that overlayroot uses. It can however reside on it as regular files. So my solution was to: make a copy of /var/lib/docker/overlay2. Mount a tmpfs on /var/lib/docker/overlay2 On boot - copy that copy of /var/lib/docker/overlay2 to that tmpfs. Start up docker. Docker now sees it on an tmpfs, not an overlay file system.

when i try to cp the backup folder after enabling the overalyroot some files are corrupted somehow

cp: cannot stat 'backfile/overlay2/249f5592288a361b1c8c3639b00d72c9edecc674a0b8f3fb02c76f49eead8190-init/work/work/#15': No such file or directory
cp: cannot stat 'backfile/overlay2/24afc97f74327cb55882e0c714f370888bc0b87390a163ed4048580244cd9d45/diff/realsense/FRAMOS_D400e_Software_Package': No such file or directory
cp: cannot stat 'backfile/overlay2/24afc97f74327cb55882e0c714f370888bc0b87390a163ed4048580244cd9d45/diff/realsense/FRAMOS_D400e_Software_Package_Linux64_ARM_latest.tar.gz': No such file or directory
^[^R
^[cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/3bde41ac.1': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/3e45d192.0': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/5273a94c.0': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/5a7722fb.0': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/66445960.0': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068_2.pem': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/E-Tugra_Certification_Authority.pem': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/E-Tugra_Global_Root_CA_ECC_v3.pem': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/E-Tugra_Global_Root_CA_RSA_v3.pem': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/etc/ssl/certs/Hongkong_Post_Root_CA_1.pem': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/usr/share/ca-certificates/mozilla/Autoridad_de_Certificacion_Firmaprofesional_CIF_A62634068_2.crt': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/usr/share/ca-certificates/mozilla/E-Tugra_Certification_Authority.crt': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/usr/share/ca-certificates/mozilla/E-Tugra_Global_Root_CA_ECC_v3.crt': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/usr/share/ca-certificates/mozilla/E-Tugra_Global_Root_CA_RSA_v3.crt': No such file or directory
cp: cannot stat 'backfile/overlay2/520ef3906753332dea2489cf567a1e43368f6b833fe0aa6726e178b4f8c84a8a/diff/usr/share/ca-certificates/mozilla/Hongkong_Post_Root_CA_1.crt': No such file or directory
cp: cannot stat 'backfile/overlay2/a0e3d0c50459f9176d6161921902decf0fd5ddd44fc40a00ba79f97e7d20d3cc/diff/usr/share/glvnd/egl_vendor.d/50_mesa.json': No such file or directory
cp: cannot stat 'backfile/overlay2/b721cf293109a3b451095d0b51f6e6e78bb750a76d1ff83c0a1215e96544c50c/diff/var/lib/apt/lists/auxfiles': No such file or directory
cp: cannot stat 'backfile/overlay2/b721cf293109a3b451095d0b51f6e6e78bb750a76d1ff83c0a1215e96544c50c/diff/var/lib/apt/lists/lock': No such file or directory
cp: cannot stat 'backfile/overlay2/b721cf293109a3b451095d0b51f6e6e78bb750a76d1ff83c0a1215e96544c50c/diff/var/lib/apt/lists/partial': No such file or directory
nvidia@nvidia-desktop:~$ ls -l backfile/overlay2/249f5592288a361b1c8c3639b00d72c9edecc674a0b8f3fb02c76f49eead8190-init/work/work/#15
ls: cannot access 'backfile/overlay2/249f5592288a361b1c8c3639b00d72c9edecc674a0b8f3fb02c76f49eead8190-init/work/work/#15': Permission denied
nvidia@nvidia-desktop:~$ sudo ls -l backfile/overlay2/249f5592288a361b1c8c3639b00d72c9edecc674a0b8f3fb02c76f49eead8190-init/work/work/#15
ls: cannot access 'backfile/overlay2/249f5592288a361b1c8c3639b00d72c9edecc674a0b8f3fb02c76f49eead8190-init/work/work/#15': No such file or directory
nvidia@nvidia-desktop:~$ sudo ls -l backfile/overlay2/249f5592288a361b1c8c3639b00d72c9edecc674a0b8f3fb02c76f49eead8190-init/work/work/
ls: cannot access 'backfile/overlay2/249f5592288a361b1c8c3639b00d72c9edecc674a0b8f3fb02c76f49eead8190-init/work/work/#15': No such file or directory
total 0
c????????? ? ? ? ?            ? '#15'

and even without copying anything if i stop docker and start it over just after enabling the overlayroot :

Feb 13 14:07:42 nvidia-desktop dockerd[3675]: time="2025-02-13T14:07:42.853061075+01:00" level=info msg="Starting up"
Feb 13 14:07:42 nvidia-desktop dockerd[3675]: time="2025-02-13T14:07:42.853993523+01:00" level=info msg="OTEL tracing is not configured, using no-op tracer provider"
Feb 13 14:07:42 nvidia-desktop dockerd[3675]: time="2025-02-13T14:07:42.854157299+01:00" level=info msg="detected 127.0.0.53 nameserver, assuming systemd-resolved, so using resolv.conf: /run/systemd/resolve/resolv.conf"
Feb 13 14:07:42 nvidia-desktop dockerd[3675]: time="2025-02-13T14:07:42.883422931+01:00" level=info msg="[graphdriver] trying configured driver: overlay2"
Feb 13 14:07:42 nvidia-desktop dockerd[3675]: time="2025-02-13T14:07:42.884158579+01:00" level=error msg="failed to mount overlay: invalid argument" storage-driver=overlay2
Feb 13 14:07:42 nvidia-desktop dockerd[3675]: failed to start daemon: error initializing graphdriver: driver not supported: overlay2
Feb 13 14:07:42 nvidia-desktop systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE

Your post was unreadable. I added code blocks. Please, read our formatting guide to make your posts readable by using code blocks for code, terminal output, log messages and anything with special characters. If you just share your thougts unformatted, very few people will read it if any.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.

I didn’t have time to read and answer posts last time and I still don’t have too much, but I reopened the autoclosed topic to leave a comment at least.

Moving the Docker data root is not as simple as using regular copy commands. It isnimportant to keep the exact same permissions and filetypes. There are special files in the docker data root like symbolic links or character devices. If you break the filesystem and you have no backup, there is probably no way back.

I’m not sure what your goal was. Docker can use different storage drivers, but you can’t copy files of a specific storage driver to an incompatible backing filesystem and expect it to work.

If you need the Docker data root on an overlay filesystem, you can use another storage driver that supports it. It will probably be slower though. fuse-overlayfs or vfs supports any filesystem.

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

Of course you would need to recrate everything on the new filesystem

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.