Verifying available flash memory on a Cisco switch is a mandatory check before staging firmware upgrades, storing packet captures, or troubleshooting unexpected system reloads. Because flash storage holds the operating system image, boot configuration packages, and diagnostic crash logs, running out of space can cause software installations to fail mid-deployment. Understanding how to inspect storage metrics across standalone switches, multi-switch stacks, and enterprise monitoring platforms ensures your network hardware remains ready for maintenance.
Table of Contents
Step-by-Step Guide to Checking Flash Memory via the Cisco CLI
Checking the total, used, and remaining storage capacity on a Cisco switch requires only a few commands in the command-line interface (CLI). Follow this sequential progression to inspect your primary flash partition and calculate available space.
Access Privileged EXEC Mode
Connect to the switch via SSH or console and elevate your session to Privileged EXEC mode. While basic directory views work in User EXEC mode (Switch>), full file system diagnostics require elevated privileges:
ios
Switch> enable
Switch#Execute the Primary Flash Inspection Command
Runshow flash:(ordir flash:) to list all files stored in the default flash partition alongside the storage summary:
“`ios
Switch# show flash:
Directory of flash:/
1 -rw- 4096 Nov 10 2026 08:14:22 +00:00 vlan.dat
2 -rw- 2097 Nov 12 2026 14:02:11 +00:00 multiple-fs
3 -rw- 489214592 Oct 04 2026 09:30:00 +00:00 cat9k_lite_iosxe.17.09.04a.SPA.bin
4 -rw- 1245 Oct 04 2026 09:34:18 +00:00 packages.conf
11353194496 bytes total (6421843968 bytes free)
“`
- Read the Capacity Summary Footer
Locate the final line of the command output, which reports two critical numbers in bytes: bytes total: The overall formatted capacity of the flash partition (11,353,194,496 bytes, or approximately 11.35 GB).bytes free: The unallocated space currently available for new files (6,421,843,968 bytes, or approximately 6.42 GB).Used Space Calculation: Subtract
bytes freefrombytes totalto determine consumed storage, or inspect individual file sizes in the fourth column of the directory listing.Filter Output for Quick Capacity Audits
When a switch contains dozens of unpacked.pkgfiles or diagnostic logs, bypass the file list by piping the command output toinclude bytes:
ios
Switch# show flash: | include bytes
11353194496 bytes total (6421843968 bytes free)Convert Bytes to Megabytes or Gigabytes
Cisco IOS and IOS-XE always report flash storage in raw bytes. For quick capacity planning before transferring a new image, divide thebytes freevalue by1,048,576($1024^2$) to get Megabytes (MiB), or move the decimal point nine places to the left for a quick Gigabyte (GB) estimate.
Key Takeaway: Always inspect the bottom summary line of show flash: and convert the raw byte count into gigabytes to verify that your available space exceeds the size of any incoming firmware file plus extraction overhead.
Comparing show flash:, dir flash:, and show file systems
While the basic inspection steps above reveal free space on the primary partition, Cisco IOS provides several distinct file system commands that expose different metadata. Choosing the right command helps you distinguish between a single directory’s contents and the switch’s entire storage architecture.
| Comparison Criteria | show flash: | dir flash: | show file systems | dir /all flash: |
|---|---|---|---|---|
| Primary Purpose | Displays layout and contents of the flash memory device | Lists files and subdirectories within a specified directory path | Summarizes all mounted storage media and partitions on the switch | Lists all visible, hidden, and undeleted files in flash |
| Scope of Output | Default flash partition only | Specified directory or default working directory (pwd) | All partitions (flash:, nvram:, usbflash0:, crashinfo:, stack members) | Target partition including system-hidden files |
| Capacity Metrics Shown | Total bytes, free bytes, and per-file byte size | Total bytes, free bytes, and per-file byte size | Total Size(b) and Free(b) side-by-side per mount point | Total bytes, free bytes, and space held by deleted files |
| Hardware Metadata | Shows chip/sector geometry on legacy Class A/B flash | Standard POSIX-style permissions (-rw-, drwx) and timestamps | File system type (disk, nvram, opaque) and access flags (rw, ro) | Standard permissions plus [deleted] file markers on legacy flash |
| Default Alias | Fixed to flash: unless a specific device is appended | Uses current working directory if flash: is omitted | Displays an asterisk (*) next to the current default file system | Requires explicit target or defaults to working directory |
| Best Use Case | Quick check of main flash contents and available space | Navigating subdirectories (such as flash:/dc_profile_dir/) | Auditing all storage volumes and stack member flash names at once | Identifying hidden files or unrecovered space on older switches |
Interpreting Output Metrics Across Cisco File System Classes
When reading the Size and Free metrics across these commands, how the switch calculates free space depends on its underlying file system class:
- Class C File Systems (Modern Catalyst 2960-X, 3650, 3850, and 9000 Series): Uses standard disk-style allocation (
disktype inshow file systems). Deleting a file immediately increases thebytes freecounter, andshow flash:produces identical output todir flash:. - Class A and B File Systems (Legacy IOS Devices): Found on older linear flash architectures. Deleted files are marked as deleted rather than erased immediately, meaning
bytes totalminus visible files will not equalbytes freeuntil the partition is erased or squeezed. show file systemsFlags: In the output ofshow file systems, verify that your target flash partition displaysrw(read/write) under theFlagscolumn. Aro(read-only) flag indicates file system corruption or hardware write protection requiring a reboot or maintenance check.
Key Takeaway: Use show file systems when you need a high-level capacity overview of every storage volume on the chassis, and use dir flash: when navigating specific subdirectories.
CLI Templates for Switch Stacks, Redundant Supervisors, and NX-OS
In enterprise deployments, inspecting the active supervisor or stack master is only half the job—every member switch in a stack and every standby supervisor engine maintains its own independent flash partition. Use the following CLI templates to check flash storage across multi-unit and multi-OS environments.
! =====================================================================
! 1. CISCO CATALYST STACKWISE (IOS / IOS-XE: Catalyst 9200, 9300, 3850)
! =====================================================================
! List all mounted stack member flash prefixes (e.g., flash-1:, flash-2:)
Switch# show file systems | include flash
! Check flash space on a specific stack member (replace <member-id> with 1-9)
Switch# dir flash-<member-id>: | include bytes
! Alternative syntax supported on older Catalyst stacks (2960-X / 3750-X)
Switch# show flash<member-id>:
! =====================================================================
! 2. MODULAR DUAL-SUPERVISOR SWITCHES (Catalyst 9400, 9600, 6500, 4500)
! =====================================================================
! Check Active Supervisor flash storage
Switch# dir bootflash: | include bytes
! Check Standby Supervisor flash storage on IOS-XE (Catalyst 9400/9600)
Switch# dir stby-bootflash: | include bytes
! Check Standby Supervisor flash storage on Classic IOS (Catalyst 4500/6500)
Switch# dir slavebootflash: | include bytes
!Check USB flash drive inserted into Active Supervisor
Switch# dir usbflash0: | include bytes
! =====================================================================
! 3. CISCO NEXUS SWITCHES (NX-OS: Nexus 9000, 7000, 3000 Series)
! =====================================================================
! Check primary bootflash directory and usage summary (Active Supervisor)
switch# dir bootflash: | include bytes
! Check Standby Supervisor bootflash on dual-supervisor Nexus chassis
switch# dir bootflash://sup-standby/ | include bytes
! Inspect all internal Linux-backed flash partitions (/bootflash, /nxos/tmp)
switch# show system internal flash
Key Takeaway: Always verify available flash space on every stack member (flash-1:, flash-2:, etc.) and standby supervisor (stby-bootflash:) before an upgrade, as a single full member will cause a cluster-wide installation to abort.
How to Free Up Flash Memory Before an IOS Upgrade
If your inspection reveals that free flash memory is below the 1 GB to 1.5 GB threshold required to expand modern Cisco IOS-XE images, you must safely clean the file system before transferring new firmware. Follow this sequential procedure to reclaim space without deleting active boot files.
- Verify the Currently Running Image and Boot Mode
Before deleting any files, confirm which image or package configuration file the switch is actively using so you do not render the device unbootable:
ios
Switch# show version | include System image|Installation mode
System image file is "flash:packages.conf"
Installation mode is INSTALL - If the system image is
flash:packages.conf, the switch is running in Install Mode (standard for Catalyst 9000 series). If the system image ends in
.bin, the switch is running in Bundle Mode (common on classic IOS and older Catalyst platforms).Remove Inactive Packages Automatedly (Install Mode Only)
On Catalyst switches running IOS-XE in Install Mode, never manually delete.pkgfiles. Instead, run the built-in package cleanup command, which scanspackages.confacross all stack members and automatically purges uncommitted.pkgfiles and leftover.binarchives:
“`ios
! For Cisco IOS-XE 16.10.1 and all 17.x releases:
Switch# install remove inactive
! For older Cisco IOS-XE 16.x releases (16.1.x to 16.9.x):
Switch# request platform software package clean switch all file flash:
``y` to confirm deletion.
Review the list of candidate files displayed by the prompt and type
- Delete Obsolete
.binImages and Archives Manually (Bundle Mode & General Cleanup)
If the switch operates in Bundle Mode, or if orphan.binand.tarfiles remain in flash, remove them manually using the/forceflag to skip confirmation prompts and/recursivefor old web UI directories:
“`ios
! Delete a single obsolete .bin image file
Switch# delete /force flash:c2960x-universalk9-mz.152-4.E7.bin
! Delete an old extracted HTML directory tree
Switch# delete /force /recursive flash:c2960x-universalk9-mz.152-4.E7
``packages.conf
*Warning:* Never delete,vlan.dat,multiple-fs, or any.pkg` file referenced by your active boot variable.
Clear Old Crashinfo Logs and Packet Captures
Diagnostic core dumps (core_), crash logs, and forgotten Embedded Packet Capture (.pcap) files frequently consume hundreds of megabytes. List and remove outdated diagnostic files:
ios
Switch# dir flash:*.pcap
Switch# delete /force flash:troubleshooting_capture.pcap
Switch# delete /force crashinfo:crashinfo_20250814-021501-UTCReclaim Deleted Space on Legacy Flash (
squeeze)
If you are maintaining a legacy Class A or Class B flash device where deleting files did not increase thebytes freecounter, runsqueeze flash:to permanently purge[deleted]blocks and defragment free space. Finally, re-run the capacity check covered in the first section to confirm you have met your upgrade storage target.
Key Takeaway: Always use install remove inactive to clean up IOS-XE Install Mode switches rather than manually deleting .pkg files, and verify active boot files with show version before removing any .bin image.
SNMP OIDs and Network Management Tools for Fleet-Wide Flash Auditing
Logging into switches one by one via CLI is impractical when preparing hundreds of access switches for a network-wide code upgrade. Network administrators can automate flash storage audits at scale using SNMP MIB polling, orchestration tools, and commercial monitoring suites:
- Standard 32-Bit SNMP Polling (
CISCO-FLASH-MIB)
For switches with flash partitions smaller than 4.29 GB, poll theciscoFlashPartitionTableusing standard 32-bitGauge32objects: - Total Partition Size (
ciscoFlashPartitionSize):1.3.6.1.4.1.9.9.10.1.1.4.1.1.4(returns size in bytes). Available Free Space (
ciscoFlashPartitionFreeSpace):1.3.6.1.4.1.9.9.10.1.1.4.1.1.5(returns largest single file size in bytes that can be copied in).64-Bit Extended SNMP OIDs for Catalyst 9000 Series
Modern Cisco switches carry 8 GB to 16 GB+ of internal flash, which exceeds the 32-bit SNMP integer ceiling (4,294,967,295bytes). When polling Catalyst 9200, 9300, 9400, or 9500 switches, configure your NMS to query the 64-bitCounterBasedGauge64objects:- Extended Partition Size (
ciscoFlashPartitionSizeExtended):1.3.6.1.4.1.9.9.10.1.1.4.1.1.13 Extended Free Space (
ciscoFlashPartitionFreeSpaceExtended):1.3.6.1.4.1.9.9.10.1.1.4.1.1.14Proactive Low-Space SNMP Trap Thresholds
Instead of relying solely on periodic polling, you can monitorciscoFlashPartitionLowSpaceNotifThreshold(1.3.6.1.4.1.9.9.10.1.1.4.1.1.15), which defines the minimum percentage of free space on a partition before the switch generates aciscoFlashPartitionLowSpaceNotifSNMP trap.Cisco Catalyst Center (Formerly Cisco DNA Center)
Cisco Catalyst Center includes a dedicated Software Image Management (SWIM) engine that automatically audits flash space across your entire switch inventory during the Pre-Upgrade Check phase. If a switch lacks sufficient flash capacity, Catalyst Center can automatically triggerinstall remove inactivebefore distributing the golden image.Enterprise Network Monitoring Platforms (SolarWinds, PRTG, LibreNMS, Observium)
Platforms such as Observium, LibreNMS, SolarWinds Network Performance Monitor (NPM), and Paessler PRTG natively ingestCISCO-FLASH-MIBduring device discovery. These tools graph historical flash utilization and trigger alerts when a sudden storage spike—such as an automated core dump or runaway debug log—threatens to fill the partition.Ansible (
cisco.ios.ios_facts) and Python Automation
For on-demand pre-upgrade checks without SNMP, run an Ansible playbook utilizing thecisco.ios.ios_factsmodule (withgather_subset: hardware). Ansible populates theansible_net_filesystems_infodictionary with exactspacetotal_kbandspacefree_kbvalues for every mounted flash volume, allowing playbooks to conditionally skip or clean switches that fall below your threshold.
Key Takeaway: When monitoring modern Catalyst 9000 switches via SNMP, always poll the 64-bit ciscoFlashPartitionFreeSpaceExtended OID (1.3.6.1.4.1.9.9.10.1.1.4.1.1.14) so partitions larger than 4.29 GB are not truncated.
Cisco File System Command Reference and Official Documentation Index
This section provides the formal command syntax specifications and the official Cisco documentation structure for file system management across Cisco operating systems.
Formal Command Syntax Specifications
show [filesystem:]- Description: Displays the physical layout, file directory, and byte capacity summary of a specified flash memory file system.
- Command Mode: User EXEC (
>) or Privileged EXEC (#). Syntax Arguments:
filesystem:(Optional) — Specifies the flash memory device prefix followed by a colon (for example,flash:,bootflash:,slot0:,stby-bootflash:). Defaults toflash:when omitted.dir [/all | /recursive] [filesystem:[directory | filename]]- Description: Displays a list of files and subdirectories on a file system.
- Command Mode: User EXEC (
>) or Privileged EXEC (#). Syntax Arguments:
/all(Optional) — Lists all files, including deleted and system-hidden files./recursive(Optional) — Lists files across all subdirectories dynamically.filesystem:(Optional) — Target storage prefix followed by a colon. If omitted, uses the working directory defined by thecdcommand (pwd).
show file systems- Description: Lists all available file systems registered on the switch, including their byte size, free byte capacity, media type, access permissions, and alias prefix names.
- Command Mode: Privileged EXEC (
#). - Syntax Arguments: This command accepts no arguments or keywords.
Official Cisco Documentation Publications by OS Train
| Operating System / Platform | Official Cisco Manual Title | Relevant Chapter / Command Section |
|---|---|---|
| Cisco IOS (Classic 12.2 / 15.x) | Cisco IOS Configuration Fundamentals Command Reference | “Cisco IOS File System Commands” (show (flash file system), show file systems, dir, delete, squeeze) |
| Cisco IOS-XE (Catalyst 9000 Series, 16.x / 17.x) | Command Reference, Cisco IOS XE [Release] (Catalyst 9300 / 9200 / 9500 Switches) | “System Management Commands” (install remove inactive, show file systems, dir) |
| Cisco IOS-XE Configuration Guides | System Management Configuration Guide, Cisco IOS XE [Release] | “Managing Configuration Files” and “Performing Setup and Configuration” |
| Cisco NX-OS (Nexus 9000 / 7000 Series) | Cisco Nexus 9000 Series NX-OS Fundamentals Command Reference | “F Commands” and “D Commands” (dir, show file, delete, show system internal flash) |
| Cisco SNMP MIB Specifications | Cisco SNMP Object Navigator — CISCO-FLASH-MIB | OID Tree 1.3.6.1.4.1.9.9.10 (ciscoFlashDevice and ciscoFlashPartitions) |
Key Takeaway: Consult the System Management Command Reference matching your specific IOS-XE or NX-OS release train whenever verifying platform-specific storage prefixes or package installation syntax.
Maintaining visibility into your Cisco switch flash memory prevents failed upgrades and unexpected storage bottlenecks. By combining quick CLI inspections (show flash: and show file systems) with stack-wide checks, safe package cleanup via install remove inactive, and automated 64-bit SNMP monitoring, you can keep every switch in your network ready for seamless software maintenance.











Comments