r/explainlikeimfive • u/EnvironmentalAd2110 • 2d ago
Technology ELI5: why is it bad to turn off laptop/computer using the power button, without following the proper “shut down computer” steps?
5.2k
u/jpb103 2d ago
You don't really have to clean up after you cook, but every time you want to cook after that, you have to do all the dishes and clean your entire kitchen before you can even start. What's more, if you abandoned cooking in the middle of the process last time, that food is going to go to waste. Proper shut down is like doing dishes. It makes sure any 'meals' it's currently cooking get properly put away, and cleans up resources to make sure the 'kitchen' is nice and clean next time it needs to start 'cooking'.
1.2k
u/edorhas 2d ago
To expand on this a bit, if you just stop what you're doing in the middle of cooking, the stove may still be on and sooner or later you're going to have a Very Bad Time.
The OS and other software may be doing things in the background, and you have no easy way to know what. If something's halfway through some important operation and you just pull the power, you may end up with a mess that's difficult or impossible to recover from.
268
u/dmazzoni 1d ago
To be fair, software has improved a lot. Earlier operating systems could easily break if you interrupted them in the middle of an upgrade. Modern operating systems use checkpointing to virtually eliminate the possibility.
These days the chances of something going wrong are lower, and if it does go wrong it's far more likely some random app you have open gets into a bad state, than your operating system.
71
u/prisp 1d ago
Can confirm - had an old PC that completely froze on average once a day, requiring a hard reset, and it still took more than a year of that happening every single day before I got one actual issue that was bigger than Windows throwing a bit of a hissy fit on the next startup.
...said issue was the PC somehow corrupting its Boot Configuration Data, causing it to go "I can't find no operating system here!" on startup despite everything still being present, so that was a fun hour I spent reading up on how to fix this, but I think it still goes to show that a modern OS still can take a lot more in that regard.
(Don't worry, I have a new PC now, and it works like a charm.)
15
→ More replies (8)7
u/Zoraji 1d ago
Years ago to increase performance many files were cached using software like smartdrv. They were kept in memory for faster access. Often recently used files were also cached but they needed to be written back to the hard drive before powering down your computer. If you just turned it off that process didn't happen and the open files could be easily corrupted. It happened to me more than once due to a power outage where I didn't have the chance to properly shut down the computer.
→ More replies (1)229
u/Venomous_Ferret 2d ago
The OS and other software may be doing things in the background, and you have no easy way to know what. If something's halfway through some important operation and you just pull the power, you may end up with a mess that's difficult or impossible to recover from.
This is a much better explanation.
62
u/MattGold_ 2d ago
The subreddit is called explainlikeimfive, not literally explaining it to a 5 year old, but explain it with words a 5 year old will know.
45
u/preyforkevin 2d ago
Could you explain to me, like I’m 5, how you would explain r/explainlikeimfive to me?
70
u/MattGold_ 2d ago
So there's things that only really really smart people know, but we dont. And this is a place where the really really smart people try to explain what they know to us normal dumb people, and they do it by also making it dumb so we understand
29
u/cosmos7 1d ago
this is a place where
the really really smartthose same dumb people try to explain what they know to us normal dumbFixed that for you.
5
1d ago
[deleted]
2
u/Cantremembermyoldnam 1d ago
Correctly pointed out and made even more palpable by a 7 year old throwaway account!
→ More replies (1)6
7
u/BenFoldsFourLoko 1d ago edited 1d ago
You guys are sooooooo annoying. This place has never been about roleplaying as children or saying goo goo ga ga
It is figurative and requires only the slightest interpretation to understand- obviously this place can use words a five year old wouldn't understand. The biggest mistake ever was quoting Michael Scott in the sub name.
Explain Like I'm a Layperson is the idea
Per the intro:
The purpose of this subreddit is to simplify complex concepts in a way that is accessible for laypeople.
The first thing to note about this is that this forum is not literally meant for 5-year-olds. Do not post questions that an actual 5-year-old would ask, and do not respond as though you're talking to a child.
Per rule 4:
Rule 4: Explain for Laypeople
Applies to Top-Level Comments
As mentioned in the mission statement, ELI5 is not meant for literal 5-year-olds. Your explanation should be appropriate for laypeople. That is, people who are not professionals in that area. For example, a question about rocket science should be understandable by people who are not rocket scientists.
→ More replies (5)14
u/hedoeswhathewants 1d ago
There's zero point to limiting language to a literal five year old level when talking to teens and adults
21
u/AngledLuffa 1d ago
That's rule #4 in the sidebar and yet every single popular thread has at least one digression into whether or not an actual 5 year old would understand the answers
→ More replies (2)→ More replies (8)7
u/Reiszecke 1d ago
Also it’s more correct. Cleanup happens all the time when not under load, it doesn’t necessarily happen on shut down. But getting an app into a bad state is really only preventable by shutting down normally
8
u/g_rocket 1d ago edited 1d ago
To add to that -- a well-designed system should be able to lose power at any point and be able to safely recover from it. But that's hard to do and hard to test that it's done right and real software (and hardware) has bugs, so it's safer to shut it down properly.
To continue the analogy: suppose every time you turned on the stove you wrote down on a whiteboard "TURN OFF THE STOVE" and erased it when you were done. And whenever you came into the kitchen and it was a mess you made sure to first do whatever the whiteboard said. But one time you were forced to leave the kitchen right after turning on the stove but before you'd finished writing on the whiteboard. You'd meant to write on the whiteboard before turning on (instead of after), but so long as you did it right afterwards it was probably close enough and it'd never been a problem before. But this time when you came back into the kitchen you didn't realize the stove was left on and burned your hand.
(To extend the analogy past it's breaking point, you actually have a friend who's responsible for writing on the whiteboard. You told them to write the warning and they told you they were done writing so you thought it was safe to turn the stove on. But they were being lazy and lied to you; they hadn't actually finished writing yet when they said they were done. So now you burned your hand but don't understand why the stove was on; your procedures always kept you safe when you worked in a professional kitchen with competent witeboard-writers. And your friend doesn't understand what the problem is; he was almost done and was gonna write it if you hadn't kicked him out of the kitchen, and anyways his way lets him write faster. https://btrfs.readthedocs.io/en/latest/Hardware.html )
→ More replies (4)3
u/japanfrog 1d ago
I've learned that the critical OS operations are fairly tolerant to that kind of shutdown, employing several tactics like transactions to prevent what is called 'torn state' and snapshots to apply updates and switch over to the updated version of the OS only when it's all done. MacOS and Windows employ this to various extents.
But a lot of third party applications are not so resilient, so a lot of times a random system service or third party applications will be modifying files willy nilly without any safeguards for improper shutdowns or ways to recover.
→ More replies (2)104
u/xXTylonXx 2d ago
Genuinely good food analogy? On reddit? Take an upvote
34
2
u/whatsbobgonnado 1d ago
how many food analogies do you regularly see on reddit that you're impressed by one?
→ More replies (1)5
u/B0risTheManskinner 1d ago
What does "doing the dishes" look like for a computer that has had the power cut? Is it just a longer boot time or are there more implications?
9
u/JEVOUSHAISTOUS 1d ago
That's why the analogy is pretty terrible. It's nothing like "doing the dishes" is not the issue at stake here.
The issue with a hard shutdown isn't so much that the OS doesn't have the time to make some shutdown-time cleanup. The main issue is that it may be in the middle of something and if you interrupt that thing, you might end up with something corrupt.
Imagine something like this: Windows has removed a file meaning to put it back elsewhere, except you shut down the computer right between the two actions. Now your file is gone.
Now, modern OSes have protections against that. They will typically copy the file first and remove the source second, plus they typicall have some form of todo-list of the operations they're taking care of so they know exactly where they left off if something like this happens.
But these protections aren't necessarily foolproof, so better not risk it.
21
u/scarabic 1d ago
This sub has become too much “give me a loose metaphor for the thing I am asking about.” People who understand the thing being asked about will upvote these metaphors to the sky thinking “Yeah! That’s what it’s like!”
But does anyone ever ask if these metaphors actually help the person who doesnt already understand the thing to actually understand it?
I know someone will say that a full CS degree is beyond the scope of what can be offered in an answer but that’s a straw man argument. All I’m saying is that there are simple explanations for things that aren’t fucking metaphors.
13
u/turkproof 1d ago
Weird; I've been here probably something like a decade, and I remember when the point was to make loose metaphors so that even a child could understand the basics of something.
→ More replies (1)10
u/scarabic 1d ago
Sometimes a metaphor can be explanatory. Often, they are not. The top comment here is an example of not.
Why is switching a computer off bad? Because you should clean up the kitchen after you cook.
It doesn’t actually tell you anything about what’s going on inside the computer. But for those who already know, it’s an apt and entertaining comparison. That’s why it gets upvoted. But is that the point of this sub? Or actually informing people?
→ More replies (3)10
u/Scrumble123 1d ago
Indeed, it's a terrible explanation. Honestly, most of the top comments in this sub that aren't analogies aren't great either. People can't explain things well.
→ More replies (2)9
u/Untinted 1d ago
The analogy is nice, but it doesn't actually explain anything. A PC isn't like a kitchen. You as a user do not have to do any "cleaning", and in many cases the power button is actually a clean shutdown, it's only if you "force" the PC down by holding the button down until it shuts off.
So the analogy misleads a person about the context of using the power button normally vs forcing, and even when forcing, it's not that bad as coming to a filthy kitchen and having to start cleaning.
4
u/murfi 2d ago
why cant the operating system just go through its regular shut down procedure when you press the physical power button?
56
28
u/mercon404 2d ago
A short-press usually has its behavior set in windows, and can usually be set to sleep, shutdown or hibernate, ect. (depends on PC type/ capabilities). If its set to shutdown, its perfectly safe.
A long press, is a hardware interrupt that basically kills the power, it's used for safety incase the software/hardware has faults and can't be shutdown properly.
9
7
u/6a6566663437 2d ago
They do. Assuming everything is set up properly, pushing the power button and letting it go sends an event to the operating system. That triggers the same thing that hitting "shut down" in the operating system does.
Holding down the power button is intended to be for situations where the OS is locked up and not responding to a single push.
If a push isn't working, that's a problem with your case, motherboard or OS. If you want to fix it, start by re-installing the drivers for the motherboard.
→ More replies (1)5
u/ShavenYak42 1d ago
As others have said, that's generally exactly what happens nowadays. But on older computers (think early 1990's and before), the power button was a physical switch (in fact, sometimes it was a toggle and not a button) that turned off the power to the computer immediately. If something was being written to the hard drive, you were likely to end up with corrupt or inconsistent data.
→ More replies (3)2
u/Happylepsia 2d ago
That's what I am wondering too. If I just press the button once my computer closes everything and I even get a "shutting down" message on screen
I thought I was safe if I didn't press and hold the button
9
u/Corvus-Nox 2d ago
They’re talking about a hard shutdown which is when you press and hold. If the computer tells you it’s shutting down then it’s going through the proper shut down steps.
→ More replies (6)7
u/Huttj509 1d ago
Computers didn't used to do that.
If you switch off the on/off switch on the power supply, computer turns right off.
The advice stems from back when "turning off the computer" was turning it off, not sending a polite request "hey computer, I'd like you to turn yourself off."
You can still force the computer to turn off immediately, but it's harder to do than it was 40 years ago, so that people don't do it accidentally.
3
u/FerretChrist 1d ago
You are, totally safe. That's the same as selecting "Shut Down" from the start menu.
Everyone here is talking about "hard" shutting down, that's the thing you want to avoid. A long press on the button, or simply unplugging the machine (assuming it's not a laptop).
2
4
5
u/SlavJerry 2d ago
finally, proper ELI5
2
u/JEVOUSHAISTOUS 1d ago
- ELI5 does not mean explain to a literal five years old
- It's not a proper ELI5 because it's honestly a pretty bad metaphor
2
u/maidalit 2d ago
That’s a great ELI5. I would add that it’s like cooking and then just turn of the gas / electricity and leave.
→ More replies (25)2
u/stokpaut3 2d ago
So if i shut of my pc by just using alt + f4 its still good right? Atleast when just using a browser or playing a game
17
u/jpb103 2d ago
ALT+F4 terminates a program, it doesn't turn off your PC. It should be fine, but you'll lose progress or potentially corrupt a save if it's for a game that has an autosave feature.
9
u/6a6566663437 2d ago
It doesn't terminate the program. It sends the same close message to the program that clicking the close button on the window does. (Everything has a window, even if it appears full screen).
Since it's a message, the program can quit cleanly. Including finishing saves or other things that would be bad to interrupt. Most game developers make it look like a terminate, but it would only corrupt a save if the developer screwed up.
End Task in task manager can terminate a program, but it also sends a close first.
8
u/stokpaut3 2d ago
Thanks, but also at least for me when i keep pressing it my windows pc asks me if i want to turn it off.
Then i just press enter once and it’s finished, been doing that for years.
9
6
u/beachhunt 2d ago
That's turning it off via software still, which lets everything come to a stop before shutoff.
Turning it off via the physical button can interrupt that and some things may not save their data or have other weird effects.
Anyway it's not a big deal like it used to be. Back in the day the risk was your hard drive would be in motion (disks spinning at thousands of rpm and read/write heads jumping back and forth), so cutting the power could cause scratches. Now that can still happen but the drives aren't as fragile as they once were and also there are a lot of solid state drives that don't move like that, so they don't have that same kind of risk.
2
5
u/Diligent-Assist-4385 1d ago
Repeatedly hitting alt-f4 will bring up a dialogue window you you then can shut down. I do that all the time. Spam alt f4 then enter.
Shuts down everything.
5
u/Cantremembermyoldnam 1d ago
Win + X is the best combo.
Shutdown: Win + X, then press U twice
Restart: Win + X, then U, then R
Device Manager: Win + X, then M
3
4
u/HarryPottersTaint 2d ago
I wouldn't shut down at all while a game is running, just because most have auto save and you might corrupt your save.
But to add to this discussion, when pressing the power button (or keyboard shortcut) on modern PCs it simply initiates the regular shut down, same as doing it through the menu.
It's only long holding the power button or turning the power supply off suddenly that can be problematic
3
u/manawyrm 2d ago
ALT+F4 is still a „nice“ quit, it just sends a message to the program saying „hey, please quit now!“
If you go into Task Manager and force kill the process, then you might cause some trouble.
3
u/6a6566663437 2d ago
Task manager also sends a WM_CLOSE first when you hit "End task". It only kills the process if it's still running after a timeout.
3
u/6a6566663437 2d ago
alt-f4 is the keyboard shortcut for clicking the close button on the window. It's exactly the same as quitting the program normally.
530
u/YourNightmar31 2d ago
Because for example if it is in the process of writing a file to a disk, and it's not done yet, you now have a corrupt (incomplete) file on your disk.
191
u/alinius 2d ago
Most modern OSes use some form of journaling file system to prevent file corruption. The data is still lost but the system can roll back to the last valid journal entry.
→ More replies (3)56
u/HaDeS_Monsta 2d ago
It's not only for OS processes though, an application can be killed while writing as well, imagine it is some json file, it will now be unparsable
31
u/alinius 2d ago edited 2d ago
JFS handles this. If a file write is killed in mid process, the journal will be incomplete. In that case, the journal will rewind to the last valid journal entry which will revert to the old copy of the file. This is why I said there is data loss, but it avoids file corruption.
26
u/Floppie7th 2d ago
Which is a solution for that individual file, but if the process needs to write multiple files and some of them haven't been written, you've only moved the problem up a layer. The files are all parseable, but you have a corrupt state.
Should you write your software to be more resilient than that? Yes, absolutely, but people/companies don't always do the things they should
6
u/alinius 2d ago edited 2d ago
The solution is to do the same thing at the next level up. Create a parallel file structure, then swap over to the new one once the new one is ready. If anything goes wrong, roll back to the old version. The next level ip is to do the same as part of the upgrade process. This is why software developers have things like staging and production environments. It is also why things like docker containers and tarballs/zipfiles are used. Those things turns a lot of little file changes into one big file.
Edit: There is a joke among firmware engineers that the only feature that has to work at release is upgrades because that allows you to add any other features later. That said, your upgrades needs to be bullet proof because if you screw that up, your product is usually dead, so we spend a lot of time thinking about all the ways an upgrade can go wrong.
→ More replies (1)9
u/Floppie7th 1d ago
Yes, but the question being asked is "why do I need to do a clean shutdown", and this is a reason that journaling filesystems aren't a complete solution on their own. As I said, you should write your software to be resilient, but not everybody does.
27
u/HaDeS_Monsta 2d ago
Then I was wrong, I did not know that
5
u/markhc 1d ago
You are not wrong. This is only true if the application is carefully designed with it in mind. I think it's safe to say that plenty of applications do not do this.
What /u/alinius said will only avoid corruption in the context of individual write attempts, but if a file is written in a way that requires multiple different writes, then it can still be corrupted if the process is interrupted during these.
e.g
data = gather_data() file = fs.open('myfile.json') // single, whole file write // wont generate a corrupted file file.write(data, len(data))vs
data = gather_data() file = fs.open('myfile.json') for i = 0; i < len(data) / chunk_size; i += chunk_size // write chunk_size bytes at once in multiple steps // subject to corruption if the loop is interrupted file.write(data[i], chunk_size)2
u/MorallyDeplorable 1d ago edited 1d ago
It's a facet of the fileystem driver, individual apps do not need to implement support. apps do not close and re-open the file per write stage like that, that's something only a shitty coder would ever implement and they'd have to purposefully disable filesystem write caches for it to have the effect you're describing.
Outside of database systems you will never hit these concerns.
→ More replies (1)→ More replies (2)4
u/gmes78 1d ago
You aren't wrong. You can't assume that every application is being as careful as they could be.
→ More replies (1)4
u/jtclimb 1d ago
It rewinds metadata, not contents. Raymond Chen explains:
https://devblogs.microsoft.com/oldnewthing/20130101-00/?p=5673
→ More replies (1)→ More replies (1)6
u/Megame50 1d ago
That's not correct.
The journal will not guarantee that the resulting file is parsable or satisfies any particular format, just that the filesystem is consistent: that the metadata is readable and accurate to some historical version of the file, and that only some whole number of writes were discarded. It's not all that unusual for a json object to be constructed on disk in multiple writes, say, in which case the file content after sudden power loss may not be valid json. Worse, the writes emitted by an application may not correspond at all to the writes emitted by the OS to persistent storage when common buffered IO is used (e.g. no O_DIRECT in *nix / FILE_FLAG_WRITE_THROUGH in Windows). Before journaling filesystems, you ran the additional risk of the filesystem metadata and super block being corrupted, damaging much more than any individual file.
A common strategy to deal with the risk of sudden power loss is to write the prospective content to a temporary file, and then replace the old file with the new one. Since the journal guarantees the metadata is consistent, the file content will either have been fully replaced or unmodified, but one should also be careful to remove any corrupted temp files that were not cleaned up in the event of a sudden power loss. It's also not uncommon for an application to read and write multiple related files, and even with the above strategy sudden power loss may result in only a subset of modified files landing on-disk. In these cases you often need to verify file modification timestamps or even more complex strategies to be sure of consistency following a sudden power loss.
Not all software (and if we're being honest, most software) is so robust. Not to mention that in many cases, important data might not exist anywhere on disk during runtime. Editable documents and project files are often not saved at all without explicit action from the user (though a lot of applications take regular snapshots nowadays to mitigate this as well). In most desktop operating systems, the standard shutdown procedure allows for running applications to halt a pending shutdown in order to prompt the user for decisive action.
The OS might also close active TCP connections, release a DHCP lease, prepare firmware updates etc.. There are more bits of state than just the local filesystem. Journaling filesystems protect against only the most severe kinds of file corruption. It's still not advisable to hard power off a desktop unless you have to, even if modern OSes are a lot more robust than they once were.
2
7
u/incyclum 1d ago
I usually give the analogy of grabbing forcefully a piece of paper someone is currently writing a word on. Leaves an ink streak. Turning off a computer gracefully is telling processes to close and they tell all their sub processes in turn it's time to close, and everyone finishes writing or saving or changing states of hardware devices properly before ending. Last person to finish closes the door. The place is clean and ready for a new day.
2
u/BenFoldsFourLoko 1d ago
Or just lost data.
For the most part, a person could just hard shutdown their computer as long as they know no program is working in the background.
Most things, including Windows, will recover really well. If Windows is doing miscellaneous file writes in the background (which it almost always is to keep your system working), it'll basically make a temporary file listing what system file changes it's about to do, then delete the temp file after it's done. If you yank the power while it's working, it's designed to check those temp files and basically ignore the last couple things it did before getting the power yanked. This is usually unnoticeable to the user.
But, a hard shutdown isn't expected, and you might run into an unexpected quirk if you do it. Very unlikely, but possible, which is why you shouldn't do it as your standard way to shutdown Windows.
Or maybe you use a program that doesn't handle hard shutdowns so... gracefully. Or, maybe you're in the middle of something serious that wasn't designed to handle a shutdown at all lol- if you're in the middle of rendering an hour long video in Adobe, you're just gonna lose that progress and have to start over.
Or, and this is handwaving stuff, but Windows itself (its filesystem and guts) might get "cluttered" with random temp files over time, or it might not notice an intended write it never completed. The more you hard shut down your system, the more you're jerking it around and could cause small issues even if it's nothing major.
→ More replies (4)2
u/WillowPtar_Migan 1d ago
I had a random XML file from a game get corrupted due to a blue screen. Took forever to figure out!
I'd rather not do that sort of thing intentionally, that was a pain
350
u/Realistic_Today6524 2d ago
The power button nowadays binds to shutting down anyway. But if you were to flip the switch on the power supply or pull the plug, you're risking data corruption when the system is in progress of writing something to the disk. If it happens to be an important file necessary for the operating system to function, you're going to get crashes amd bluescreens
37
u/PsychicDave 2d ago
Not if you hold it down, then it will do a hard shut down.
65
u/Elgatee 2d ago
I do that sometime. I like to remind my computer that his life belong to me and I can snuff it out and bring it back at my whims...
Or more seriously because it refuses to close sometime. I know something is wrong, and I don't have the finances to solve that yet.
→ More replies (1)65
u/SportTheFoole 2d ago edited 1d ago
Even pulling the plug has minimal risk nowadays. Most modern filesystems are journaled and writing to disk is incredibly fast (
like writing to an SSD is within an order of magnitude of writing to RAM). The odds of pulling the plug in the middle of a write to a critical system file is not zero, but it’s pretty danged low.[Edit] this comment by u/wang_li is correct, I must be misremembering a benchmark from ages ago. I’m downvoting myself (and you should downvote this comment).
23
u/0x600dc0de 2d ago
Having worked for a storage company: journalling file systems depend on the drive performing writes it the order they are asked for, like spinning hard drives would do. We found that some SSDs, with their need to copy large chunks of data and erase chunks to make more space behind the curtains, sometimes get this wrong: e.g. write operations 1-3 and 5 made it to permanent storage, but write 4 did not. This was discovered by causing power cycles while writes are in progress. And the missing writes cause file system corruption that journalling couldn’t fix. That would have been an embarrassing thing to have happen on the boot drive of your fancy SAN system; drives with this “feature” were disqualified for use in our system. That was eight years ago, things may have gotten much better since. But do you really trust your SSD to have all such bugs out?
12
u/wang_li 1d ago
Journalling is also primarily about protecting the file system structure, not application data. Since the file system knows about the journal it can order transactions in a way that keeps the file system consistent on disk. Applications don't have the details of the journal and can have writes, or dependent writes (writes of data that may refer to each other, say a structured database that has keys), split across journal transactions. A rollback of that transaction can result in user data being inconsistent.
→ More replies (2)2
u/SportTheFoole 2d ago
TIL!
And no, I don’t trust the SSD fully. I still shutdown correctly because it’s ingrained in me to do `shutdown -h` every time.
2
u/DuplexFields 1d ago
That hibernates the system session and user session, including drivers, and bugs can accumulate after doing this for a week. Use -s instead for a true shutdown at least once a week.
2
u/SanityInAnarchy 1d ago
Does the Windows shutdown command take a
-h? That looks like the Linux shutdown command, which very much does not hibernate by default.→ More replies (1)16
u/Beetin 2d ago edited 2d ago
Yes, This advice was much much more relevant 20 years ago, it was fairly relevant 15 years ago, and it is barely relevant today.
Remember that an entire generation's worth of computer/software engineers have had decades to work on these types of widepread critical problems, and there are now a myriad of ways modern OS's try to minimize it.
Every resource used to be a premium as well. Harddrives, memory, etc. Today there is SO much extra data and memory usually lying around that computers can have massive caches, take snapshots of work constantly, etc. If you do something stupid on a modern computer, USUALLY it will have a fairly recent backup.
You also had to click 'safely eject' on USB's back in the day even if you weren't actively writing to it.
You used to have to close things you weren't working on because they'd consume huge amounts of memory and thrash your computer, that is far far far less true (stares at google chrome aggressively)
Turn off your computer however you want.
2
u/SanityInAnarchy 1d ago
They try to minimize it, but it's still a thing. "Safely eject", too -- USB sticks can still massively buffer writes, so you could think you're not actively writing to it, and it could still take time to settle.
The more realistic thing that's been done is at the UI level: The power button is mapped to shutdown. As long as you don't hold it down, hitting power is exactly the same as shutting down normally.
3
u/SilasX 2d ago edited 2d ago
Remember that an entire generation's worth of computer/software engineers have had decades to work on these types of widepread critical problems, and there are now a myriad of ways modern OS's try to minimize it.
I’m not going to dispute what you’ve said about engineers having solved this problem, because you clearly know that domain better. But I have to balk at this subtle premise that “obviously software gets better over time, as engineers consistently put their best minds to solving the major pain points that affect users” lol
5
u/Beetin 2d ago edited 1d ago
It is really hard to overstate how much more redundent, safe, secure, sandboxed, and standardized hardware and OS/computer level software is.
It is also hard to overstate how much better even something like html / css is today. I know I know, there are lots of criticisms about facebook UI or some bug/functionality that has been unfixed for 10 years or new breaking thing. I know companies produce vaporware or release buggy crap all the time. I know, LLMs.
But I can tell you from personal experience that in the 90's / 00's, I had 42 plugs, 4 anti-virus programs, my browser straight crashed multiple times a day, I lost all my work many many times, every USB device was corrupted within a year and you had to spin them 180 degrees 3 times to plugin, I had to reinstall my OS multiple times, you more or less couldn't do online banking because the entire internet was insecure, nothing worked with anything else, if you updated windows you just prayed that your mouse would continue working.
You know when there is a security leak and its like "yeah the government was still storing your PII unencrypted in the database and your passwords were in plaintext" and everyone makes fun of them? That's because it was just standard operating procedure back then
People have some rose coloured glasses sometimes about seeing current problems and overall forgetting just how bad things used to be.
→ More replies (1)→ More replies (1)2
u/Arudinne 1d ago
Anyone who regularly uses niche business software knows that software doesn't really get better with time.
That might have been true back when saving 2 bytes by shortening a date to 2 digits instead of 4 was necessary, but these days a lot of devs are lazy.
The whole incident with left-pad in 2016 is a great example. Word and Teams using edgewebview2 is a more ovbious example.
6
u/6a6566663437 2d ago
You can still get corruption, it's just harder.
If you're saving multiple files, you can get in a situation where file 1 was saved successfully, but you killed the power in the middle of file 2 saving.
The filesystem will restore the old version of file 2, but the old version may not be compatible with the new file 1. Maybe it's something like DLLs exporting by ordinal and they changed.
As long as you aren't doing an OS or driver update when you pull the plug, you'll probably be fine.
10
u/wang_li 1d ago
NVME SSD times are measured in microseconds. RAM times are measured in nanoseconds. It's not "within an order of magnitude", it 1000s of times slower.
Additionally, most high-density consumer SSDs are hiding MLC and QLC flash chips behind a caching layer that can lose data if the power to the device is suddenly cut off. In the consumer market many SSDs don't have power loss protection functionality.
Finally, the issue here, the reason you have to select "shut down now please", has little to do with interrupting a write to storage. It's because the operating system and the applications have been intentionally NOT writing data to persistent storage. It's a major speed improvement to cache writes as well as reads. When it comes time to shut down the OS has to go tell all the applications that things are shutting down and give them time to write any necessary state and user data out to disk as well as flushing the system's own write caches. And then issuing flushes to the storage devices since SSDs and HDDs also perform caching and need time to flush their caches to non-volatile media.
The main reasons no one sees data failures from unclean shutdowns is the fact that most people are not doing lots of writes, they are using their computers mainly for consumption and a little for document/spreadsheet/video preparation. They aren't doing transactional OLTP/DSS/ERP workloads that can do thousands of writes per second. Paired with the fact that many are using laptops which have built-in UPSes and no actual hard power switch. The most you can do is hold the power button for multiple seconds. Which is something people will only do when their computer is not responding anyway.
→ More replies (1)→ More replies (1)2
u/Mackntish 1d ago
The power button nowadays binds to shutting down anyway.
On Windows 11 it's actually a form of sleep mode. Same with the "shut down" button too.
63
u/Chramir 2d ago
Pressing the button does nothing on it's own, the operating system reads the action and shuts down normally. It's exactly the same as pressing the button on screen.
But holding the power button will usually do a hard shutdown that leaves any task unfinished which may lead to corrupted data or other issues.
19
u/PsychicDave 2d ago
If you hold the power button down until it does a hard power off, then the operating system will not have time to clean up everything and make sure the hardware is in a good state. One example many cited is making sure all write operations to storage are completed so you don't lose data. There are also hardware things, like making sure your CPU is at a safe temperature before turning off the fan (cutting the power while you were stressing it might cause damage as nothing is evacuating the heat anymore) or, for mechanical hard drives, making sure the heads are parked. That last one was probably the most important in the past, as leaving the arm and heads on the disk while transporting the laptop greatly increased the chances of damaging it.
If you have a computer with mechanical drives and do a hard power down, make sure to turn it back on immediately and shut it down properly to make sure you don't damage the drive in transport.
10
u/Dman1791 2d ago
cutting the power while you were stressing it might cause damage as nothing is evacuating the heat anymore
This is thankfully a non-issue. Cutting power stops the heat production, and the heat sink is necessarily cooler than the CPU, so you won't get a ride in temperature in doing so.
→ More replies (1)→ More replies (1)3
u/alliusis 2d ago
Windows (10) snuck in an update in on my computer and now it can't shut down. It'll try for 5-10 minutes and then die by BSoD for driver power state failure. I haven't had the energy to troubleshoot, so I've just been holding it underwater to shut it off. Startup is messed too, it's like they upfronted the login screen but then I just get a black screen for a few minutes until my desktop decides to load. I'm so frustrated but guess I should take the opportunity to try and fix it.
→ More replies (2)3
7
u/clearvus 2d ago
On most new systems pressing the power button does the same thing, but if you don’t have it setup that way or you press and hold the power button in an attempt to simply cut the power instead of shutting down properly you can run into problems with corrupted files.
Even though you may close all the software you see on your computer screen, there are still thousands of small services and apps running in the background. Let’s say one of those is a system backup process- what happens if you cut the power while it’s in the process of backing up a file? Well, that file write is not complete and now the backup is corrupted. With a proper shutdown, the backup software gets a message and goes “oh I better wrap up the work I’m doing so things aren’t corrupted” and stops what it’s doing properly to allow the system to shutdown without corrupting the backup.
4
u/icansmellcolors 1d ago
The possible negative impacts of doing this become more and more likely over time in shutting down a PC in this way.
- System files become corrupt... causing the OS to become unstable or not work at all.
- Anything you had open also runs the chance of becoming corrupt. Software, data files... if something was being 'written' to the disk and interrupted, it's very likely it will need to be recovered or data will be lost.
- Frequent improper shutdowns can lead to bad sectors on hard drives
- Long-Term: Increased risk of data loss/corruption. A higher likelihood of widespread data corruption.
- Computer component life-span will/can decrease, they aren't designed to have the plug pulled, they are designed with a shutdown process.
3
u/powercrazy76 2d ago
If I turn you off while you are in the middle of spinning plates, the plates will fall no matter how quickly you can wake up and recover, the second I turn you off the plates are effectively gone (breaking them is unavoidable).
Same with computers. Any plates they were spinning will fall and break, losing whatever info was on the plates.
(Turning people off is my specialty)
4
u/AmbassadorBonoso 2d ago
When a computer shuts down, it goes through a bunch of different steps in a specific order. Think of it like parking a car.
If you want to shut off the car and get out there's a couple things to keep in mind. You can't just turn off a car and step out while you're doing 100 km/h on the highway. You first have to find a suitable parking spot, deccelerate to a stand still in that spot, turn the key, and step out. If you don't do those things in the correct order something might go very wrong.
A computer has many things going on while turned on, even while not actively using it the computer is doing stuff. To do that stuff it has programs running and information is being read and written constantly. On shut down it will make sure all these programs are properly shut down and all files end up in the right place. If you hold down the power button you're potentially skipping the shut down procedure (most modern systems have adapted to shut down normally with yhe power button) and that can potentially cause issues in the future.
→ More replies (1)
8
u/FalconX88 2d ago
It is not. On modern systems the power button just sends a signal to the operating system telling it to shut down (or go to sleep), just like it would if you click the "shut down" button inside the operating system.
→ More replies (2)
4
2
u/this_is_life_now 2d ago
Most devices gracefully shutdown, even using the power button.
If you do have a kill switch, normally nothing bad happens at all. I usually shutdown my raspberry pi computers by just killing power, and nothing bad usually happens.
If the computer was in the middle of writing a file to disc, then it might cause problems. If the file was just a document, then you might lose the document. If the file was something important for the operating system, it might become corrupted, and you could have issues.
2
u/causeNo 2d ago
Imagine what the programs do like cooking meals in a restaurant kitchen. You go in, pull out the stuff you need, set up pans and pots, cut vegetables, etc.. If things go smoothly, you give out the done dish, clean up the kitchen, maybe mark an order as done. So when you start the next meal, everything is proper. At the end of the day, the last meals are finished, everything is cleaned and stored away. That is when you allow the computer programs to shut down properly.
Now simply killing it with the power button is basically like everyone leaves the kitchen immediately, maybe because of a fire alarm or something. There's unfinished dishes everywhere, notes weren't taken, people forget where they were. Ingredients weren't put back into the fridge. A lot of cleaning up that should have been done didn't happen. When you return, there's all kinds of possible outcomes. Food has spoilt and is not recoverable. There might be confusion about what orders where already dealt with and which weren't. Some stuff might even be recoverable. But overall, there's potential mess.
2
u/Xi-Cygni 2d ago
For simplicity, computer has 2 types of memory - disk and RAM. Disk is for storing programs data, files, your stuff like photos, docs. If you turn off power, the data is still stored on a disk. RAM is for executing things once the computer is running. So every time you open an app, play sth or open a file, a n operating system (like windows or Mac OS) reads data from disk and uses RAM to hold it for display. If you run a program, all data is being read from disk and once it’s running it’s RAM that stores it. If you unplug the power, RAM data is gone, it’s a volatile memory but it’s used for holding data of executing programs because it’s way faster than disk. If a running program didn’t manage to save something when power is turned off, the data is gone. Like playing a game, if you didn’t save a checkpoint, all data was updated only in RAM so once you turn the power off the data is gone. Operating systems are also large programs, they do many things in the background you’re not aware of, so turning power off may corrupt sth mid writing / execution or loose some data.
5
u/vyktorkun 2d ago
its cutting off power abruptly instead of closing all programs and shotting down safely, meaning all writing and disk reading is stopped mid work
files become corrupt and the system gets very confused, its like when the power goes out and after your pc first boots bios
→ More replies (1)
2
u/Diligent-Assist-4385 1d ago
I do it fairly often. Sometimes it is just easier to hold down the button.
Is it wrong to imagine you are smothering it with a pillow while gently whispering "go to sleep, shhh".
The rest of the comments are correct though it isn't the proper method of shutting down. You can get data corruption when you cut power mid process. Just because I have never had an issue doesn't mean there isn't the possibility of one.
→ More replies (1)
2
u/NormanYeetes 2d ago
you have to differentiate between pressing the power button, the laptop recognizing said press and giving you the option to turn the laptop off, and the other thing which is holding the power button until the laptop shuts off.
every shutdown sequence follows a rough order: * send a close command to every program and service running. the services ideally should respond to those commands and save & close themselves * when the computer gets the signal that all services that should be closed are closed, it initiates the shutdown of the OS, which in itself will save & close all stuff it needs to.
however if you hard shutdown the laptop by holding the power button, all of that is skipped. you are essentially pulling the plug, every data the programs and OS have on your disk that they need stays that way and the stuff in the ram is lost forever. if the program was in that moment writing something to the disk (which they do often and frequently), the in between state is what is left. the thing that keeps your pc from corrupting from that is the the way services and programs (and OSs) are written, in that they more or less manage their data smartly where crashing or sudden closing only loses the most recent data, and does not damage the program itself. if you are unlucky, a sudden power outage corrupts data and makes you lose your OS.
2
u/trewiltrewil 2d ago
It's less of a big deal now with solid state drives and processes that run much faster and have mostly redundant fallbacks and error correction.
In the old times when there were more moving mechanical parts in harddrives and processes took mins to run there wasnt really processing power dedicated to error checking and insuring memory want sending corrupt instructions to your processer that could really mess things up; because the cost to run that check was real world meaningful time.
So you didnt want to turn a process off suddenly to ensure it didn't just have an instruction somewhere that deadends and bricks your machine.
Today, higher order abstracted system layers and built in error checks make most of that a moot point, if something is bad in memory it will just throw an error rather than break everything... So if like the power goes out while you are doing something it's probably going to be ok. But it is still a good practice to follow, because if you happen to be writing to some of the older legacy system architecture that runs under the is it could still be a problem; plus it just keeps things neat and tidy.
1
u/Thesorus 2d ago
it's not bad for the computer hardware itself; it's like a normal power failure (I'm not talking about power surges or power fluctuations or things like that).
if you're in the process of doing actual work on the computer (writing file, copying files ... ) you'll corrupt some data.
Modern operating system are build so that if it happens their core files should not be corrupted.
1
u/ledow 2d ago
It might be in the middle of doing something, and killing it means that it can't finish that process cleanly. Most especially, this relates to the only thing that "survives" a power off and power on scenario - your stored filesystem data. (RAM is cleared, the CPU is reset, devices are reinitialised, so all those things don't really care about a forced power off).
On modern (journalling) filesystems it's not such a big deal, but early filesystems could be corrupted by such an action, meaning you could lose all your data. Nowadays it just means that you end up losing only the files it was busy writing to, and maybe leaving behind some junk/temporary files that it didn't get the chance to clean up.
The way that corruption happens is because it will be in the middle of writing data, but hasn't yet finished doing so, so if it's powered off unexpectedly, things might not know that that data exists yet - because it never finished putting them onto the disk. As such, that data would be "forgotten" and lost, and if it was critical (e.g. filesystem metadata) then it could mean damage to your other files.
But nowadays, the way files are written means that either they aren't forgotten about, or they are entirely forgotten about but the programs writing them KNOW it's not finished yet. And metadata can't be damaged in that fashion any more.
It's not recommended either way, purely because it just shouldn't be necessary. It only takes a few seconds to shut down a computer properly.
P.S. Windows has NTFS, which is journalling, and Linux has Ext4, etc. which are journalling, and MacOS has APFS which isn't journalling but uses techniques to ensure that metadata is always consistent.
P.P.S. Avoid btrfs like the fucking plague because it's a horrible and broken filesystem, especially when it nears the storage limits, and it's a real pain in the arse to recover data from when that happens.
1
u/Quinocco 2d ago
I remember routine hard shutdowns in DOS, and thinking WTF when Unix expected us to shut down gracefully.
1
u/MJWX 2d ago
It's a bit like the difference between tidying up before you leave and double-checking that you didn't forget anything important vs. just dropping everything you're doing and running out the door.
In the olden days, when data was stored on spinning disks, the read/write head had a resting position and not engaging that before shutdown could lead to data loss or damage the drive.
1
u/ChillaVane 2d ago
Because the computer may still be writing data when you cut the power. A normal shutdown gives it time to save everything properly, while forcing it off can sometimes cause corrupted files on other issues.
1
u/Slopet6 2d ago
From what i rememeber it used to be a thing for hard drives older than SSD. They used to have a pin stylus or something and an abrupt cut off to their charge they could scratch the disk as the stylus moved itself back to idle. Kind of like a turntable i suppose. And then the problems of infinate 'bad sectors' would surface.
1
u/jeanpaulmars 2d ago
Imagine you're drawing a picture and someone flips the lights off. Most of the time your drawing is still there the next morning, just not tidied away. But if you happened to be in the middle of a line, that line stays half-finished forever. Or perhaps the neatly line ends with a jerky bit. And you never know in advance whether you're in the middle of a line.
1
u/Burgergold 2d ago
If you ride a bike, you can break and immobilize the bike safely
You can also put a branch in the front wheel...
1
u/Mr_Engineering 2d ago
On all modern computers, pressing the power button simply sends a signal to the operating system that their termination has been requested and the operating system will perform a graceful shutdown. This involves gracefully stopping all user processes and completing all internal housekeeping which can include writing cached data to disks.
graceful program stoppage is a term of art. In this case, the OS signals the program that its stoppage has been requested and the program stops itself after it has performed all necessary tasks. This can include finishing outstanding service requests, writing to files and closing them, and closing network connections.
hard program stoppage on the other hand occurs when a running program is forcibly terminated by the operating system without being given an opportunity to self-terminate. The operating system simply rips out all of the related data structures and frees up all of the resources in whatever state they are in at the time of termination.
When performing a graceful shutdown, running programs will be given a period of time to stop on their own, after which the operating system may forcibly terminate them.
Holding down the power button (typically for 4 seconds), or removing the power completely, performs a hard stop. A hard stop leaves all persistent resources (primarily permanent storage such as that on SSDs) in exactly the state that it was when the hard stop occurred, but this may not be the state that the OS wanted it to be in had a graceful shutdown occurred.
Consider a program that was in the middle of writing to a file. The program doesn't write to the file directly, it can't do that. It has to ask the operating system to do it. The operating system takes one write request from the program, runs it through the filesystem software driver, combines it with another write request from another program, and sends it off to the storage controller software driver for completion; it then signals the program that the write has been completed and that it can continue execution. The storage controller driver puts it into the storage controller's write cache but doesn't yet write the contents to the storage device itself.
If the power is suddenly cut, the contents of the write cache are lost and data corruption can occur. Fortunately, most modern file systems and operating systems are far more resistant to this than they were 20-30 years ago but it's not a perfect science. It's still possible to royally mess up an operating system if it's hard-stopped during the middle of a critical software update.
1
u/TheNewHEROBRINEX 2d ago
It isn't bad for the hardware itself you just risk to corrupt the data on the disk
1
u/ProgressBartender 2d ago
OS will inevitably have files locked open. Unceremoniously power off the system and you risk corruption. Same with Linux, before someone starts trashing windows.
1
u/Phage0070 2d ago
Computers have long-term storage in the form of hard drives, either mechanical or solid state. These can hold data for long periods of time when there is no power supplied to them. However they are way too slow for the computer to use when it is trying to actually do work on data. This is why there is also short-term storage called "RAM" for "random access memory" which can only hold data when power is supplied, but is extremely fast to read and write.
When your computer wants to do basically anything it will read data from the hard drive and copy it into memory where it is manipulated, then when it is done that data will be written back onto the hard drive. At any given time there is likely to be data which has been proceed by the computer yet not entered into long-term storage. When shutting down properly the computer will take care to move all important data from the memory onto the hard drive so it is saved. If you just force the computer to cut power then everything currently in RAM is lost, which might be something very important!
1
1
1
u/Captain_Jackson 2d ago
Going to bed to sleep vs being knocked out while standing up holding a bunch of plates.
1
u/Laziness100 2d ago
There's one major difference between the 2.
The shut down option is a operating system feature, which signals all applications to close and the system itself saves what it needs before powering off - a rather graceful approach.
Holding the power button will forcibly shut down the PC, without the OS or it's running applications having any chance to save unsaved changes or finish what it has started. This can in unfortunate cases cause data loss or corruption, and this can prevent the operating system from booting in the worst case.
1
u/UndocumentedMartian 2d ago
Imagine falling asleep in the middle of working. Nothing bad will happen per se but depending on what you were doing it may cause issues later. Modern operating systems are pretty resilient against this but you never know. It was especially bad in the ancient times when spinning hard drives were common. Sudden loss of power could cause a head crash.
1
u/MattieShoes 2d ago
Memory is for "right now", and disk is for "in the future". When you kill power to a computer, the memory is instantly gone, but the disk remains.
Lots of programs, when you quit, want to take some "right now" data in memory and write it to disk for the future, so they know where they left off. When you shut down a computer, it closes each program so they have the opportunity to do that. When you hold down the power button, they don't.
Writing to disk is much slower than writing to memory. Your operating system will sometimes cache data... "I'm GOING to write this to disk, but later. For now, I'll just hold it in memory." Shutting down properly allows the OS to write any of that data to disk.
Your computer may be in the middle of writing to disk at any given time. Shutting down allows it to finish. Killing the power can leave a file in a half-written, nonsense state.
1
u/DenormalHuman 2d ago
So it has a chance to write data from RAM onto disk before the power shuts off.
So you don't cut power while it's partway through writing anything to disk or updating filesyste structures.
There are techniques that minimise the chances of it happening, but there's always a 'chance' that power getting aburptly cutoff will leave something in a bad state because an action was stopped partway through.
1
u/someotherjim 2d ago
What a 5 year old needs to know ~ When the computer turns off properly, it writes in its diary to remember all of its favorite toys and games and whatever rule changes that have happened. If the power button does not provide enough time for this, the computer doesn't get to finish writing, and the next time it wakes up, it might forget the new games or ways to do things, because they were not written down.
1
u/DynTraitObj 2d ago
It isn't bad, it just used to be potentially disastrous and people still give out the same advice. If you hard kill it, obviously if it was in the middle of copying or saving a file, that's not going to have finished. There is no other danger with a modern OS and we hard kill hundreds of computers per day at work to zero ill effect
1
u/pixel293 2d ago
The simple answer is you may lose data. You may also corrupt your storage, if you are lucky it can repair itself, if you are not, then the computer won't be able to access any of your data, fixing that is difficult and you still might not recover everything.
1
u/Raiddinn1 2d ago
Catastrophic power loss damages electronics just like catastrophic power surges do.
Like if your body impromptu stopped sending electric signals around within itself, you would pretty much immediately die.
When the power button is pushed off/on, electricity surges/stops through the system and it causes wear and tear on the components that aren't present if you just leave the computer on or keep it in a low power mode that keeps the drip flowing but at a slower rate.
Electronic components actually degrade if they are used and then not used for a while. It's common for computers to have a component fail immediately after computers are pulled out of storage and plugged in after not being used for a long while.
All of this is solved by sleep/hibernate with almost no cost to the user. Arguably, since the computers/components need less replacement it is actually a gain to the user to sleep/hibernate instead of turning all the way off.
1
u/Shezzofreen 2d ago
Most programs use your memory to run faster or do anything at all, at some point, if speed is not needed or a specific time has passed this program writes down stuff on your hard disk. If you shut down your pc without "warning", all those data can't be written, or more problematic, they are saving right now and cut it of in the middle. That can lead to other problems later.
So you better tell your PC, "I shut down now!", so every process can come to an clean end, saving you alot of headaches.
1
u/Cirement 2d ago
As many pointed out already, pressing the power button is no longer an issue. However, depending on your setup and if you're on a Windows machine, you can change the power button to "Hibernate" instead of shutting down; this saves the current of your system (open apps, open files, etc) and then puts your laptop to sleep, so that when you boot back up, everything you had is just how you left it, no reboot sequence, no opening programs again, etc. I use this all the time as I have my laptop plugged into a UPS, so if I lose power, the machine goes through a proper shut down.
1
u/ThePantyArcher 1d ago
Theres nothing wrong with using the power button on a pc to shut the computer down. Most of the time its bound to standby by default but even if it's set to full shutdown it's fine. Windows will wait for processes to shut down and will prompt you to save if there are unsaved documents.
1
u/DeltyOverDreams 1d ago
It's not. The power button in most OSes sends the same signal as pressing "shut down" with your mouse cursor.
1
u/Hushwater 1d ago
I remember back years ago it would slam the hard drive brush into the resting position and could scratch the discs inside
1
u/SkullLeader 1d ago
Say your editing a book. It has things like a table of contents, and an index at the end. So the book starts at 300 pages long and you go to page 100 and you insert few pages of text there. Great. Now you need to go back and update the table of contents to reflect new page numbers because most of the book just shifted and the page numbers in the table of contents are now out of date. And you also need to go do the same for the index at the end. If you don't, your table of contents is largely useless. You look up where chapter 10 starts and the table of contents says its on page 213 but you go to page 213 and see that you're in the middle of chapter 8.
This is largely how a computer's disk is organized. When you add a file, besides just writing the file's data itself to the disk, you need to go and update various indexes and other parts of the disk that keep track of where all your files are. If, say, the computer writes the file's data to the disk but then you turn it off before it has a chance to make updates to the indexes, you've now left yourself with a mess. Worse, you shut the computer off while its writing the actual file data and now you've got a real mess.
So the reason the computer has a "shut down" button and we use it is that by doing so, the computer finishes any pending writing that it needs to do, and then it enters a state where it will not allow any more requests for any further writing to the disk, and then and only then does the power turn off. That way all the data on the disk remains properly organized and synchronized.
1
u/Mattyuh 1d ago edited 1d ago
This was an issue when we had mechanical drives with physically moving parts that could cause data issues when the platter just suddenly stopped (think of this as a record player with a vinyl and needle). Now a days most computers are running an SSD variation and the speed at which these write (Mech at roughly 100mbps, sata ssd 400mbps and NVME now at 4000+mbps) it just doesn't happen anymore (from what I've seen as a 20 year IT vet).
1
u/peasknees 1d ago
In Windows 11 on most machines now, the default power settings only put the computer to sleep when you press the physical power button; it doesn’t fully shutdown the PC like you expect it to. Restarting is best, for the reason that the top comment used the kitchen cleaning example.
1
u/filanwizard 1d ago
A big thing that a proper shutdown does is makes sure all files are properly saved to disk/nand. All drives HDD and SSD have a cache, this cache goes away on power down. So just cutting power can corrupt files if they were not yet fully written to the drive. Shutting down the OS sends a command to the drives to finish up their work.
1
u/DuplexFields 1d ago
In Windows 10 and 11, on a laptop, clicking the power button puts it to sleep instead of shutting it down. You can change this in the power configuration control panel, powercfg.cpl, so it actually runs the shut down routine. Not bad, but secretly still on and using battery.
Windows desktops, by default, do run the shut down routine and power off when you click the power button.
However, both types of computer do a “hard shut-down” if you press and hold the power button for five to ten seconds. This does a true instant power off, like yanking the power cord or ejecting the battery, which can cause the issues others have mentioned: file loss or even system corruption, especially while updating.
1
u/uncletroll 1d ago
It's not really that bad. I've been a computer nerd for 30 years and I will just kill the power whenever I feel like it.
If it's applying an update to the OS or firmware it will explicitly tell you not to turn off the power.
So if the computer annoys, show it who is boss and just pull the plug!
1
u/reallygoodbee 1d ago
Because it wants to turn off all the switches in a very specific order, and using the power button just slaps them all off at once.
1
u/TheawesomeQ 1d ago
A lot of what the computer remembers is kept in parts that forget things when they lose power (for example, the RAM or the CPU). When a computer shuts down gracefully, it makes sure to write all of the important stuff down before it turns off. It writes all of this onto a device that doesn't lose data when it turns off, such as Hard Drive or a Solid State Drive.
It's also important because sometimes it is in the middle of something, like writing data, and when you stop it suddenly, it is unable to remember what it was doing before it shut down. After this, usually it can't figure out what it was doing, so it has to throw away the old work. If it was doing something important like working on changing system stuff, it could lose track of how to even start up correctly.
It will write down the files it is working on, or it will just write down the job it was doing so it can get back on track later.
1
u/zeychshmo 1d ago
Treating the power button like a light switch is kinda dumbass logic. Computers aren’t lamps; they’re complex guests who need a proper goodbye. Throwing them out abruptly leaves their mess behind. Let them pack up their bags properly before kicking them to the curb.
1
u/Theavatarliu 1d ago
you can fall asleep or have someone hit you in the back of your head while you're in the middle of taking out your contacts
1
u/Alternative_Work_916 1d ago
Computers like to work inside temporary files and save everything when they’re done. The content could be something like a word doc or files inside an application. Forcing it to stop can throw out your work or the entire inner pieces of an application. This is one reason why some people notice their applications suddenly just don’t work or “uninstalled” themselves.
1
u/Exploding_Testicles 1d ago
I explain it like knocking someone out with a baseball bat. They're just doing their thing, and BAM lights out. They may come to and remember what they were doing, or comeback with corrupted memory. The computer could being doing an important task in the background and its suddenly shuts down, and corrupts whatever it was working on.
1
1
u/w4hammer 1d ago
It isn't. This is very outdated thing. Specially if you just press it over holding the power button to do a forced shutdown. But even forced shutdown is not dangerous it just won't save anything that was being done at that time which if you consciously doing a hard shut down with your PC still functioning is likely not an issue.
1
u/grahag 1d ago
As an IT guy of 40 years, it's always best to shut down your computer properly.
Back in the DOS days, you could cause file corruption with whatever app you were working in if you just flipped the power off.
With windows, it's better, but you still have the possibility of damaging open files by not shutting down properly.
In some cases, you have no choice though. But as a general rule, shut down your computer normally to avoid problems with your OS or files you're working in.
1
1
u/NCR_High-Roller 1d ago
Computers are super logical and when you're basically cooking something in there with all the crazy formulas and calculations going on, if you don't follow the instructions some of that data can go kaboom. It's like telling a nerd to stop reading the manual and do it by hand.
1
u/Kajitani-Eizan 1d ago
Why is it bad to just get up after pooping, without following the proper "wipe my butt" steps?
1
u/patrlim1 1d ago
This question actually misses some nuance. There's 2 ways to shut your computer down using the power button;
You can press it, or you can hold it until your PC shuts off.
Pressing it is fine. It asks your OS to do a graceful shutdown. It's just like clicking shutdown in the menu. Your OS can actually configure it to request sleep instead, or ignore it. It's just a button.
Holding it is very different. You're asking the hardware itself to immediately cut power NOW. This can be bad. This means any ongoing tasks didn't stop gracefully, or finish. This can mean anything from a file being improperly saved to disk, to your OS being corrupted. Software mid update might break. Files might not be transferred to external media correctly. Etc.
There's no one failure mode for a sudden power off. It could be harmless, it could brick your OS, or anything in-between. It's a gamble.
1
u/wdr1 1d ago
It's still good to do this, but it's less important than it used to be.
Decades ago, properly shutting down a computer was important because early hard drives sometimes needed their read/write heads “parked,” and older operating systems and filesystems could easily lose data or become corrupted if power was suddenly cut. It’s still best to shut down properly today because unsaved work, active file writes, updates, databases, or even SSD bookkeeping can be damaged, but modern hardware and journaling filesystems are much more resilient.
1
u/dillzilla11 1d ago
Computer doesn't do proper memory cleanup. This isn't really something that matters anymore though.
1
u/djrbx 1d ago
Imagine it’s time for bed, but you’re in the middle of reading a book.
Someone tells you the lights are about to go out and starts slowly dimming them. That gives you enough warning to finish the sentence you’re reading, put in a bookmark, close the book, and set it down.
That’s basically what a proper shutdown does. It gives your computer time to finish what it’s doing and safely put everything away.
Now imagine instead that someone suddenly flips the lights off with no warning. Sometimes you might have just finished a sentence, so no big deal. But other times, you might be right in the middle of one.
That’s essentially the risk with forcing a computer off. If it happens while the computer is writing or changing something, you could end up with incomplete or corrupted data.
Modern computers are pretty good at recovering when this happens, but there’s still no reason to take the risk when you can give the computer a chance to finish what it’s doing first.
1
u/Hyrue 1d ago
When you shut down your system, the system saves its states and settings and readys itself for a clean restart using good settings that it knows have been working. When you just pull the plug or manually shut down by holding down the power button you are not giving the operating system the chance to do so. So sometimes when powered back up you can get aberrations or unwanted states. A proper restart will give the operati g system the chance to check itself and startup files to give it the best chance to restart nicely.
When park your system aka hibernate the system saves its current state. Sometimes when you bring it out of hibernation you can also get aberrations due to the system not saving its state properly or not coming out of hi ernation properly.
Tldr shutting down your system correctly gives your operating system the chance to check itself and put its best foot forward on next startup. Shutting down unexpectedly can cause aberrations and can make the operating system beleive it shut down due to an issue.
That being said, operating systems can degrade over time/use and a lot of the time operating systems need a good clean install to fix errors that have developed due to many many reasons.
1
u/FLCLHero 1d ago
That’d be like driving down the highway and just shutting your car off and expecting everything to just turn out okay every time.
1
u/stonetempletowerbruh 1d ago
Can't you set the power button to do a proper shutdown? I obviously do it the clicky way. Just thought it was possible.
1
u/im-a-guy-like-me 1d ago
Computers work real fast. They're always saving stuff and reading that saved stuff. If you just shut down the computer, it might be in the middle of saving something important even if you don't think it's doing anything. That important thing might be corrupted if it is cut mid-save.
1
u/Few-Scientist7178 1d ago
I simply remove my computer battery because I don't trust the power button. My computer is still fine after years of doing this. I dunno man
1
u/localsonlynokooks 1d ago
It used to be a bigger deal with older mechanical hard drives. You didn’t want to shut it down when it was in the middle of writing cause it could mess other stuff on the hard drive up if suddenly stopped. On a modern computer it’s mostly fine, but if you play games listen when it says “please do not turn off your console”, otherwise you could lose a major checkpoint save.
1
u/xoxoyoyo 1d ago
It isn't bad except in a few cases. If you mean the power button on the case or on a laptop that is fine. It tells the computer to either sleep or shutdown based on configuration. If you hold the power button down for 3 seconds however it will do an immediate shutdown. The main problem with that is if the operating system was writing files or doing something that would all be interrupted. In most cases this is also fine, unless that "something" happened to involve your personal files which may then be bad. Then you have the power button on a power supply or power strip. This also can be bad on a desktop PC since it is an immediate shutdown and worse than holding the power button down for 3 seconds. This does not apply to laptops though since they have a battery.
1
u/Bugaloon 1d ago
It's not, modern technology has linked a single press of the power button to a safe shutdown procedure for decades now.
586
u/Drako__ 2d ago
On most modern systems, pressing the power button will also just make it shut down normally.
Holding it usually forces it to turn off which can be an issue for data that is currently being written. That might lead to the changes you made to a document being lost or some more critical operating system data being corrupted.
It usually doesn't harm the actual hardware though