-2

If there is a difference, can you rather put the laptop in sleep and then turn off the power? What if you close all the running applications and then shut-down?

Would these measures ensure the software/hardware of the laptop are not disrupted by the sudden power-off?

What difference could it possibly make compared to shut-down? I am asking this as I'm curious to know what actually happens in the shutdown.

Harsha
  • 508
  • 3
    If you force power-off via cutting power; you risk damage to data on the drive; be it buffers sitting in RAM that weren't written to the drive; inconsistencies in file-system due to lost data etc. It's best if you shutdown via command/instruction OR if you're in a hurry use SysRq commands direct to kernel and bypass the OS (assuming you're on a release where this is possible as you didn't provide OS & release details; it's disabled for newer releases by default but can still be enabled - SysRq REISUO is what I'd recommend). – guiverc Dec 26 '21 at 11:13
  • 1
    Does this answer your question? Does Hard reboot damage my Ubuntu – muru Dec 26 '21 at 18:13
  • I thought the operating system performs a lot of tasks specific to shutting down the system @terdon please let me know if I'm wrong. I asked as I didn't know where I could learn this from on the internet – Harsha Dec 26 '21 at 18:13
  • @Harsha I may have misunderstood the question, but since it doesn't mention the OS and only talks about the hardware and whether it is possible to turn off a laptop by unlugging it, I thought you were asking about the hardware. If that is not the case, can you please [edit] to clarify that you are asking something else? If you do, please ping me so I can retract my downvote. – terdon Dec 26 '21 at 18:17
  • Hi @terdon I'm not sure how I can ping a user, but I just edited my post. Please check – Harsha Dec 26 '21 at 18:22
  • That's exactly how you ping a user: use @username like you did with me! Note that this only works for users who have interacted with the post (e.g. left a comment or edited). And yes, that does make it a bit clearer, thank you. So you are basically looking for the answer Vanadium gave below, right? – terdon Dec 26 '21 at 18:37
  • That is close to what I would like to have, I could have benefited if the "data volumes" and "caching" concepts are explained clearer wrt shut-down of the system though @terdon – Harsha Dec 26 '21 at 18:49

1 Answers1

3

During shut down, many things happen, including properly writing out data cached in the computer memory (RAM) to partitions on disk and closing these partitions. That is why a system should always be properly shut down before powering it off.

Powering off the system without shutting it down should be avoided at any price. This may or may not cause heavy damage to the file systems on the partitions, breaking the entire system beyond repair.

Unpowering a system that is in a sleep state is also not appropriate. A system that is in a sleep state has all data of the current session stored in RAM, and thus continues to use very little power to preserve the data stored there. Also with sleep state, data volumes are not closed. The idea is that the system resumes exactly where it left off when put out of sleep mode. If you now unpower the system, that RAM is lost, and the system has to reboot fully, and thus might encounter a file system that is damaged.

In summary: If you can leave the laptop on AC power, you can put it to sleep and quickly resume later. If you need to take it of AC power, your only option is a proper full shutdown.

All other attempts entail a risk to break your computer.

vanadium
  • 88,010
  • https://en.wikipedia.org/wiki/Sleep_mode – Hannu Dec 26 '21 at 16:39
  • Thank you @vanadium for the answer:) I would appreciate more if you can provide links that explain "data volumes" and "caching" concepts wrt shut-down of the system. – Harsha Dec 26 '21 at 18:51
  • 1
    @Harsha I replaced the generic "data volume" by more specific terms, i.e. disk and partition. feel free to use any keywords provided in my answer to look up anything you are not familiar with. Current post gives some insight to the "why" but it surely is out of scope to go into technical details or give basic explanations on what cache and data volumes are about. – vanadium Dec 27 '21 at 08:36