Home > Software design >  What does "sudo reboot -h now" do?
What does "sudo reboot -h now" do?

Time:12-30

Someone told me this a long time ago: sudo shutdown/reboot -h now

It should shutdown/reboot the system immediately. But today (5 years of Linux experience later) I don't quite get what the -h is.

There is no help for it in the reboot -help and I can't find anything about it on the Internet. Does someone have an idea what that argument is / if it even exists?

I am assuming, that it doesn't even exist and my system is just executing the immediate reboot without caring for the argument (or just not spitting an error at me).

Since I only used Raspberry Pi's with linux up until now, I have no plan, whether this might even be a Raspberry-specific argument

CodePudding user response:

It was for stopping hard discs before restarting. The reboot/poweroff/halt was instantaneous, data could be lost. sysvinit halt.c#L16 and sysvinit htdown.c.

Nowadays, it's just ignored by systemd systemd systemctl-compat-halt.c :

            case 'i':
            case 'h':
                    /* Compatibility nops */
                    break;
  • Related