Linux: SW vs HW poweroff

Hi team,

Related to a customer question about the poweroff process, I wanted to ask some generic questions that arose while trying to answer him, if you don’t mind. I can’t say that I haven’t used much of the SW poweroff/reboot as I usually press the turnoff button from our carrier boards, but I was wondering if there is actual benefit apart from “doing things the way it is supposed to be” (in order to prevent data loss, tidy things up, etc.)

For clarity reasons, under the following, we have already taken care of all data we want to save, syncd, and we are ready to turn off the system (at least, at user level). I would like to ask the following mainly as a rule-of-thumb and any exception that you happen to know. Also, by SW poweroff I believe shutdown now is a good equivalent:

  • Is there any specially critical process that should not be avoided? (I assume there is no critical process that cannot be avoided)
  • I’ve seen that most close routines are done by systemd? Can all those be “non-gently” closed generically?

Any additional comments would be appreciated!

Thanks and kind regards,
Alvaro.

Hi

The SW poweroff/reboot is the same as you may know from your Host. By doing the Software Reboot, Linux System will take care of shutting down the running applications, stop the write/read operations and unmount the file system before restarting the system.

If you already taked care of saving all the data with sync and closed all the applications which are writing to the storage, then you might also do the HW Poweroff.

Is there any specially critical process that should not be avoided?

I think this depends on the application.

I’ve seen that most close routines are done by systemd? Can all those be “non-gently” closed generically?

Sure, if they are not doing any write operations.

I think, in general the probability of getting data loss is higher when using hard power-off than sw power-off.

What is the clients application? Why he wants to do hard power-off?

Best regards,
Jaski