planetfoo

Reboot Linux via proc

by Matt on Nov.23, 2009, under Linux

Every now and then one of my machine looses a disk in such a way that I can no longer read the file system but the system is up and I can log in or get console access. This seems to happen when using software RAID1 when one of the disks fails on some of the hardware I use.

To reboot the box:

echo 1 > /proc/sys/kernel/sysrq
echo b > /proc/sysrq-trigger

To shut it down:

 echo 1 > /proc/sys/kernel/sysrq
echo o > /proc/sysrq-trigger

Leave a Reply