2

I have seen many articles and posts stating that a way to turn off the system via the terminal is issuing the shutdown -h now command. It obviously works on my system, but it shuts down everything extremely fast. If I power off the system using Ubuntu's GUI, the Ubuntu splash screen comes up, and it takes much more time before it actually powers down. By safe I am referring to a shutdown that makes sure all read/write operations are completed before powering down and avoiding data corruption.

So is using the shutdown command in the terminal actually a safe way to power off the system? If so, why does Ubuntu's shutdown menu take much longer to accomplish the same goal?

  • 1
  • 1
    @guillermochamorro They go over the -H (halt) option, but do not seem to go over the -h option which is supposedly equivalent to --poweroff according to the man page. Plus it doesn't seem like a good source of information considering they talk about shutdown -p which is not even a real option. They probably meant shutdown -P. – bmcentee148 Nov 28 '19 at 01:02
  • My guess would be that the GUI shutdown command is a little slow for the same reason that most GUI commands are a little slow - they attempt to make nice pretty screens, and give you time to look at them. I boot without the splash screen, and I generally shutdown from the command line - the command I see scrolling past on the screen indicate that filesystems are being sync'd and unmounted - processes are closing in an orderly manner... I'm not sure what more you would want. – Charles Green Nov 28 '19 at 01:54
  • 1
    @CharlesGreen "I'm not sure what more you would want" Lol I don't want anything more and never implied I did. I don't see anything scrolling by on the screen when I use the shutdown command, so I wouldn't be able to tell it is stopping read and write operations, unmounting filesystems, etc etc. – bmcentee148 Nov 28 '19 at 02:13

1 Answers1

2

YES it is safe but...

Shutdown does more than simply flush unwritten data from RAM to disk. In some installations it can be setup to run custom jobs:

But as an answer here points out:

The shutdown halt option (designated by shutdown -h in your question) does flush all the buffers and safely unmount the disks but it doesn't actually turn off the machine. To do that use:

poweroff

halt means flush buffers, unmount drives, close all processes in a graceful way. But not power off (though some systems may power off anyway). So the hardware is still provided with power.

After halt a hard power off (pressing the power button or unplugging the power supply) will not damage the system, because it is already halted in a graceful way.