How to Force Reboot a Frozen Linux or FreeBSD Machine
Sometimes your filesystem gets stuck. No operations can be done and a “reboot” will just cause an indefinite waiting time for I/O. You could be able to ssh into the server (or login via console), but no operations can be done as the storage devices are blocked. This may happen because of a file system failure or a strange kernel problem. This is more likely to happen when dealing with usb attached external interfaces.
There’s a “magical” code that triggers a specific kernel condition - and a reboot. Be careful, those commands should be considered as the last resort. No disk flush will be performed, no shutdown procedure will be started so you might completely destroy your file system or any open file.
Yet, this could be the best option you have and won’t be more harmful than a hard reset or a “traditional” cable pull - but you can do this remotely.
Remember to launch those commands with root privileges:
On Linux:
|
|
This will trigger an immediate reboot - no further disk operation will be performed.
On FreeBSD:
|
|
This will trigger a kernel panic that will (by default) cause a reboot.
Related Content
- How We Are Migrating (Many Of) Our Servers From Linux to FreeBSD - Part 2 - Backups and Disaster Recovery
- Creating an Alpine Linux VM on Bhyve - With Root on ZFS (Optionally Encrypted)
- Installing Mastodon Inside a FreeBSD Jail
- FreeBSD, Caddy and PHP - A Perfect Match
- How We Are Migrating (Many Of) Our Servers From Linux to FreeBSD - Part 1 - System and Jails Setup