Eli5: What affect do power cuts really have on a computer?

591 views

If the computer is running and gets suddenly turned off by loss of power, what really happens? Is there damage that happens slowly or progressively over time or is it more of a risk that something might happen to the computer suddenly in any event?

In: Technology

5 Answers

Anonymous 0 Comments

Biggest issue is data corruption. Things that were in the process of being written to the hard drive but didn’t complete. Windows (or other OS) will make an attempt to fix it on reboot but it’s sort of a situation where it doesn’t know what it doesn’t know. Which is why you should never cut and paste, but copy and paste and then delete the source if you’re at risk of a power hit.

Anonymous 0 Comments

If the programs (including system programs!) on your computer are editing files, and writing them back to the disk when the power goes out, you can run into several problems:

1. The file gets lost or “corrupted” (if the program was busy updating information **about** the file; this happens sometimes on the Nintendo Switch!)
2. Part of the file is new, part of the file is old (if the program got interrupted halfway through writing)
3. The file gets marked “opened” and never gets closed.

Most of the time, another program (such as chkdsk on Windows) can come along and fix the issues the next time the computer boots up.

Anonymous 0 Comments

Usually, nothing that bad happens. Starting up should fix most things that were cut short. The exception is when the computer is actively writing or changing data on the hard drive when the power is cut; then the written data will be incomplete. That’s how data can get corrupted. If it’s a word/pdf/general data file that’s corrupted, that file is basically lost. The real bad issue is when this happens to system files that your computer uses to start up; then your PC may have issues start up.

Anonymous 0 Comments

Two major things happen, one to all computers, one to some.

For all computers, the loss of power happens at a random time and they may not have finished whatever operation they were currently doing. If this happened to involve reading or writing to a file, what’s actually written to storage and what’s in the file index may be out of sync. This can corrupt the files so, even when the computer starts back up, things may be busted. Some electrical components also exhibit unpredictable behavior at low voltage so they may do weird things as the power is failing.

For computers with hard disks, you also have a spinning disk that needs to be kept very carefully in sync with the physically moving read/write head. A literal disk crash is pretty rare with modern drives (old drives would literally have the head run into the disk surface) but you can still get weird effects if the drive is trying to write while the power is falling and the disk speed may be dropping.

Anonymous 0 Comments

If it’s short enough of a power cut, absolutely nothing at all. The power supply of a computer will have large capacitors that provide a small buffer of current so that it will still run in case something like that happens. However, the amount of charge in there will power the computer only a fraction of a second.

If the capacitors run dry, everything will go dead instantly. Whatever you were working on that wasn’t saved to the disk straight up vanishes, like the current in a light bulb when you shut off the switch. RAM needs to be constantly powered on in order to function, so any information kept there gets sucked away and erased when it loses power.

That’s pretty much it, assuming there’s no hard drive. Think about a Gameboy console for example – the power is controlled with a mechanical switch that physically severs the connection to the battery. Just like how you’d hypothetically yank the plug out of the wall while using your computer. It was designed to do that every time it was shut off. There isn’t any cute shutdown animation or anything. Solid state electronics starts and stops on a dime, and operates at speeds that no one can really comprehend.

Now like others have mentioned, a hard disk is not entirely solid state. You’ve yanked the plug out of the socket and we’ve got a metal arm with tiny electromagnets at the end (the heads) hovering literally nanometres above a set of metal platters, all of which are still spinning at 7200rpm. Obviously the drive isn’t going to stop on a dime like everything else just did, and if it was currently in the middle of a write then whatever was being saved might be fucked up and corrupted.

In old PCs, a power failure spelled disaster. It’s why programs back then used to be so insistent about not shutting off the power while saving, considering physical damage could happen if the heads weren’t parked properly before the drive was spun down.

These heads are extremely sensitive and need to be *just* barely not touching the platters in order to work. The platters spin at very high speeds and create a thin cushion of air that the heads are lightly pressed down against, enough for them to read and write effectively to the magnetic platters but not quite enough to cause them to touch. That can happen when shit hits the fan and is called a head crash. However, the heads are only held up by the force of the air cushion underneath and nothing else, so they do need to come down at some point to “land”.

There’s a special thin ring on the hard drive platters called the head “parking” or “landing” zone. The drive firmware “knows” not to read or write any data here, and whenever power is lost the heads have to move to this part of the disk in order not to scrape against areas used for data storage. Back in the day, a stepper motor controlled by the drive firmware or sometimes the BIOS would “park” the heads above this zone before spinning the drive down. This wouldn’t necessarily happen when the computer is shut off, perhaps during a long idle period of no reads/writes in order to save power. The earliest hard drives didn’t automatically park the heads – that became a really big problem during power failures because the firmware wouldn’t have time to park the heads in the right spot before it went dead, so the platters would slowly stop spinning while the heads “landed” wherever they happened to be, causing a (loud!) head crash, literally scraping an area of data off of the platters while damaging/destroying the heads irreversibly. This can also happen if you drop your computer really hard while it’s running.

Thankfully, every hard drive made in the past 25 years or so parks the heads automatically when power is lost. Instead of using a stepper motor, the arm containing the heads is actuated directly with a magnetic coil. The heads are set up in a way where they’re brought back to the parking zone whenever the magnetic field goes out. Older drives had spring-loaded actuators that would make a loud THUNK whenever the drive was unable to park properly, caused by the arm being slammed against a hard stop. This is called the “click of death” because it used to happen whenever a drive got stuck in a loop from some unrecoverable error, and would go THUNKTHUNKTHUNTHUNKTHUNK until you shut it off. Seagate in particular had a line of drives that were widely known for this about 10 years ago, to the point where someone filed a class action lawsuit against them for it.

**TL;DR**
To answer your question, no. Nothing bad happens at all. Technically there’s progressive wear on all the parts inside your computer at all times – the bearings in all the fan motors, the number of thermal cycles each solder joint will last, the total number of hours each individual transistor will last before degrading… all of these are factors that are so hilariously miniscule that most people don’t bother to care.

The amount of wear that’s caused by power failure is… I’m not even sure if it’s possible to measure it. Probably the biggest wear item would be the hard drive spinning up and down repeatedly, but currently those are rated to last thousands of load/unloads and thousands more hours before failure. I use a hard drive from 2012 for a NAS and it’s been spinning 24/7 for years. Works like a dream.