Howto Reboot or halt Linux system in emergency (ZT)
http://www.cyberciti.biz/tips/reboot-or-halt-linux-system-in-emergency.html
Linux kernel includes magic system request keys. It was originally developed for kernel hackers. However, you can use this hack to reboot, shutdown or halt computer safely (remember safe reboot/shutdown == flush filesystem buffers and unmount file system and then reboot so that data loss can be avoided).
This is quite useful when Linux based system is not available after boot or after a X server crashed ( svgalib program crashes) or no display on screen. Sysrq key combo forces the kernel to respond it regardless of whatever else it is doing, unless it is completely locked up (dead).
Using further extension to iptables called ipt_sysrq (new iptables target), which allows you to do the same as the magic sysrq key on a keyboard does, but over the network. So if your network server is not responding you can still reboot it. Please note that Magic SysRq support need to be compiled in your kernel. You need to say "yes" to 'Magic SysRq key (CONFIG_MAGIC_SYSRQ)' when configuring the kernel. I'm assuming that you have Magic SysRq key' support is compiled in your kernel.
Enable sysrq keys
By default it is not enabled on many Linux distributions. Add or modify following line (as soon as new Linux system installed) /etc/sysctl.conf: # vi /etc/sysctl.conf
Append following config directive: kernel.sysrq=1
Save and close the file. Reload settings: # sysctl -p
Save and close the file and reboot system to take effect
How do I use the magic SysRq keys in emergency?
You need to use following key combination in order to reboot/halt/sync file system etc:
ALT+SysRq+COMMAND-KEY
The 'SysRq' key is also known as the 'Print Screen' key. COMMAND-KEY can be any one of the following (all keys need to hit simultaneously) :
- 'b' : Will immediately reboot the system without syncing or unmounting your disks.
- 'o' : Will shutdown your system off (if configured and supported).
- 's': Will attempt to sync all mounted filesystems.
- 'u' : Will attempt to remount all mounted filesystems read-only.
- 'e' : Send a SIGTERM to all processes, except for init.
- 'h': Show help, indeed this the one you need to remember.
So whey you need to tell your Linux computer to reboot or when your X server is crashed or you don't see anything going across the screen then just press:
ALT+SysRQ+s : (Press and hold down ALT, then SysRQ (Print Screen) key and press 's') -Will try to syn all mounted system
ALT+SysRQ+r : (Press and hold down ALT, then SysRQ (Print Screen) key and press 'r') -Will reboot the system.
If you wish to shutdown the system instead of reboot then press following key combination:
ALT+SysRQ+o
ipt_sysrq is a new iptables target that allows you to do the same as the magic sysrq key on a keyboard does, but over the network. Sometimes a remote server hangs and only responds to icmp echo request (ping). Every administrator of such machine is very unhappy because (s)he must go there and press the reset button. It takes a long time and it's inconvenient. So use the Network Magic SysRq and you will be able to do more than just pressing a reset button. You can remotely sync disks, remount them read-only, then do a reboot. And everything comfortably and only in a few seconds. Please see Marek Zelem page to enableIP Tables network magic SysRq function.
For more information read official Documentation for sysrq.c version 1.15 stored in /usr/src/linux/Documentation/sysrq.txt and read man page of sysctl, sysctl.conf.
Howto Reboot or halt Linux system in emergency (ZT)的更多相关文章
- 【2016-10-11】Linux系统常用的关机或重启命令shutdown、reboot、halt、poweroff、init 0及init 6的联系与区别
Linux下常用的关机/重启命令一般包括: shutdown.reboot.halt.poweroff等,当然了我们可以使用init 运行等级runlevel 0即halt来关机,或使用init 运行 ...
- linux reboot ,shutdown,halt区别
reboot ,shutdown,halt区别 重启 reboot 和 shutdown -r now 效果是一样的都是重启 区别在于reboot 是重启时,删除所有的进程,为不是平稳的终止他 ...
- init shutdown reboot poweroff halt区别
init 首先看看LINUX系统几种运行级别# 0 - 停机(千万别把initdefault设置为0,否则系统永远无法启动)# 1 - 单用户模式# 2 - 多用户,没有 NFS# 3 - 完全多用户 ...
- (copy) Shell Script to Check Linux System Health
source: http://linoxide.com/linux-shell-script/shell-script-check-linux-system-health/ This article ...
- How to rebuild RPM database on a Red Hat Enterprise Linux system?
本文是笔者最近遇到的一个故障的处理过程,解决方案是Rebuild RPM 的DB,后面内容其实是REDHAT官方的solutions,不过我遇到的现象和解决方案都与官方有点出入,故一直帖出来: 我遇到 ...
- Linux System and Performance Monitoring
写在前面:本文是对OSCon09的<Linux System and Performance Monitoring>一文的学习笔记,主要内容是总结了其中的要点,以及加上了笔者自己的一些理解 ...
- The frequent used operation in Linux system
The frequently used operation in Linux system 2017-04-08 12:48:09 1. mount the hard disk: #: fd ...
- Linux System.map文件【转】
转自:http://blog.csdn.net/ysbj123/article/details/51233618 当运行GNU链接器gld(ld)时若使用了"-M"选项,或者使用n ...
- the install of mysql in Linux System
一.下载MySql 浏览器打开 https://www.mysql.com/downloads/mysql/#downloads 下载 我下载的版本是Red Hat 5 版本的 https://www ...
随机推荐
- myEclipse 输入时英文自动变成2个字符大小
比如这样: ——这是输入法的问题,输入法被误设为圆角了. 输入法有区分圆角半角,正常来说我们使用的都是半角. 那么如何切换半圆角? ——比如:百度输入法 首先,将半圆角的快捷键显示出来: ——点击“d ...
- js桥接模式
桥接模式(Bridge),将抽象部分与它的实现部分分离,使它们都可以独立地变化. 抽象化和实现部分在一起,桥接模式的目的就是使两者分离,根据面向对象的封装变化的原则,我们可以把实现部分的变化封装到另外 ...
- Uploading files using ASP.NET Web Api
http://chris.59north.com/post/Uploading-files-using-ASPNET-Web-Api
- HTML DOM scrollTo()方法
一. 作用 scrollTo()方法可把内容滚动到指定的坐标 二. 语法 scrollTo(x, y) 其中参数x为要在窗口文档显示区左上角显示的文档的x坐标, y为要在窗口文档显示区左上角显示的 ...
- MySQL 分区知识点(一 )
前言: 查了下资料,关于 MySQL 分区的博文讲的详细的比较少,也不全,只好在官网去翻译英文文章看了.大体整理了一下记录起来: MySQL 分区类型: 1.RANGE 分区: // 这种类型的分区基 ...
- Spring_学习_00_资源帖
一.官方文档 1.Spring Framework Documentation 二.参考书籍 1.< Spring实战 (第四版)> 三.参考资料
- 15_游戏编程模式EventQueue
#### 两个例子 .GUI event loop ``` while (running) { // 从事件队列里获取一个事件 Event event = getNextEvent(); // Han ...
- php实现word在线浏览功能。
http://laoniangke.com/php/2012/10/08/php-doc-webview.html
- MySql数据库约束
<MySQL技术内幕:InnoDB存储引擎>本书从源代码的角度深度解析了InnoDB的体系结构.实现原理.工作机制,并给出了大量实践,本着将书读薄的思想,循序渐进的记录对本书学习的读书笔记 ...
- [Luogu3674]小清新人渣的本愿
luogu 题意 给你一个序列a,长度为n,有m次操作,每次询问一个区间是否可以选出两个数它们的差为x,或者询问一个区间是否可以选出两个数它们的和为x,或者询问一个区间是否可以选出两个数它们的乘积为x ...