CCNA 200-301

CCNP Enterprise

CCNP Security

CCIE Enterprise Lab

CCIE Security Lab

CCNP Service Provider

CCNP Data Center

CCNP Collaboration

CCIE DC Lab

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.

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.

  1. 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#

  2. Execute the Primary Flash Inspection Command
    Run show flash: (or dir 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)
“`

  1. Read the Capacity Summary Footer
    Locate the final line of the command output, which reports two critical numbers in bytes:
  2. bytes total: The overall formatted capacity of the flash partition (11,353,194,496 bytes, or approximately 11.35 GB).
  3. bytes free: The unallocated space currently available for new files (6,421,843,968 bytes, or approximately 6.42 GB).
  4. Used Space Calculation: Subtract bytes free from bytes total to determine consumed storage, or inspect individual file sizes in the fourth column of the directory listing.

  5. Filter Output for Quick Capacity Audits
    When a switch contains dozens of unpacked .pkg files or diagnostic logs, bypass the file list by piping the command output to include bytes:
    ios
    Switch# show flash: | include bytes
    11353194496 bytes total (6421843968 bytes free)

  6. 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 the bytes free value by 1,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 Criteriashow flash:dir flash:show file systemsdir /all flash:
Primary PurposeDisplays layout and contents of the flash memory deviceLists files and subdirectories within a specified directory pathSummarizes all mounted storage media and partitions on the switchLists all visible, hidden, and undeleted files in flash
Scope of OutputDefault flash partition onlySpecified directory or default working directory (pwd)All partitions (flash:, nvram:, usbflash0:, crashinfo:, stack members)Target partition including system-hidden files
Capacity Metrics ShownTotal bytes, free bytes, and per-file byte sizeTotal bytes, free bytes, and per-file byte sizeTotal Size(b) and Free(b) side-by-side per mount pointTotal bytes, free bytes, and space held by deleted files
Hardware MetadataShows chip/sector geometry on legacy Class A/B flashStandard POSIX-style permissions (-rw-, drwx) and timestampsFile system type (disk, nvram, opaque) and access flags (rw, ro)Standard permissions plus [deleted] file markers on legacy flash
Default AliasFixed to flash: unless a specific device is appendedUses current working directory if flash: is omittedDisplays an asterisk (*) next to the current default file systemRequires explicit target or defaults to working directory
Best Use CaseQuick check of main flash contents and available spaceNavigating subdirectories (such as flash:/dc_profile_dir/)Auditing all storage volumes and stack member flash names at onceIdentifying 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 (disk type in show file systems). Deleting a file immediately increases the bytes free counter, and show flash: produces identical output to dir 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 total minus visible files will not equal bytes free until the partition is erased or squeezed.
  • show file systems Flags: In the output of show file systems, verify that your target flash partition displays rw (read/write) under the Flags column. A ro (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.

  1. 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
  2. If the system image is flash:packages.conf, the switch is running in Install Mode (standard for Catalyst 9000 series).
  3. If the system image ends in .bin, the switch is running in Bundle Mode (common on classic IOS and older Catalyst platforms).

  4. Remove Inactive Packages Automatedly (Install Mode Only)
    On Catalyst switches running IOS-XE in Install Mode, never manually delete .pkg files. Instead, run the built-in package cleanup command, which scans packages.conf across all stack members and automatically purges uncommitted .pkg files and leftover .bin archives:
    “`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:
``
Review the list of candidate files displayed by the prompt and type
y` to confirm deletion.

  1. Delete Obsolete .bin Images and Archives Manually (Bundle Mode & General Cleanup)
    If the switch operates in Bundle Mode, or if orphan .bin and .tar files remain in flash, remove them manually using the /force flag to skip confirmation prompts and /recursive for 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
``
*Warning:* Never delete
packages.conf,vlan.dat,multiple-fs, or any.pkg` file referenced by your active boot variable.

  1. 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-UTC

  2. Reclaim 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 the bytes free counter, run squeeze 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:

  1. Standard 32-Bit SNMP Polling (CISCO-FLASH-MIB)
    For switches with flash partitions smaller than 4.29 GB, poll the ciscoFlashPartitionTable using standard 32-bit Gauge32 objects:
  2. Total Partition Size (ciscoFlashPartitionSize): 1.3.6.1.4.1.9.9.10.1.1.4.1.1.4 (returns size in bytes).
  3. 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).

  4. 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,295 bytes). When polling Catalyst 9200, 9300, 9400, or 9500 switches, configure your NMS to query the 64-bit CounterBasedGauge64 objects:

  5. Extended Partition Size (ciscoFlashPartitionSizeExtended): 1.3.6.1.4.1.9.9.10.1.1.4.1.1.13
  6. Extended Free Space (ciscoFlashPartitionFreeSpaceExtended): 1.3.6.1.4.1.9.9.10.1.1.4.1.1.14

  7. Proactive Low-Space SNMP Trap Thresholds
    Instead of relying solely on periodic polling, you can monitor ciscoFlashPartitionLowSpaceNotifThreshold (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 a ciscoFlashPartitionLowSpaceNotif SNMP trap.

  8. 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 trigger install remove inactive before distributing the golden image.

  9. Enterprise Network Monitoring Platforms (SolarWinds, PRTG, LibreNMS, Observium)
    Platforms such as Observium, LibreNMS, SolarWinds Network Performance Monitor (NPM), and Paessler PRTG natively ingest CISCO-FLASH-MIB during 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.

  10. Ansible (cisco.ios.ios_facts) and Python Automation
    For on-demand pre-upgrade checks without SNMP, run an Ansible playbook utilizing the cisco.ios.ios_facts module (with gather_subset: hardware). Ansible populates the ansible_net_filesystems_info dictionary with exact spacetotal_kb and spacefree_kb values 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 to flash: 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 the cd command (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 / PlatformOfficial Cisco Manual TitleRelevant 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 GuidesSystem 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 SpecificationsCisco SNMP Object Navigator — CISCO-FLASH-MIBOID 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.

Please follow and like us:
Last modified: November 17, 2026

Author

Comments

Write a Reply or Comment

Your email address will not be published.