How to troubleshoot ‘/var partition usage is high

This article provides steps on how to troubleshoot what is taking up the disk space in an EX switch. Running the command ‘show chassis alarms’ on an EX switch returns the following message:
Minor Host 0 /var partition usage is high.
What could be consuming the disk space?
When checking the device utilization, the following output is returned:

Example scenario using Unix shell commands to find out what is taking up space in an EX switch:

1.Enter the command ‘start shell’

2.Go to the upper level of the /var/ partition by using the following commands:

3.Check folder utilization:

In this case, it appears that most of the disk space is being consumed by the tmp folder (a partition of its own) and the home file.

4.There is a limitation with the du tool. We cannot tell if it is an actual file or a directory. Use the following command to confirm:

The first column shows a lowercase d, which in Unix, indicates it is a directory.

5.Enter this directory and run the procedure again to find out what is using up the space inside /var/home:

This reveals that most of the usage comes from the lab directory.

6.Repeat the procedure once more to see files under the lab directory:

The space is being consumed by two files; foo and bar.

7.Run the files to find out what they are:

This reveals they are tarballs. In most scenarios /var/ utilization increases either because tarball upgrade packets were copied to a wrong directory, or a packet capture was running for too long.

8.Remove the files:

After about 20 minutes the alarm will clear by itself.

9.Another helpful command is ‘request system storage cleanup dry-run’

Important Notes:

  • Unless you are familiar with the Junos file system, or you have been advised to do so by a JTAC engineer; do not attempt to delete files outside the /var/home directory, as it can break your switch.
  • Unless strictly necessary, do not log into the console as ‘root’, because the switch will allow you to delete critical system files.
  • Remember that Unix does not recognize file extensions, so it is common to have a file with no extension.

About the author

James Palmer

Leave a Comment