CF Memory Cards and the Squeeze Command

Im currently upgrading some devices for a customer all over the world, nothing I didnt do before but today I ran into something suprising, at least for me. The C2811 I was going to upgrade was not having enough flash space to hold the old and the new IOS (my prefered way for upgrades) so I had to delete the old IOS to be able to upload the new one.

But after the IOS was deleted, the router did not free the flash space, this was something I was used to on older devices (C2600 for example) but not with the newer ISR routers. Quick check on google did approve what I thought, I have to use the squeeze command to free up the flash after the IOS was deleted.

I´ve found the reason after another lookup, it seems that there are 2 different file systems installed in ISR routers (guess its not for ISR2 routers but I´m not sure) a Class B and a Class C file systems. The troubleshooting guide writes the following about those two types:

Cisco 3800 series routers, Cisco 2800 series routers, and Cisco 1800 series routers use external CompactFlash (CF) memory cards to store the system image, some software feature data, and configuration files. The CF memory cards use the following file systems. The file system that is supported depends on router mode

Class B flash file system, also known as the low-end file system (LEFS)

Class C flash file system, similar to the standard DOS file system

If the router uses a Class C file system deleted files will free the space on the flash (the one I was used to) while Class B file systems require a manual intervention to free up this space. Freeing up the space on those Class B file systems is done with the squeeze command:

Router# squeeze flash:
Squeeze operation may take a while. Continue? [confirm]
squeeze in progress...
Rebuild file system directory...
Squeeze complete

If you are using a Class B flash file system, after you enter the delete flash: command, the memory space of the deleted file remains occupied, although the deleted file cannot be recovered. To reclaim the memory space occupied by a deleted file, enter the squeeze flash: command, in privileged EXEC mode.

Which Class is used on the router can be checked with the command show flash all, the Class B file system will not show any geometry and format information while the Class C file system will. Examples are shown below and are taken from the guide Troubleshooting and Maintenance: Using CompactFlash Memory Cards

Class B file system

Router# show flash: all
Partition   Size    Used      Free      Bank-Size  State          Copy
1        125184K  20390K    104793K        0K      Read/Write

System Compact Flash directory:
File  Length   Name/status
addr      fcksum  ccksum
1   6658376  c28xx-i-mz
0x40      0xE0FF  0xE0FF
2   14221136  c2800-telcoent-mz
0x6599C8  0x5C3D  0x5C3D

[20879640 bytes used, 107308776 available, 128188416 total]
125184K bytes of ATA System Compact Flash (Read/Write)

Class C file system

Router# show flash: all
-#- --length-- -----date/time------ pat
1      6658376 Mar 01 2004 04:27:46 c28xx-i-mz
25268224 bytes available (6664192 bytes used)
******** ATA Flash Card Geometry/Format Info ********
Number of Heads:      4
Number of Cylinders    490
Sectors per Cylinder   32
Sector Size            512
Total Sectors          62720
Number of FAT Sectors  31
Sectors Per Cluster    8
Number of Clusters     7796
Number of Data Sectors 62560
Base Root Sector       155
Base FAT Sector        93
Base Data Sector       187

One comment

  1. Rip

    Thanks for this article.
    I am having some difficulty with a 2621 with 16384K of Flash. Currently I have IOS c2600-ik9s-mz.122-29. (which is 10840K) “show flash: all” shows 5543K Free. I am trying to see if I can run IOS c2600-advsecurityk9-mz.124-12.bin (which is 16036kb) on this router because I need to create a VPN to another 2651. c2600-ik9s-mz.122-29 won’t do AES (only DES, etc..)
    I get:
    PCYUL003#squeeze flash:
    Squeeze operation may take a while. Continue? [confirm]
    first create squeeze log by erasing the entire device

    %Error squeezing flash (Unknown error 0)

    I’m concerned about erasing the flash because c2600-ik9s-mz.122-29 would not initially load (I was getting a “file too big” error:

    %SYS-3-IMAGE_TOO_BIG: ‘flash:c2600-ik9s-mz.122-29’ is too large for available memory (9172012 bytes)

    I tried to load from tftp:

    %SYS-3-IMAGE_TOO_BIG: ‘tftp://’ is too large for available memory (9172012 bytes)
    Can you help? (sorry to impose)

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s