February 8, 2012

Can’t write mem on ASA

frustratedToday while working on a config of a new ASA5510 I ran into a very strange error that I wanted to share with you.

I was configured the ASA as usual. When I was finished, I issued the standard "write mem" and saw the most bizarre error message...

asa# wr mem
Building configuration…
Cryptochecksum: 85ef8693 914a94f3 03a5bb9e 823bb285
%Error opening disk0:/.private/startup-config (Read-only file system)
Error executing command [FAILED]

I was speachless. What the heck does that mean? I could see the startup-config file on the firewall. I could do a "sh run" and see my running config. But I could not copy my running config to startup.

I tried a reboot but that only wiped out my config completely. I had to start over from scratch.

The solution was actually very simple.

Cisco has a built in file check utility to fix problems just like this. Many folks who are familiar with unix systems also know the file system check or fsck utility.

To fix this problem, from the command prompt run fsck...

asa# fsck disk0:

This of course assume that disck0: is your flash.

If this is successful you should see the following output:
asa# fsck of disk0: complete

You should now be able to save your config

asa# wr mem

Building configuration…

Cryptochecksum: 85ef8693 914a94f3 03a5bb9e 823bb285

80911 bytes copied in 4.60 secs (20227 bytes/sec) [OK]

If this still fails you need to contact Cisco TAc and get a replacement flash card

Here is the complete transaction in its entirety:

asa#copy run start

Source filename [running-config]?
Cryptochecksum: e958a84f 73198ab5 585c5a9f 9d39e3a8

%Error opening disk0:/.private/startup-config (Read-only file system)

asa# fsck disk0:
dosfsck 2.11, 12 Mar 2005, FAT32, LFN
Reclaimed 7 unused clusters (28672 bytes) in 2 chains.
Performing changes.
/dev/hda1: 76 files, 14623/15368 clusters

fsck of disk0: complete
asa# wr mem
Building configuration...
Cryptochecksum: b558388d cddfa287 d63f9b9a 10041e77

11870 bytes copied in 3.360 secs (3956 bytes/sec)
[OK]
asa#

I hope this helps you out as much as it did for me. I was tearing my hair out trying to figure out what was going on.

Until next time

FREAK!


Related posts:

  1. Basic Configuration Tutorial For the Cisco ASA 5505 Firewall
  2. Cisco ASA 5540 Appliance Review
  3. How to Change or Increase Cisco Router Logging
  4. Review: Cisco ASA 5500

Comments

  1. niko says:

    It works perfectly! Thank you very much.

  2. Naveen says:

    Super..I was having this issue and ur write up nailed it..

    By any chance is there any expalnation of the issue and its soln??

    I was haivng this issue only wen both the FWs were in failover mode.

    If the standby went down, I could wr mem on pri..

    Now I am able to do wen both are up…

  3. Ben says:

    We just had the same issue on our standby ASA 5520. The primary one was fine, but the failover standby ASA gave the exact message you saw. I actually first noticed there was a problem when trying to upgrade to the latest ASA and ASDM versions.

    Doing it via TFTP gave read-only errors, or no message at all but a failed copy, and doing it via ASDM just reported ‘error code 400′ which was fairly meaningless.

    Running that fsck has fixed it, so glad to have found this post, thanks.

  4. Chethan says:

    ciscoasa# fsck disk0:
    umount: Couldn’t umount /mnt/disk0: Invalid argument
    dosfsck 2.11, 12 Mar 2005, FAT32, LFN
    /dev/hda1: 32 files, 56/62334 clusters
    mount: Mounting /dev/hda1 on /mnt/disk0 failed: Device or resource busy

    fsck of disk0: complete
    WARNING: Restoring security context mode failed.

    the problem still exist Kindly help…!

    • Joe says:

      I haven’t run into this problem before. Are you running multiple contexts? Is this in a stand along ASA or a FWSM? I’ve seen some issues with code versions that may give the warning message. Sorry that this is much more help.

    • Mpho says:

      ciscoasa# sh mem
      Free memory: 17657000 bytes (13%)
      Used memory: 116560728 bytes (87%)
      ————- —————-
      Total memory: 134217728 bytes (100%)

      ciscoasa# fsck disk0
      umount: Couldn’t umount /mnt/disk0: Invalid argument
      dosfsck 2.11, 12 Mar 2005, FAT32, LFN
      /dev/hda1: 11 files, 6228/62334 clusters
      mount: Mounting /dev/hda1 on /mnt/disk0 failed: Device or resource busy

      fsck of disk0: complete
      WARNING: Restoring security context mode failed.
      I have stopped nad restarted the Asa firewall but still it doesn’t free memory.

  5. Adam says:

    I have the same error message concerning disk0: but it’s because the internal flash has died. The device is still running and I’ve managed to pop in an external flash card, format it as disk1, and upload the correct software to it. I have changed the boot system and asdm image with the following command:

    boot system disk1:/asa724-k8.bin
    asdm image disk0:/asdm-61551.bin

    I then ran:

    copy run disk1:/ (- which executed successfully)

    Now I can’t ‘wr mem’ to disk1. I still get the error mentioned about disk0 in your original post. Being that disk0 is destroyed, how can i make this thing default to disk1. I’m assuming that’s what needs to happen.

    Thanks!

    A

    But I need to be able to ‘wr mem’ to disk1. Is this possible?

  6. vesna says:

    I have similar problem with FWSM.

    show disk:
    -#- –length– —–date/time—— path
    1 0 Jan 27 2008 22:55:22 .private
    2 0 Jan 27 2008 22:55:22 .private
    3 0 Jan 27 2008 22:55:22 .private
    4 0 Jan 27 2008 22:55:22 .private
    5 0 Jan 27 2008 22:55:22 .private
    6 0 Jan 27 2008 22:55:22 .private
    7 0 Jan 27 2008 22:55:22 .private
    8 0 Jan 27 2008 22:55:22 .private
    9 0 Jan 27 2008 22:55:22 .private
    10 0 Jan 27 2008 22:55:22 .private
    11 0 Jan 27 2008 22:55:22 .private
    12 0 Jan 27 2008 22:55:22 .private
    13 0 Jan 27 2008 22:55:22 .private
    14 0 Jan 27 2008 22:55:22 .private
    15 0 Jan 27 2008 22:55:22 .private
    16 1385 Mar 08 2008 07:55:50 old_running.cfg
    17 7350 Feb 22 2011 02:07:54 admin.cfg
    18 42691 Feb 25 2011 13:27:40 Serveri.cfg

    59658240 bytes available (90112 bytes used)
    File Allocation Table might be corrupted. Recommend running “fsck disk:”

    fsck disk:

    Checking the boot sector and partition table…
    Checking FAT, Files and Directories…
    Reclaiming unused space…
    Updating FAT…
    Destroying old disk cache…
    Initializing disk: cache, please wait…..Done.

    fsck of disk: complete
    WARNING: Restoring security context mode failed.

    Could be failed flash?

    • Joe says:

      It could be… the only way to know for sure is to either replace the flash or open a TAC case and see what they say. I’d love to know how it turns out either way.
      thanks!

  7. ashok says:

    I am trying to install new image to ASA in Romon I have erased the all data in disk0

    Why booting i am getting following error , looks like disk0 is not mounting

    rommon #13> tftp
    ROMMON Variable Settings:
    ADDRESS=192.168.1.10
    SERVER=192.168.1.1
    GATEWAY=192.168.1.1
    PORT=Management0/0
    VLAN=untagged
    IMAGE=asa823-k8.bin
    CONFIG=
    LINKTIMEOUT=20
    PKTTIMEOUT=4
    RETRY=20

    tftp asa823-k8.bin@192.168.1.1 via 192.168.1.1
    !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
    Received 15243264 bytes

    Launching TFTP Image…

    Cisco Security Appliance admin loader (3.0) #0: Fri Aug 6 07:52:16 MDT 2010
    Platform ASA5520

    Loading…
    dosfsck 2.11, 12 Mar 2005, FAT32, LFN
    open /dev/hda1:No such file or directory
    dosfsck(/dev/hda1) returned 1
    mount: mounting /dev/hda1 on /mnt/disk0 failed: No such file or directory
    mount: mounting /dev/hda1 on /mnt/disk0 failed: No such file or directory
    dosfsck 2.11, 12 Mar 2005, FAT32, LFN
    open /dev/hdb1:No such file or directory
    dosfsck(/dev/hdb1) returned 1
    mount: mounting /dev/hdb1 on /mnt/disk1 failed: No such file or directory
    mount: mounting /dev/hdb1 on /mnt/disk1 failed: No such file or directory

    Processor memory 341417984, Reserved memory: 62914560 (DSOs: 0 + kernel: 62914560)

    Total SSMs found: 0

    Total NICs found: 7
    mcwa i82557 Ethernet at irq 11 MAC: 001f.ca09.24b7
    mcwa i82557 Ethernet at irq 5 MAC: 0000.0001.0001
    i82547GI rev00 Gigabit Ethernet @ irq11 dev 1 in

  8. Dinesh says:

    Today while working on a config of a new CISCO catalyst 3750 x-series,I ran into a very strange error that I wanted to share with you.

    When I was finished, the error mess was
    SW#wr
    startup-config file open failed (Not enough space)
    please anybody help me…

    • Joe says:

      Hi Dinesh,
      You may want to try to delete some files on your flash drive and reduce the logging buffer.

      In some circumstances you may want to keep multiple IOS images on the local flash drive of your router or switch. The problem with this is that you could easily run out of space on your flash drive..

      Check the flash drive by simple typing in:
      SW# dir flash:

      This will show you what files you have on your flash and what is taking up so much space.

      To remove an upwanted file, type:
      SW# delete

      I hope this helps!

      Joe

      • Dinesh says:

        0 bytes copied in 0.009 secs (0 bytes/sec)
        DR-WAN-SW#diu r
        Directory of flash:/

        2 -rwx 1048 Mar 4 1993 14:46:57 +00:00 multiple-fs
        3 drwx 1024 Mar 1 1993 00:02:28 +00:00 crashinfo_ext
        12 drwx 1024 Mar 1 1993 00:00:07 +00:00 crashinfo
        21 -rwx 1096 Mar 2 1993 17:57:37 +00:00 vlan.dat
        22 drwx 512 Mar 1 1993 00:17:16 +00:00 c3750e-universalk9-mz.122-55.SE3

        57671680 bytes total (20429824 bytes free)
        DR-WAN-SW#copy
        DR-WAN-SW#copy runn
        DR-WAN-SW#copy running-config flash:back
        DR-WAN-SW#copy running-config flash:backu
        DR-WAN-SW#copy running-config flash:backup
        Destination filename [backup]?

        4700 bytes copied in 5.814 secs (808 bytes/sec)
        DR-WAN-SW#dr ir
        Directory of flash:/

        2 -rwx 1048 Mar 4 1993 14:46:57 +00:00 multiple-fs
        3 drwx 1024 Mar 1 1993 00:02:28 +00:00 crashinfo_ext
        12 drwx 1024 Mar 1 1993 00:00:07 +00:00 crashinfo
        21 -rwx 1096 Mar 2 1993 17:57:37 +00:00 vlan.dat
        469 -rwx 4700 Mar 1 1993 00:51:31 +00:00 backup
        22 drwx 512 Mar 1 1993 00:17:16 +00:00 c3750e-universalk9-mz.122-55.SE3

        57671680 bytes total (20424192 bytes free)

        But memory space available in the switch and these and all basic switch configuration files na…these anything i want to delete…?

  9. Mansoor says:

    I am having the same problem but with disk1: I have used the same external compact flash in another ASA but a newer IOS version 8.4 and it works fine. I have tried the same compact flash in a cisco 2851 and it works there as well. Could it be a bug in the Cisco IOS version 8.2 for ASA 5520? Or does anyone have a work around?

Speak Your Mind

*