Torizon OS Storage Reaches 100% Despite Running Only 3 Docker Containers – Docker Daemon Fails to Start

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:

  1. 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?
  2. Could Docker JSON log files be responsible? Since truncating the files in /var/lib/docker/containers allows Docker to start again, could the container logs be growing continuously even though I am not intentionally saving application data?
  3. 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?
  4. 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.
  5. 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.
  6. 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.

Hi, I’m the Toradex AI Assistant.

I might make mistakes or occasionally get you wrong. Our support team will step in if needed.


Storage Analysis and Solution for Colibri iMX7 Running Torizon OS

Your issue is primarily caused by unbounded Docker container log growth. The symptoms you describe—storage reaching 100%, Docker daemon failing to start, and temporary recovery after truncating JSON log files—clearly point to container logs as the root cause.

What’s Consuming Your Storage

Based on your data:

  • Docker images: ~1.7 GB
  • Build cache: ~524 MB
  • Container writable layers: ~8.4 MB
  • Total reported by Docker: ~2.2 GB
  • Actual filesystem usage: ~3.5 GB out of 3.6 GB

The missing ~1.3 GB is most likely consumed by:

  1. Container JSON logs in /var/lib/docker/containers/*/
  2. Base OS and system files
  3. OSTree metadata and commits

Since truncating the *-json.log files immediately frees significant space and allows Docker to restart, container logs are the primary culprit.

Why Docker Daemon Fails

When the filesystem reaches 100% capacity, Docker’s overlay2 storage driver cannot create necessary directories or files. The error you’re seeing confirms this:

level=error msg="mkdir /var/lib/docker/overlay2/check-overlayfs-support1281003165/lower2: no space left on device"

Docker requires free space to initialize its storage driver, manage container layers, and write logs. Without it, the daemon cannot start.

Identifying Storage Usage

To diagnose storage issues when Docker is down, use standard Linux tools:

# Find largest directories under /var/lib/docker
sudo du -sh /var/lib/docker/* | sort -h

# Check container log sizes specifically
sudo du -sh /var/lib/docker/containers/*/

# Find large files across the system
sudo find /sysroot -type f -size +50M -exec ls -lh {} \;

Permanent Solution: Configure Docker Log Rotation

Docker does not limit container log size by default. You need to configure log rotation to prevent unbounded growth.

Create Docker Daemon Configuration

Create or edit /etc/docker/daemon.json:

sudo mkdir -p /etc/docker
sudo nano /etc/docker/daemon.json

Add the following configuration:

{
  "log-driver": "json-file",
  "log-opts": {
    "max-size": "10m",
    "max-file": "3"
  }
}

This limits each container to 3 log files of 10 MB each (30 MB total per container).

Restart Docker

sudo systemctl restart docker

Verify Configuration

docker info | grep -A 5 "Logging Driver"

Additional Recommendations

1. Clean Build Cache Regularly

The 524 MB of build cache is reclaimable:

docker builder prune -a

2. Remove Unused Images

If you’re not using all four images:

docker image prune -a

3. Monitor Storage Proactively

Set up monitoring to alert before storage reaches critical levels:

# Check available space
df -h /sysroot

4. Consider External Storage

For applications generating significant data, mount external storage or use Docker volumes on separate partitions.

Why Your Temporary Fix Works

Truncating the JSON log files removes accumulated log data without affecting container state. However, without log rotation configured, the logs will grow again and fill the filesystem.

Root Cause Summary

Your issue stems from:

  1. No default log rotation in Docker daemon configuration
  2. Containers continuously writing logs to JSON files
  3. Limited root filesystem (3.6 GB) on Colibri iMX7
  4. No monitoring to detect storage depletion before critical failure

The permanent solution is configuring Docker log rotation via /etc/docker/daemon.json as shown above. This addresses the root cause rather than just the symptoms.

After implementing log rotation, your system should run continuously without storage issues or Docker daemon failures.

Best regards,
Toradex AI Assistant.


Did you like my answer? :+1: :-1:

If I answered your question, please tick the “Solution” checkbox.

For follow-up questions to me, please use @ToradexAI in your post.

Greetings @Coders

Where is the remaining storage being consumed?

It’s hard to say without a further analysis of the filesystem on your device. You would need to search for what files/directories are large in size to determine what could be consuming this disk space.

Could Docker JSON log files be responsible?

This doesn’t seem likely. By default on Torizon OS we use the journald logging driver for Docker. Which logs to the same system journal that systemd services use. By default the system journal is volatile, meaning it shouldn’t be writing these logs to disk. That is unless the default configurations for these were changes on your system.

Could the build cache be contributing to this issue?

This wouldn’t make sense. Given your findings, even accounting for all the potential disk space that Docker is using it still doesn’t add up to the 3.5GB usage.

Could running containers or other system services be consuming additional storage?

It shouldn’t, at least not to any noticeable degree. This would mean any system that uses Docker containers (which there are many), would continually use more and more disk space.

What is the recommended permanent solution?

Well first of all how sure are you that the disk space issue is due to something Docker related? As said in your 1st point the numbers don’t quite add up. You should first confirm where the rest of this disk space usage is coming from before tinkering with Docker.

Best Regards,
Jeremias