Skip to content

Instantly share code, notes, and snippets.

@okv
Last active May 15, 2019 10:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save okv/790f331df6a638d55db5f6b3a5d0e26b to your computer and use it in GitHub Desktop.
Save okv/790f331df6a638d55db5f6b3a5d0e26b to your computer and use it in GitHub Desktop.

Remote hard reset via ssh

Sometimes, reboot or shutdown -r now, don’t work anymore.

echo s > /proc/sysrq-trigger &&
echo u > /proc/sysrq-trigger &&
echo s > /proc/sysrq-trigger &&
echo b > /proc/sysrq-trigger

It'll do:

  • emergency sync of the block devices
  • mount readonly of all filesystems
  • again a sync
  • force an immediate boot; you can also use o for poweroff.

More info:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment