"shutdown -hP" does not fully power off the PC ?!?

Hi all,

Until recently I thought that Linux cannot completely power off my PC because the USB power and thus my USB optical mouse will stay on, decorating the room in a sinister red glow during the night…

A few days ago I discovered that GRUB can do it properly:
When I type the “halt” command, the PC powers off immediately - incuding USB power and the optical mouse.

That’s what I want.
My actual solution is to “reboot” instead of “shutdown” when I want to shutdown the PC and when GRUB comes up, I enter “c” to get the console prompt and issue the “halt” command.

I tried a quick search with “grub shutdown poweroff” plus “usb” but I did not see anything useful.

So:

  • Does anybody know the reason for this difference? What is it?
  • Is there perhaps a way to fully power-off a PC from a running linux system? What must be done?

Right now I have no use for a halfway powered-off PC but just in case I need both states once in a while: Is that possible?

TIA for any hints
dirk_s

The answer is in the halt man pages; you need to be in run level 0 or 6 for it to do what you want - which it is when you invoke GRUB.

Have you tried

init 0

as an alternative?

Thanks for the hint, I didn’t think of that.

Meanwhile I tried ‘init 0’ - no difference, the PC shuts down and is silent, but the mouse keeps glowing in red.

I also tried ‘init 3’ and then ‘poweroff -fiph’ with the same result.

When GRUB controls the PC, there is no real OS running, most hardware is not accessed yet - that might make a difference but I can hardly imagine that something that GRUB can do isn’t possible from within the system. Or… is it?