SRX systems may sometimes run out of system storage capacity, commonly while performing a software upgrade of the device. This article lists the files that can be safely removed from the device in order to increase the storage capacity of the file system.
Problem or Goal:
What are the common and safe files that can be removed in order to increase system storage capacity?
Below is a typical show system storage command output, showing flash usage and available space.
The following options are available to remove unwanted files on an SRX system:
The operational mode command request system storage cleanup should be the first command to try in order to reduce the storage on the system. Follow the prompts to complete the storage cleanup operation. You can also execute the command request system storage dry-run to see the files that would be deleted. If there are some you want to save (such as configurations), you can manually delete the appropriate files. Refer to www.juniper.net/techpubs/en_US/junos12.1/topics/reference/command-summary/file-delete.html
Another command to delete the backup system software is request system software delete-backup. Note that this command does not perform any function on SRX Branch series devices with dual-root partitioning scheme (units that shipped with Junos OS 10.0 version or later).
Various directories on Junos systems can be opened, deleted, or modified, but it should be done with caution. Go to the shell prompt and navigate to the directory to delete unwanted files. Some files that can be safely removed are described below:
/var directory contains directories and sub directories such as /var/log and /var/tmp which essentially can be cleaned up.
Run the command “file list /var/log/” to see the log files created by the system. It is safe to delete the log files with a numeric extension to their names as they are the archives that are stored after the logs are rotated. Eg… “messages.0.gz” or “jsrpd.1.gz”.
Some of the older files sometimes contain the date on which they were created. Eg. “idpd_err.20091105” which means the file was created sometime on the 5th of November 2009. If you are not interested in storing such files you can safely delete them.
It is important that active logs that the system is using or working on are not deleted or hampered with at any time, as it could cause unexpected behaviors.
At times, a reboot of the device should be able to delete unwanted tmp files. It should also help in reducing some of the same on the device.
If AV and/or IDP is not used anymore, then those files can also be removed using the following commands: