I have an ASA running 9.0(1) with four security contexts. When we modify a context, our standard procedure is to do a "write mem" inside that context. But sometimes we have to modify all the contexts in the same change window. Can we just do a "write mem" from the system context and save all the context configs at once?
You can do a write mem all:
Saving All Context Configurations at the Same Time
To save all context configurations at the same time, as well as the system configuration, enter the following command in the system execution space:
Command Purpose write memory all [/noconfirm] Example: hostname# write memory all /noconfirm Saves the running configuration to the startup configuration for all contexts and the system configuration.
If you do not enter the /noconfirm keyword, you see the following prompt:
Are you sure [Y/N]: After you enter Y, the ASA saves the system configuration and each context. Context startup configurations can reside on external servers. In this case, the ASA saves the configuration back to the server you identified in the context URL, except for an HTTP or HTTPS URL, which do not let you save the configuration to the server.
According to the documentation from Cisco it says
The running configuration that you edit in a configuration mode, or that is used in the copy or write commands, depends on your location. When you are in the system execution space, the running configuration consists only of the system configuration; when you are in a context, the running configuration consists only of that context. For example, you cannot view all running configurations (system plus all contexts) by entering the show running-config command. Only the current configuration displays.
It appears that you need to be in the context to write the changes.
Edit: The getting started documentation does tell you how to save multiple contexts at the same time by using write memory all