Hello Toradex Community,
I am using a Toradex Colibri iMX7 with Torizon OS, and I am facing an issue where the device’s root filesystem storage becomes completely full, even though I am running only three Docker containers and have four Docker images available on the device.
I am trying to understand why the storage is reaching 100% usage when I am not intentionally saving large amounts of data on the device. I would also like to determine whether this issue is caused by Docker container logs, Docker build cache, running services, or something else.
1. System Storage Information
When I run df -h, I get the following output:
Filesystem Size Used Avail Use% Mounted on
tmpfs 497M 6.5M 490M 2% /run
devtmpfs 366M 0 366M 0% /dev
/dev/disk/by-label/otaroot 3.6G 3.5G 0 100% /sysroot
tmpfs 497M 0 497M 0% /dev/shm
tmpfs 4.0M 0 4.0M 0% /sys/fs/cgroup
tmpfs 497M 0 497M 0% /tmp
tmpfs 497M 0 497M 0% /var/volatile
The /sysroot filesystem has a total capacity of approximately 3.6 GB, of which 3.5 GB is used. The filesystem has reached 100% usage, leaving no available space.
2. Docker Storage Information
On another boot or when Docker is working, I checked the Docker storage usage using:
docker system df
The output was:
TYPE TOTAL ACTIVE SIZE RECLAIMABLE
Images 4 3 1.703GB 359.8MB (21%)
Containers 3 3 8.432MB 0B (0%)
Local Volumes 0 0 0B 0B
Build Cache 29 0 524.1MB 524.1MB
My Docker images are:
REPOSITORY TAG IMAGE ID CREATED SIZE
intersense123/octo 1.3 a1e7d2146be5 4 weeks ago 871MB
tailscale/tailscale latest 887d34853a32 6 months ago 95.9MB
torizon/weston 4 86497c1547f8 7 months ago 376MB
torizon/weston-touch-calibrator 3 abdf1a4839ac 2 years ago 360MB
I have four images, but only three containers are running. The container writable-layer usage reported by Docker is only about 8.4 MB, while the images occupy approximately 1.7 GB and the build cache occupies approximately 524 MB.
I am not intentionally storing large amounts of application data on the device.
3. Docker Daemon Fails to Start
When the storage becomes full, running the following command:
docker ps
returns this error:
Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I also checked the Docker service using:
sudo docker info
The client information is displayed, but the server reports:
ERROR: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
4. Docker Service Logs
I checked the Docker service logs using:
sudo journalctl -u docker.service -n 100 --no-pager
The relevant error messages are:
level=error msg="mkdir /var/lib/docker/overlay2/check-overlayfs-support1281003165/lower2: no space left on device" storage-driver=overlay2
level=error msg="[graphdriver] prior storage driver overlay2 failed: driver not supported"
failed to start daemon: error initializing graphdriver: driver not supported
docker.service: Main process exited, code=exited, status=1/FAILURE
Failed to start Docker Application Container Engine.
The same error repeats when systemd attempts to restart Docker.
From these logs, it appears that Docker cannot initialize its storage driver because the filesystem has no free space.
5. How I Temporarily Resolve the Issue
I discovered that if I truncate the Docker container JSON log files and restart the service, Docker starts successfully again.
I run the following commands:
sudo find /var/lib/docker/containers -type f -name '*-json.log' -exec truncate -s 0 {} \;
sudo systemctl reset-failed docker
sudo systemctl start docker
sudo systemctl status docker --no-pager
After executing these commands, Docker starts successfully and I can use Docker commands again. but see strorage
torizon@colibri-imx7-emmc-06673340:~$ df -h
Filesystem Size Used Avail Use% Mounted on
tmpfs 498M 13M 486M 3% /run
devtmpfs 365M 0 365M 0% /dev
/dev/disk/by-label/otaroot 3.6G 3.2G 144M 96% /sysroot
tmpfs 498M 0 498M 0% /dev/shm
tmpfs 498M 16K 498M 1% /tmp
tmpfs 498M 8.0K 498M 1% /var/volatile
tmpfs 100M 4.0K 100M 1% /run/user/1000
However, I do not understand why the storage becomes full in the first place. I also do not know whether truncating the log files is addressing the actual root cause or only temporarily resolving the problem.
6. My Main Questions
I would appreciate your guidance on the following points:
- What could be consuming the remaining storage?Docker reports approximately 1.7 GB for images, 524 MB for build cache, and only 8.4 MB for container writable layers. However, the root filesystem is using approximately 3.5 GB out of 3.6 GB. Where is the remaining storage being consumed?
- Could Docker JSON log files be responsible? Since truncating the files in
/var/lib/docker/containersallows Docker to start again, could the container logs be growing continuously even though I am not intentionally saving application data? - Could the build cache be contributing to this issue? Docker reports approximately 524 MB of reclaimable build cache. Could this cache, together with the images and other Docker data, be causing the filesystem to run out of space?
- Could running containers or other system services be consuming additional storage? I would like to understand whether Docker, containerd, Torizon OS, or other system services might be generating files that gradually fill the root filesystem.
- How can I identify the exact files or directories responsible for the storage usage?Since Docker fails to start when the filesystem is full, I need a reliable way to investigate the problem without relying on Docker commands.
- What is the recommended permanent solution?** Should I configure Docker log rotation, clean up build cache, change Docker storage settings, or investigate another part of the Torizon OS filesystem?
My main concern is that the device should run continuously without its storage gradually becoming full or the Docker daemon failing to start.
I would prefer to identify and fix the root cause rather than periodically truncating log files or manually cleaning storage.
Thank you for your time and support. Any suggestions for diagnosing this issue on a Colibri iMX7 running Torizon OS would be greatly appreciated.