Score:-2

When a laptop running Ubuntu 20 does not have battery, can you simply turn off the power supply to shut it down?

ar flag

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.

guiverc avatar
cn flag
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*).
muru avatar
us flag
Does this answer your question? [Does Hard reboot damage my Ubuntu](https://askubuntu.com/questions/487608/does-hard-reboot-damage-my-ubuntu)
Harsha avatar
ar flag
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
terdon avatar
cn flag
@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.
Harsha avatar
ar flag
Hi @terdon I'm not sure how I can ping a user, but I just edited my post. Please check
terdon avatar
cn flag
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?
Harsha avatar
ar flag
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
Score:3
cn flag

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.

Hannu avatar
ca flag
https://en.wikipedia.org/wiki/Sleep_mode
Harsha avatar
ar flag
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.
vanadium avatar
cn flag
@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.
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.