Have a Question?

Categories

How to force a Linux server to restart?

You are here:
< All topics
Table of contents

Occasionally, some devices are locked, multiple disk mountings are lost, or the processes are stuck and the server responds very slowly. In such cases, the easiest solution is to restart the server.

For example, if one of the devices is locked or a mount point is damaged, the server cannot be restarted in the normal way.

Attention! The following command is not safe to use, so use it only in very justified cases! Adding a command can damage the file system and cause data loss.

After connecting to the server via SSH, you can force restart by issuing the following command:

echo 1 > /proc/sys/kernel/sysrq && echo b > /proc/sysrq-trigger
Attention! You cannot undo the release of this command!

The above command allows sysrq to be used. This allows us to communicate directly with the kernel. The second step sends the trigger b (to restart) to sysrq, which forces a restart.

The system will restart within a few minutes approximately as if the reset button was pressed on the machine. After restarting the system, you will be able to find and fix the problem.

Was this article helpful?
0 out Of 5 Stars
5 Stars 0%
4 Stars 0%
3 Stars 0%
2 Stars 0%
1 Stars 0%
How can we correct this article?
Please submit the reason for your vote so that we can improve the article.
Tags:
Previous How to archive old content?
Next How to set PTR record