60

With your typical Linux shutdown command, what is the difference between halting the system and powering off the system?

Jake Wilson
  • 8,814
  • 29
  • 97
  • 125

6 Answers6

52

Halting involves stopping all CPUs on the system. Powering off involves sending an ACPI command to signal the PSU to disconnect main power.

Ignacio Vazquez-Abrams
  • 45,939
  • 6
  • 79
  • 84
  • 3
    Whenever I have used `halt`, the system has actually powered down. – Tor Klingberg Apr 29 '15 at 16:42
  • @TorKlingberg that's because `halt` without parameters actually calls shutdown (see http://linux.die.net/man/8/halt) und `showdown -h` leaves the decision of if to power off or only to halt to the computer's settings. – Marcel G Apr 29 '15 at 21:12
  • I'm quite sure that invoking halt from crontab doesn't actually power off the system, but it only stops the cpu, without cutting power to the pc. In ubuntu the shutdown image remains visible on the screen. Instead, invoking halt from command line powers off it. Am I right? – Paolo Benvenuto Dec 14 '16 at 19:27
38

IIRC

# shutdown -H now

will halt the system - meaning the system will shutdown and at the end stop at a screen with the last message beeing something like "System halted".

# shutdown -P now

will power off the system - meaning the system will shutdown and at the end power off (only possible if the system actually supports it but most systems I know have for quite a while now)

# shutdown -h now

will only halt or power off the system depending on what's the default on that system (can sometimes be changed in BIOS)

Marcel G
  • 2,269
  • 15
  • 24
11

If the machine in question does not have power management capabilities, there isn't a difference. If it does, the difference is power off will send the signal to power the machine off, Halt will shut everything down and it will wait at a "Power Off" prompt, meaning it is safe to hit the power switch.

Alex
  • 6,603
  • 1
  • 24
  • 32
4

I'm fairly certain that a halt will just bring the OS down wheras a Power Off will bring the OS down and then send an ACPI power off command to the power supply.

EEAA
  • 109,363
  • 18
  • 175
  • 245
3

Well, technically speaking, you can halt the system without powering it off. So you issue a halt, wait for it to say "You can turn the computer off now" and then you can hit the power button without worrying that something is going to unmount weirdly.

But in most modern unix's halt, shutdown, init 0, poweroff, etc, etc all do about the same thing. Halt, for example, is mapped to "shutdown -h" when the system isn't in runlevel 0 or 6.

The redundant commands are all nods to backward compatibility with older, proprietary *nix's.

Satanicpuppy
  • 5,946
  • 1
  • 17
  • 18
  • I remember when Windows used to work that way! How many times did I come to work to see my computer still saying "You can now safely turn off your computer" from the night before... – dunxd Oct 15 '10 at 22:57
1

In the very old days, "shutdown" was a request to run through the init scripts and try to gracefully stop everything running by notifying it that the system was about to stop and it should clean up or exit nicely.

"Halt" was the brick wall. The system just stopped immediately without doing any orderly shutdown. It was nicer to the system than just pulling the input power... but not much.

David Mackintosh
  • 14,293
  • 7
  • 49
  • 78