2

I need to reboot an Ubuntu Server 16.04, from terminal, where the sbin folder is unreadbale due to a disk IO error.

Now if I run shutdown -r I get command not found, as the sbin folder is not readable, also many other services are unresponsive due to this issue.

Is there another way to call the shutdown -r without calling anything in the sbin folder?

  • 1
    init 6 might work, tells the server to change to runlevel 6 (which is reboot) – Panki Aug 27 '19 at 10:00
  • nothing to do: Failed to start reboot.target: Connection timed out See system logs and 'systemctl status reboot.target' for details. It seems a serious problem and I have to go there physically to restart and fix the machine. I hope I'll be able to clone the drive! – Giox Aug 27 '19 at 10:09
  • 1
    Note that the (re)boot will probably fail. It is unlikely that a system with a damaged /sbin will boot. Try init 0 to shutdown it. – andcoz Aug 27 '19 at 10:10
  • 1
    I don't think that reboot is a good option in this case. Chances are, the server won't start afterwards. You'd better start backing up data from the server and get ready for hardware replacement and resetup. – deimos Aug 27 '19 at 10:22
0

The "magic SysRq" interface can be accessed through procfs to ask the kernel to reboot.

echo 1 > /proc/sys/kernel/sysrq # to enable magic SysRq
echo b > /proc/sysrq-trigger    # to reboot, same as if you had pressed Alt-SysRq-B

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.