Deleting Files from Flash:
You want to erase files from your router’s flash.
To delete all of the files from your router’s flash memory, use the erase command:
As we have indicated, there are two ways to delete files from flash, depending on the type of router. The difference arose because Cisco routers use three different kinds of filesystems, called Class A, Class B, and Class C. Table 1-2 shows the filesystems that Cisco’s most common routers use.
Table 1-2. Supported filesystems of common Cisco routers
|Router type||Filesystem type|
|7000 (RSP)||Class A|
|7500 (RSP 2 ,4, and 8 )||Class A|
|Route Switch Module (RSM)||Class A|
Table 1-3 lists some of the different filesystem commands, their meanings, and the filesystems that they work with.
Table 1-3. Filesystem commands and their meanings
|Delete||All||Marks the files as deleted, but does not permanently remove them from flash.|
|Squeeze||A||Permanently removes all files that have been marked as deleted.|
|Format||A and C||Erases the entire flash device.|
|Verify||All||Verifies that the IOS file’s checksum matches the value encoded in the image.|
|Undelete||A and B||Recovers deleted files.|
|Erase||A and B||Erases the entire flash device.|
The erase command is not available on all router types. On routers that use the Class C filesystem, you can remove files from the flash only with the delete command.
The delete command marks files as deleted, but does not permanently remove them:
You can permanently remove this file and reclaim the space on the flash device with the squeeze command. Note, however, that only routers with the type A filesystem support this command:
The squeeze function can take up to several minutes, so be patient. Once the squeeze command is complete, you can view the flash device to verify that the file is gone:
The file is has now been permanently removed, and you can no longer recover it with the undelete command. On routers with filesystems that do not support the squeeze command, the only way to permanently remove deleted files is to use the erase command. However, the erase command deletes the entire flash system and will not permit you to delete individual files. It’s all or nothing. In the next recipe, we will look at ways to partition flash devices to reduce the impact of the erase command.