Delete a lot of files from the Compact Flash card of a Cisco ASA

Today just out of the box a Cisco ASA 5505 contained a lot of FSCKxxxx.REC files. I saw this when using the show flash command.

ciscoasa# sh flash
--#--  --length--  -----date/time------  path
  142  25196544    May 15 2012 17:38:34  asa843-k8.bin
  110  0           May 15 2012 17:47:58  nat_ident_migrate
   13  2048        May 15 2012 17:40:10  coredumpinfo
   14  59          May 15 2012 17:40:10  coredumpinfo/coredump.cfg
  143  17902288    May 15 2012 17:41:16  asdm-647.bin
    2  2048        May 15 2012 17:43:08  log
    5  2048        May 15 2012 17:43:24  crypto_archive
  144  196         May 15 2012 17:43:26  upgrade_startup_errors_201205151743.log
  146  34816       Jan 01 1980 00:00:00  FSCK0000.REC
  147  12998641    May 15 2012 17:47:46  csd_3.5.2008-k9.pkg
  148  2048        May 15 2012 17:47:48  sdesktop
  172  0           May 15 2012 17:47:48  sdesktop/data.xml
  149  6487517     May 15 2012 17:47:50  anyconnect-macosx-i386-2.5.2014-k9.pkg
  150  6689498     May 15 2012 17:47:54  anyconnect-linux-2.5.2014-k9.pkg
  151  4678691     May 15 2012 17:47:58  anyconnect-win-2.5.2014-k9.pkg
  152  36864       Jan 01 1980 00:00:00  FSCK0001.REC
  153  2048        Jan 01 1980 00:00:00  FSCK0002.REC
  154  2048        Jan 01 1980 00:00:00  FSCK0003.REC
  155  4096        Jan 01 1980 00:00:00  FSCK0004.REC
  156  4096        Jan 01 1980 00:00:00  FSCK0005.REC
  157  4096        Jan 01 1980 00:00:00  FSCK0006.REC
  158  4096        Jan 01 1980 00:00:00  FSCK0007.REC
  159  6144        Jan 01 1980 00:00:00  FSCK0008.REC
  160  6144        Jan 01 1980 00:00:00  FSCK0009.REC
  161  6144        Jan 01 1980 00:00:00  FSCK0010.REC
  162  22528       Jan 01 1980 00:00:00  FSCK0011.REC
  163  38912       Jan 01 1980 00:00:00  FSCK0012.REC
  164  34816       Jan 01 1980 00:00:00  FSCK0013.REC
  165  43008       Jan 01 1980 00:00:00  FSCK0014.REC
  166  2048        Jan 01 1980 00:00:00  FSCK0015.REC
  167  28672       Jan 01 1980 00:00:00  FSCK0016.REC

Well you see in this example 16 FSCK Files. which could be deleted. To do this you have to issue the following command.
Del disk0/*.REC ( the 0 is a number Zero )

ciscoasa# del disk0:/*.REC
Delete filename [*.REC]?
Delete disk0:/FSCK0000.REC? [confirm]
Delete disk0:/FSCK0001.REC? [confirm]
Delete disk0:/FSCK0002.REC? [confirm]

This way helps you to delete all these REC files in one time. When you Show Flash you see that all teh REC files are gone.

ciscoasa# sh flash
--#--  --length--  -----date/time------  path
  142  25196544    May 15 2012 17:38:34  asa843-k8.bin
  110  0           May 15 2012 17:47:58  nat_ident_migrate
   13  2048        May 15 2012 17:40:10  coredumpinfo
   14  59          May 15 2012 17:40:10  coredumpinfo/coredump.cfg
  143  17902288    May 15 2012 17:41:16  asdm-647.bin
    2  2048        May 15 2012 17:43:08  log
    5  2048        May 15 2012 17:43:24  crypto_archive
  144  196         May 15 2012 17:43:26  upgrade_startup_errors_201205151743.log
  147  12998641    May 15 2012 17:47:46  csd_3.5.2008-k9.pkg
  148  2048        May 15 2012 17:47:48  sdesktop
  172  0           May 15 2012 17:47:48  sdesktop/data.xml
  149  6487517     May 15 2012 17:47:50  anyconnect-macosx-i386-2.5.2014-k9.pkg
  150  6689498     May 15 2012 17:47:54  anyconnect-linux-2.5.2014-k9.pkg
  151  4678691     May 15 2012 17:47:58  anyconnect-win-2.5.2014-k9.pkg
128573440 bytes total (54347776 bytes free)

This way it saves some space on you Compact Flashcard also.

2 thoughts on “Delete a lot of files from the Compact Flash card of a Cisco ASA”

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.