60

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

6 Answers 6

52

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

3
  • 3
    Whenever I have used halt, the system has actually powered down. Apr 29, 2015 at 16:42
  • @TorKlingberg that's because halt without parameters actually calls shutdown (see 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, 2015 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? Dec 14, 2016 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)

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.

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.

1
  • "halt" shutdowns the power on my PCs
    – Kedare
    Oct 15, 2010 at 22:46
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.

1
  • 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, 2010 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.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .