Heres some information I found from Cisco.
CSCds13173
On a Cisco 800 series router that is running Cisco IOS Release 12.1(3) through 12.1(5.2), you may receive an error message when trying to save the running configuration if it consumes more than 4 KB of NVRAM. This situation is most evident after the router generates a Rivest, Shamir, and Adelman (RSA) key pair because even a small configuration may require over 4 KB of NVRAM because of RSA key space requirements. The router displays the following error message:
router#write memory
Building configuration... [OK] ->
NVRAM Verification Failed
router#
As a result of the above error, the entire contents of NVRAM are erased, including the startup configuration.
Workaround: Decrease the number of bits in the modules for the RSA keys by using the service compress-config global configuration command to reduce consumed NVRAM space, or use the boot config flash: command to save some of the configurations in a Flash file rather than in NVRAM.
Alternate workaround: Use Cisco IOS Release 12.1(5.3) or a later release
Jeter@LasVegas.com
J.Fisher CCNA