Linux Kernel - Forcing a Crash

In software development, it is sometimes important to have resiliency to crashes in the software. It is less impractical though, to induce a crash in a remote machine, which may not be easily power cycled. For this purpose, the Magic SysRq Linux kernel functionality can be tapped into:

echo "b" > /proc/sysrq-trigger # Emulates a crash

The most relevant options, from the Linux kernel manual:
  • b - Reboots the kernel without first unmounting file systems or syncing disks attached to the system.
  • c - Crashes the system without first unmounting file systems or syncing disks attached to the system.
  • o - Shuts off the system.