How to Recover Space from the /var directory
81
Created On 11/10/26 10:59 AM - Last Modified 11/10/26 16:08 PM
Objective
The /var directory for the server hosting a conjur container can grow to a very large size. There are usually 2 causes of this:
1. The audit log files are growing too large and are not being purged or rotated.
2. The /var/lib/containers/storage/overlay directory may also be very large, the /overlay directory usually holds old/unused container images and volumes.
3. The json.log for the container may also be getting large, which is located in the /var/lib/containers location. The file is usually the container id followed by json.log.
Environment
Conjur
Procedure
1. In order to resolve the issue of the audit log files growing too large, please follow this document to change the retention and maxsize that the logs can get to:
https://docs.cyberark.com/Product-Doc/OnlineHelp/AAM-DAP/Latest/en/Content/Operations/Services/Audit/cjr-logrotate-util.htm?tocpath=Administration%7CAudit%20logs%20and%20events%7C_____2
This involves changing parameters of the file /etc/logrotate.d/conjur-audit
2. In order to resolve the issue of the /var/lib/containers/storage/overlay being very large, please use the following commands to prune the filesystem:
For Docker containers:
sudo docker system prune -a
OR
sudo docker system prune --all --volumes --force
For Podman containers:
sudo podman system prune -a
Each of these will ask you to confirm if you want to delete unused containers and images.
This may not delete everything in that location, but it should clean up that directory and recover some space. If you want to recover more space, you can inspect the objects in that directory to determine whether they are safe to delete.
3. In order to resolve the issue of the /var/lib/containers json.log file growing too large, please reference this docker article for managing json logging:
https://docs.docker.com/config/containers/logging/json-file/
Since this this solution references docker logging, for any issues with this, please contact Docker Support.