0

Case in point:

  • FS corruption detected, I remounted the FS that contained both /bin and /sbin read-only, but they are not readable anyway.
  • I still have a running shell with sudo privileges not expired.
  • I cannot run /sbin/shutdown or /sbin/reboot or even /bin/kill, because they fail to read from the disk.

I want to reboot the machine to go to maintenance mode and e.g. run fsck from there.

How do I make the machine reboot?

Last time I just used the power switch. Did I miss a programmatic way to do that?

The machine was not running systemd. Would running it change the answer?

Update: this answer about triggering the Magic SysRq using just echo is nice, and would suffice in my case.

9000
  • 1,619
  • 1
  • 13
  • 23
  • 3
    Are you aware of the REISUB key combination? – Quora Feans Dec 02 '19 at 18:29
  • @QuoraFeans: yes, this would make a good answer! What if I had an ssh session instead? – 9000 Dec 02 '19 at 18:48
  • If you are connected to a SSH and the terminal is accepting commands, a `sudo reboot` will normally suffice for a restart. In your case, you could try this answer: https://unix.stackexchange.com/questions/116060/remote-executing-magic-sys-rq – Quora Feans Dec 02 '19 at 19:00
  • 1
    @QuoraFeans: as I stated in the question, `/sbin/reboot` was unreadable, as the shell helpfully told me. The link you gave is quite helpful; thanks! – 9000 Dec 02 '19 at 20:08

0 Answers0