What is the difference between Halt and Poweroff commands? I understand that both of them lead to shutdown of the machine, then why 2 commands?
I want to know this because in my Virtual Machine. Poweroff leads to complete closure of VM. Whrereas halt leads to killing of all processes, and then a stall with 100% CPU Utilization. After giving the msg "System is going to be Shut down". This does not happen when, say I use halt to shutdown my computer. Basically both halt and poweroff lead to proper shutdown in a stand alone computer (no VM).
halt brings the system down to its lowest state, but leaves it powered on. shutdown brings the system down to its lowest state, and will turn off power (soft power switch) if it can. Most computers now can do so. reboot restarts the system.
The Shutdown button on your screen closes open processes and exits Windows in an orderly manner. The power button on your computer simply shuts off the power. It's like the difference between being allowed to finish your sentence and being abruptly cut off.
halt instructs the hardware to stop all CPU functions, but leaves it powered on. You can use it to get the system to a state where you can perform low level maintenance. Note that in some cases it completely shuts down the system.
The halt command, if invoked without the -p switch, simply halts the OS and stops all CPUs. Once the system is cleanly halted, the user may safely hit the Power button on his computer manually.
Halt does just what it says: it stops the machine, leaving it in a powered-on state (which usually implies that someone has to reboot or shut it down manually afterwards). Like halt, poweroff also stops the machine, but also shut it down afterwards.
The fact that on your physical machine the halt command also shuts the machine down, might just be a tweak of your linux distribution (the proper halt behavior probably doesn't make much sense for everyday use).
Check
man halt
for details.
As for the CPU usage of your virtual machine after a halt, my half-educated guess is that since the operating system is not running on it anymore, no HLT instruction can be issued and therefore your console meter shows a 100% CPU usage (maybe your virtual machine control panel computes the CPU occupancy by checking how many HLT instructions are executed per second):
http://en.wikipedia.org/wiki/Idle_(CPU)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With