Linux force reboot/shutdown

Forcing reboot

Linux is not Windows XP and if reboot fail you usually still connect by SSH and do something. This commands will show you how to remotely hard reboot machine. Hard reboot mean that shutdown scripts will not run and machine reboot immediately without syncing hard disk drives, shutdown applications etc, it’s more like hitting the reset button.

echo 1 > /proc/sys/kernel/sysrq

echo b > /proc/sysrq-trigger

This commands enable sysrq and after this calls fast reboot. If you want to force shutdown machine try this.

Force shutdown

echo 1 > /proc/sys/kernel/sysrq

echo o > /proc/sysrq-trigger

Pasted from <http://blog.air4web.com/linux-force-reboot.html>

This came handy, when I had a server that had some IO error and it can no longer read from disk, only few cached binaries into memory kept it running (kernel, SSHD, bash), I could still access the machine via SSH but can no longer do anything, forcing the reboot as mentioned above was my only resort, and it worked like charm…

About these ads

8 Responses

  1. Great tutorial, really help me. Thx.

  2. Thanks. That helped when I accidentally deleted my root RAID unit.

    For other people looking for this information via Google, I’ll say I:
    removed root RAID drive and unmounted root file system using
    3ware 3dm2 raid controller card. :)

  3. I use this every day! omg I wish I didn’t but I totally do. thanks!!!!!

    • Well, is “Thanks” here a good thing or a bad thing (just being sarcastic) :D
      Either way, I’m glad it helped :)

  4. [...] Linux force reboot/shutdown « Sameh M. Shaker’s Weblog. Share this:FacebookTwitterLike this:LikeBe the first to like this post. Categories: Information [...]

  5. Brilliant! I was doing something really stupid with my RAID controller management tools and put the server in a bad state. I was about to submit a ticket to the colo facility and drop down a couple of C-notes in the process, but you saved the day.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: