Wednesday, February 22, 2012

magic SysRq key to reboot server ..

I am sure most of has seen this issue earlier -

[root@DebaTestBox ~]# reboot
bash: /sbin/reboot: Input/output error
[root@DebaTestBox ~]# shutdown -r now
bash: /sbin/shutdown: Input/output error

Whats the rescue - call the data center guy and hard reboot.

WAIT!! **Just try this :

Theere is some issue with your disc for sure and thats why the kernel is unable to access the '/sbin/reboot' and '/sbin/shutdown' binaries from the disk so that it could execute them.


A fsck in next boot is mandatory now BUT what you need right away is - some way to reboot this BOX. Do we have something to tell the kernal bypassing anything or any command on disc.

Yes!

There is this "magic SysRq key" for your rescue.


First you must activate the magic SysRq option:

How To:

echo 1 > /proc/sys/kernel/sysrq

When you are ready to reboot the machine simply run the following:

echo b > /proc/sysrq-trigger

(Note: This will reboot your server, without trying to umount any file system)

BUT pleas remember this should only be used in dire situation as it wont do any umount of the currently mounted file systems. BUT if your drive is already failing then that may not be a concern.

Make the Sysrq setting permanent -

echo "kernel.sysrq = 1" >> /etc/sysctl.conf

More magic keys here

Thanks/-
D e b a

No comments:

Post a Comment

RCA - Root Cause Analysis

An important step in finding the root causes of issues or occurrences that happen within a system or organization is root cause analysis (RC...