Troubleshooting
Docker OCI runtime create failed on SD card storage
Short answer
The runtime rejects the container's merged overlay2 path when it resolves through a symlink or against a mount that was not live when the daemon started. Set data-root in /etc/docker/daemon.json, stop the daemon, rsync the old tree to the card, and reboot so the SD card mounts before Docker starts.
On this page
- Why does Docker report "not an absolute path or is a symlink" on the SD card?
- Is the SD card mounted at the path Docker recorded?
- Should you move Docker storage with a symlink or with data-root?
- How do you migrate the existing Docker data to the SD card?
- Why does restarting the Docker daemon clear the error?
- How do you confirm the fix survives a controller reboot?
- Questions asked
That error is not about your image or your compose file. The OCI runtime is refusing to build the container's merged filesystem under the SD card because the path it received resolves through a symlink, or against a mount that was not present when the daemon recorded its storage root. Restarting the daemon clears it once; it comes back on the next boot. The durable fix is to configure the storage location with data-root in /etc/docker/daemon.json, stop the daemon, copy the old tree with rsync, and reboot so the card mounts before Docker starts.
Why does Docker report "not an absolute path or is a symlink" on the SD card? #
Docker's OCI runtime refuses to assemble the container's merged filesystem because the overlay2 path under /media/sd/docker it was given resolves through a symbolic link, or against a mount that was not present when the daemon recorded its storage root. The failure happens before your application runs, so nothing in the image or the run command is the cause. When you move Docker's data directory to the card with a symlink, the first container start surfaces the problem:
Error response from daemon: failed to create shim: OCI runtime create failed:
/media/sd/docker/overlay2/97c47323d9dbcdf7618a4757b9eae7f223d95d5f3d7eb2fd0f76ef14676f381f/merged
is not an absolute path or is a symlink: unknown
The chain is: the daemon asks containerd to create the shim, the shim starts runc, and runc validates that the merged root path is an absolute, non-symbolic path before it builds the container. The overlay2 directory in the message is Docker's layered filesystem under its data root, not an application bind mount. The runtime is telling you the storage path itself failed its check, which is why the fix belongs in Docker's storage configuration and not in the container definition.
Is the SD card mounted at the path Docker recorded? #
Confirm with mount and df that the ext4 card is live at /media/sd before the daemon starts; if the card was reformatted or its label changed since Docker's data was configured, update the mount definition and reboot rather than trusting a daemon restart. Formatting the card once is not enough: Docker's recorded storage state was established against the mount that existed at that moment.
Two checks settle it while the system is running:
- mount output must show the card's ext4 filesystem at /media/sd. The same pathname with no mount behind it is a plain directory on the controller's internal flash, and Docker will silently write there instead.
- df against /media/sd/docker must report the card's filesystem, not the root filesystem.
That internal-versus-external split is the same one that decides where InfluxDB keeps its data on a controller running ctrlX OS, which only offers external storage: any service pointed at /media/sd is only as durable as the mount under that path. If the card was reformatted or relabeled, fix the mount configuration first, then reboot the controller before migrating or starting Docker.
Should you move Docker storage with a symlink or with data-root? #
Use data-root in /etc/docker/daemon.json; a symlink from the old data directory to the card leaves a symbolic component in the resolved path, and that symbolic component is exactly what the runtime's absolute-path check rejects. Both a symlink and data-root redirect ordinary filesystem access, but data-root hands Docker and the runtime the intended absolute storage root directly, and it makes the active location visible in configuration rather than hidden in a filesystem alias.
Stop the daemon before editing the file, keep any existing valid entries, and add the key to the JSON object:
{
"data-root": "/media/sd/docker"
}
Validate the JSON before starting Docker, because a malformed file prevents the daemon from starting at all. The configuration passes when daemon.json names /media/sd/docker directly and the former data location is not being redirected through a symlink.
How do you migrate the existing Docker data to the SD card? #
Stop the daemon, point data-root at /media/sd/docker, copy the old tree with rsync while Docker is stopped, and rename the old directory instead of deleting it until images, containers and volumes have been verified on the card. Stopping the daemon stops every container on the host, so pick a window when none of them is running live control or data collection.
- Stop Docker so no image, container, volume or layer data changes during the copy.
- Verify the card is mounted at /media/sd and that the destination sits on that filesystem.
- Add "data-root": "/media/sd/docker" to /etc/docker/daemon.json and validate the JSON.
- Copy the tree with metadata preserved: rsync -aHAX /var/lib/docker/ /media/sd/docker/
- Rename the old directory — mv /var/lib/docker /var/lib/docker.old — so a rollback copy survives until verification is done.
- Start the daemon and confirm it sees the copied images, containers and volumes.
Do not merge a fresh copy into a destination that still holds remnants of failed first starts; mixed overlay2 metadata turns one path fault into image-layer and container-state faults. Pick the authoritative tree and copy onto an empty destination.
A capacity check on a real-sized card: say df reports the card at /media/sd as 29.7 GiB total with 0.8 GiB used, and the old data tree measures 3.4 GiB. After the copy the card holds 0.8 + 3.4 = 4.2 GiB, leaving 29.7 - 4.2 = 25.5 GiB free. If the free figure after your own copy is close to the card's capacity, move the data to larger storage before commissioning instead of waiting for a write failure under load. These figures are an illustrative example, not a rating of any specific card.
The migration passes when the daemon starts with the card mounted, recognizes the copied objects, and creates new data beneath /media/sd/docker.
Why does restarting the Docker daemon clear the error? #
Restarting forces the daemon to re-resolve its configured storage path against the filesystems mounted right now, so a first deployment that ran before the card appeared can succeed on the second attempt — it proves the mount works, not that the configuration is durable. The daemon builds its view of the storage root when it starts. If the card was mounted, reformatted or remounted after that moment, the daemon holds storage state that no longer matches the active mount, and the next container start trips the path check.
That is why a restart behaves like a diagnostic result rather than a fix. If Docker starts before the SD card mount is ready on the next boot, /media/sd/docker resolves against internal flash again and the error returns. The action to trust is the one that exercises startup ordering, which is the reboot described next.
How do you confirm the fix survives a controller reboot? #
Reboot the controller rather than restarting the service alone: the boot sequence is the only test that proves the card mounts before Docker starts, and after it the daemon should report its root under /media/sd/docker with images and containers intact. A restart of the Docker service preserves the current session's favorable state; a reboot does not.
After the boot, run through this list:
- docker info reports the Docker root directory beneath /media/sd/docker.
- df against that path shows the card's filesystem, not the root filesystem.
- docker images and docker ps -a list what you migrated.
- One test container starts and runs without the shim error.
If your stack also carries bind mounts or named volumes, verify each path still resolves after the move; the same mount-after-boot discipline is covered in the guide to Ignition Docker deployment, configuration and volume mounts on edge PCs. When all four checks pass on a cold boot, the storage root is configured correctly and the error is resolved for good.
Questions asked
Does the same data-root fix apply to a USB drive or SSD instead of an SD card?
Yes. The mechanism is identical on any mounted filesystem: configure data-root in /etc/docker/daemon.json with that mount's absolute path, copy the existing tree while the daemon is stopped, and make sure the storage mounts before Docker starts at boot. Only the mount point and the device behind it change.
What happens if daemon.json contains a JSON syntax error?
The Docker daemon fails to start, and every container on the host stops with it. Validate the file with any JSON parser before starting Docker, and merge the data-root key into the existing object instead of replacing unrelated settings such as log driver options. Keep a copy of the last working file.
Should the old data directory be deleted after the copy?
Rename it first, for example to docker.old, and delete it only after the daemon starts on the card and you have confirmed your images, containers and volumes are present. Renaming keeps a rollback copy; deleting immediately removes your only recovery path if the copy missed something or a layer did not verify.
Can containers keep running during the migration?
No. Stop the Docker daemon before copying. The overlay2 layer metadata changes while containers run, and a copy taken mid-write can produce an internally inconsistent tree on the card that fails later in ways that look unrelated to storage. Schedule the stop for a window when the containers are not doing live work.