The Juniper EX4300 series features a compact 316 MB root (/) partition. Over time, accumulated log files, crash dumps, and old software packages can cause disk space warnings, preventing OS upgrades or configuration saves. This guide walks you through safely freeing up disk space using built-in Junos CLI and FreeBSD shell tools.
Prerequisites & Requirements
- Terminal or SSH access to the switch with administrative privileges
- Basic familiarity with Junos operational mode (
>) and FreeBSD shell (%).
Step 1: Run the Automated Junos Storage Cleanup
Junos provides an automated cleanup command that scans /var/log and /var/tmp to delete old, compressed system log files and temporary installation artifacts.
- Log in to the switch CLI and run:request
system storage cleanup - For a Virtual Chassis setup, clean up all member switches at once:request
system storage cleanup all-members - When prompted (
Do you want to proceed ? [yes,no]), typeyesto delete the identified candidates.
Step 2: Remove Inactive Software Packages
If an automated cleanup does not free up enough space, previous Junos OS release packages stored in the backup partition might still be present.
- View active packages to confirm what is installed:show
system software - Remove old, inactive Junos software packages:request
system software delete - On a Virtual Chassis, execute the removal across all nodes:request
system software delete all-members
Note: This command safely removes unused backup files without affecting the currently running Junos version.
Step 3: Manually Clear Large Files in /var/tmp and /var/crash
Temporary files, failed firmware uploads (.tgz), and kernel crash dumps stored in /var can consume significant space.
- Check for old firmware images or
.gzarchives in/var/tmp:file list /var/tmp/*.tgz file list /var/tmp/*.gz - Delete unwanted archive files:
file delete /var/tmp/<filename>.tgz - Clear system core dumps and crash reports:
file delete /var/crash/*
Step 4: Advanced Shell Cleanup (Root Mode)
For persistent storage issues where root (/) remains above 90% utilization, drop into the FreeBSD shell to locate hidden system files.
- Start the shell and elevate to root:
start shell su root - Check top-level directory disk usage on the root filesystem:
du -cksh /* | sort -rh - Clean out old log archives directly from
/var/log:rm-f /var/log/*.gz rm -f /var/log/*.[0-9].gz - Return to the Junos CLI:
exit
exit
Step 5: Verify Free Space
Check the storage status across all mounted filesystems:
show system storage
Key Areas to Monitor:
/(Root Partition): Ideal available space should be >50 MB for general operations (though ~90% capacity is normal for EX4300 architecture)./var/tmp: Ensure at least 300 MB–500 MB of free space is available prior to staging a Junos OS firmware upgrade.
