Back to Documentation

Flash Cleanup

Automated detection and safe removal of unused IOS images

Overview

Flash Cleanup identifies and removes IOS image files from device flash storage that are no longer needed - old images that were superseded by upgrades, duplicate copies left by failed transfers, or inactive Install Mode packages. Freeing flash space is a prerequisite for new upgrades and is required as part of regular maintenance hygiene.

Important: NetGUI never deletes files that are currently referenced by the boot variable or that are the currently active IOS image. A pre-deletion safety check always runs before any file is removed.

Scanning for Unused Files

The scanner connects to each device, runs show flash:, and identifies files that are safe to remove.

What is flagged for removal

  • IOS/IOS-XE image files (.bin) not referenced by the boot variable
  • Old Install Mode packages not in the active or committed install state
  • Temporary files (.tmp, partial transfers)
  • Duplicate files with identical content

Running a scan

1
Go to Flash Cleanup → Scan.
2
Select devices or device groups to scan.
3
Click Run Scan. Results show each device, current flash usage, files flagged for deletion, and projected free space after cleanup.
4
Review the results. You can uncheck individual files to exclude them from deletion.
5
Click Delete Selected to proceed.

Stack-Aware Cleanup

For stacked switches (e.g. Catalyst 3750, 9300 stacks), each stack member has its own flash. NetGUI is stack-aware and scans all members simultaneously.

  • The scan aggregates flash usage across all stack members.
  • Files are listed per-member with the member number clearly labeled.
  • Deletion is performed on each member where the file exists.
  • The active image on the stack master and all members is always protected.
Switch 1 flash: 4.2 GB / 7.8 GB used Switch 2 flash: 3.9 GB / 7.8 GB used Switch 3 flash: 4.5 GB / 7.8 GB used Files flagged for removal: [SW1] cat9k_iosxe.17.06.05.SPA.bin (838 MB) - not in boot variable [SW2] cat9k_iosxe.17.06.05.SPA.bin (838 MB) - not in boot variable [SW3] cat9k_iosxe.17.06.05.SPA.bin (838 MB) - not in boot variable

Batch Device Cleanup

Run flash cleanup across hundreds of devices in a single operation.

  1. Select all target devices using group filters (e.g. all switches at a site, or all devices upgraded in the last 90 days).
  2. Run the scan to preview what will be removed across the entire batch.
  3. Review the aggregate summary: total devices, total files, total MB to be reclaimed.
  4. Click Batch Delete. NetGUI processes devices in parallel with a configurable concurrency limit (default: 10 simultaneous sessions).
  5. A per-device result summary is available after completion.
Tip: Schedule batch cleanup as a recurring Workflow Automation job (e.g. monthly) to keep flash usage under control automatically.

Install Mode Cleanup

For Catalyst 9000 devices in Install Mode, unused packages accumulate after each upgrade commit. These are removed with the install remove inactive command.

NetGUI identifies Install Mode devices automatically during scanning and uses the correct cleanup method for each device type:

  • Bundle Mode devices: delete /force flash:{filename}
  • Install Mode devices: install remove inactive
install remove inactive Removing inactive package(s) from all members. [SW1] SUCCESS - freed 1.2 GB [SW2] SUCCESS - freed 1.2 GB

Safety Rules

The following files are always protected and will never be flagged or deleted by Flash Cleanup regardless of configuration:

  • The currently active IOS/IOS-XE image (as reported by show version)
  • Any image referenced in the current boot variable (show boot)
  • The committed Install Mode package set
  • The running configuration file
  • VLAN database files (vlan.dat)
  • Private configuration files

All deletions are logged in the Activity Log with the filename, file size, device, and the user who initiated the cleanup.