I normally would test whether sysrq + sub works when the kernel panic occurs, but unfortunately my system works pretty stable, and I have no idea how to make kernel panic. So the question is very simple. Does sysrq work when the kernel panics, or do I have to reboot the machine by using the reset button?A bonus question: When the kernel reboots the system via the kernel.panic sysctl parameter, is it the exact same situation compared to pressing the reset button? Does the kernel make any actions before restarting the system, for instance sync or remount read-only?
Does sysrq work when the kernel panic occurs?
kernel
You should be able to generate a panic using:sysctl kernel.panic=1sysctl kernel.sysrq=1echo c > /proc/sysrq-triggerSee https://www.kernel.org/doc/Documentation/sysrq.txt for details on the kernel.sysrq parameter and the 'c' commandThe kernel.panic=1 parameter is to set to have the host to reboot after 1 second when a panic occured. If you want to investigate console output you might want to set the parameter to 0 to prevent the automatic reboot.