Imagine you're working on your computer and suddenly the electricity goes out is there a way to recover the data lost in this case?
Yes, but you probably don't have the equipment required to extract it. A residual charge will remain on the capacitors within the memory itself, but it's so small that extremely sensitive equipment is required to detect it, much less read it.
Read this page, section 7.
The only solution is to use an Uninterruptible power supply (or battery backed power supply):
An uninterruptible power supply, also uninterruptible power source, UPS or battery/flywheel backup, is an electrical apparatus that provides emergency power to a load when the input power source, typically the utility mains, fails. A UPS differs from an auxiliary or emergency power system or standby generator in that it will provide instantaneous or near-instantaneous protection from input power interruptions by means of one or more attached batteries and associated electronic circuitry for low power users. The on-battery runtime of most uninterruptible power sources is relatively short—5–15 minutes being typical for smaller units—but sufficient to allow time to bring an auxiliary power source on line, or to properly shut down the protected equipment.
A UPS will also protect you from power surges, which is the opposite danger of having too much electricity ...
If you mean the main memory of your computer then no, it is not recoverable after power failure
Some applications have some form of autosave feature which may at intervals save a version of open documents etc.
Imagine you're working on your computer and suddenly the electricity goes out. Is there a way to recover the data lost in this case?
In most cases: No.
In the current generation of computers the working data is stored in DRAMs.
The working of a DRAM can be described as a leaky bucket with water. If it is mostly full then the bucket represents a
1. If it is mostly empty it represents a
Now these buckets are leaky and stand on a floor with a layer of water in it. If you fill it to the brim with water then it will slowly leak out. Of you empty it then some water may leak into it.
To 'fix' this the buckets are checked every so often. Simply imagine someone walking past buckets of water. It they contain a little bit of water (a
0) they are completely emptied. If they are mostly full (a
1 then they are topped up.
This is a volatile state which gets stopped as soon as your computer looses power.
If you have very specialized equipment then you might be able to quickly cool down the DRAM chips (e.g. by spraying liquid nitrogen on them cooling the DRAM chips to 77 K (−196 °C, −321 °F). That will buy you some time to move the chips to dedicated equipment to read their contents.
As a private user you probably neither have this equipment, nor the skip to use the resulting raw information. And the time to do this gets ever smaller with decreasing DRAM size (think of smaller buckets and larger holes).
The practical way to recover is to recover the information from a non-volatile medium. E.g. via an auto-recovery feature which periodically saves you changes to disk.
If the program has no such feature or if loosing even a the information between the last auto-save and the current state is not an option then you only have to choices:
- Buy an UPS, thus preventing power loss?
And replace the UPS battery every few years).
- Or store the data in a distributed cluster (each on their own power). E.g. database which replicate their data from a single MASTER database to a SLAVE database.
Restarting or rebooting with power on overwrites the data, unless some device is disabled to make the BIOS stop during POST . If you intend to read the latent data from system memory , remember that any program you run to do this on the computer is loaded into memory and overwrites the data. Ordinarilly RAM content disappears almost immediately when power is shut off. How long is a question for forensic examination. http://citp.princeton.edu/pub/coldboot.pdf Ask the particular manufacturer if they have such specifications.