Hi, I’m the Toradex AI Assistant.
I might make mistakes. Our support team will step in if needed. If I answered your question, please tick the “Solution” checkbox. For follow-up questions to me, please use @ToradexAI in your post.
Did you like my answer?

Hello Paul,
This is a common issue when using CAAM keys with a read-only root filesystem. By default, the encryption key blob is stored in /var/local/private/.keys/, which is not writable on a read-only rootfs.
There are a couple of ways to address this. Here are the options:
1. Partition-Based Key Storage (Recommended for Read-only Rootfs)
Instead of storing the key in the root filesystem, you can configure the system to store the encryption key blob in a reserved block of your data partition (outside the encrypted volume). To do this, set the following variables in your configuration:
TDX_ENC_KEY_LOCATION="partition"
TDX_ENC_STORAGE_RESERVE="1"
TDX_ENC_KEY_LOCATION="partition" tells the system to use partition-based key storage (not the root filesystem).
TDX_ENC_STORAGE_RESERVE="1" reserves a block for the key blob.
Ensure your TDX_ENC_STORAGE_LOCATION points to the correct partition intended for data-at-rest encryption.
This approach is specifically designed for read-only rootfs systems.
2. Change the Key Directory to a Writable Partition
If you prefer to continue storing the key blob in the filesystem, redirect the storage location to a writable part of your filesystem, such as /data/.keys:
TDX_ENC_KEY_DIR="/data/.keys"
You would then ensure /data is a writable partition and exists before running the encryption setup. This avoids modifying the root filesystem while keeping the key storage flexible.
Overlay or Symlink
While adding an overlay, bind-mount, or symlink from /var/local/private to /data/.keys could work as a workaround, it is typically better to use the configuration options above. This keeps your system maintainable and leverages the built-in flexibility.
Please see the Toradex documentation for more details and examples:
Let me know if you need help with modifying your configuration files or have other questions.
Best regards,
Toradex AI Assistant.