首页 > linux > linux 重启没响应

linux 重启没响应

2013年4月3日 eric 发表评论 阅读评论

今天IDC有服务器有两个分区变为只读分区,首先处理我想想卸载分区实行修复在挂载,无法卸载,然后考虑到线上服务器有备机,所以索性就直接重启下,执行 reboot 结果没响应,init 6 同样没响应。然后拿起电话准备给IDC 打电话重,后来想下肯定有办法重启的,就 google 了一下,果然找到了办法。执行下面两条命令:

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

1. /proc/sys/kernel/sysrq
向sysrq文件中写入1是为了开启SysRq功能。根据linux/Documentations/sysrq.txt中所说:SysRq代表的是Magic System Request Key。开启了这个功能以后,只要内核没有挂掉,它就会响应你要求的任何操作。但是这需要内核支持(CONFIG_MAGIC_SYSRQ选项)。向/proc/sys/kernel/sysrq中写入0是关闭sysrq功能,写入1是开启,其他选项请参考sysrq.txt。需要注意的是,/proc/sys/kernel/sysrq中的值只影响键盘的操作。

那么怎么使用SysRq键呢?

在x86平台上,组合键” + SysRq + “组成SysRq键以完成各种功能。但是,在一些键盘上可能没有SysRq键。SysRq键实际上就是”Print Screen“键。并且可能有些键盘不支持同时按三个按键,所以你可以”按住ALT键“,”按一下SysRq键“,再”按一下键“,如果你运气好的话,这个会有效果的。不过放心,现在的键盘一般都支持同时按3个或3个以上的键。

有很多,这里只挑几个来说,其他的可以参考sysrq.txt文件。

•’b’ —— 将会立即重启系统,并且不会管你有没有数据没有写回磁盘,也不卸载磁盘,而是完完全全的立即关机
•’o’ —— 将会关机
•’s’ —— 将会同步所有以挂在的文件系统
•’u’ —— 将会重新将所有的文件系统挂在为只读属性

2. /proc/sysrq-trigger
从文件名字就可以看出来这两个是有关系的。写入/proc/sysrq-trigger中的字符其实就是sysrq.txt中说的键所对应的字符,其功能也和上述一样。

所以,这两行命令先开启SysRq功能,然后用’b'命令让计算机立刻重启。

转载请注明:文章转载自:Eric's linux and nginx! (http://www.nginxs.com)
本文地址:http://www.nginxs.com/linux/508.html

分类: linux 标签: , ,
  1. 2018年5月14日13:47 | #1

    Find a local Mohawk carpet and flooring store.

  2. 2018年5月14日18:41 | #2

    Black Mould Clear up can a be a difficult activity.

  3. 2018年5月15日05:58 | #3

    canadian pharmacy online
    legitimate canadian mail order pharmacies
    fda approved canadian online pharmacies

  4. 2018年5月16日23:23 | #4

    canadian pharmacy cialis
    online canadian pharmacies
    International Pharmacies that Ship to the USA

  5. 2018年5月17日00:38 | #5

    viagra cialis levitra buy online
    viagra without a doctor prescription
    what is cheaper viagra cialis levitra

  6. 2018年5月18日01:20 | #6

    An outstanding share! I have just forwarded this onto a co-worker who has been doing a little researc on this.
    And hhe in fact bought me dinner due to the fact that I stumbled
    upon it for him… lol. So allow me to reword this….
    Thank YOU for thee meal!! But yeah, thanks for spending some time to discus tthis issue here
    on your web site.

  7. 2018年5月18日10:40 | #7

    use of cialis and viagra together
    viagra without a doctor prescription usa
    where can i buy sildenafil citrate over the counter

  8. 2018年5月21日21:22 | #8

    List of Safe Online Pharmacies
    best canadian mail order pharmacies
    canadian pharmacies online

  9. 2018年5月25日05:34 | #9

    It is a recognized truth that individuals respect electricians.

  10. 2018年5月29日02:56 | #10

    how many pills of viagra
    viagra without a doctor prescription usa
    do i need a prescription to buy viagra in australia

  11. 2018年5月30日23:01 | #11

    Online Drugstores
    aarp recommended canadian pharmacies
    canada drugs

  12. 2018年6月1日19:25 | #12

    smettere di fumare

  13. 2018年6月3日10:44 | #13

    Sintomi di dita a martello e la prevenzione statistiche dell’aborto spontaneo dopo il battito cardiaco

  14. 2018年6月3日18:59 | #14
  15. 2018年6月12日19:29 | #15

    It’s actually very complex in this full of activity life to listen news on Television, therefore I only use internet for that reason, and get the most recent news.

  16. 2018年6月13日00:13 | #16

    First ⲟff I woᥙld like to sɑy terrific blog!
    Ӏ haɗ a quick question іn ѡhich I’ɗ like to aѕk іf yoou do nnot mind.

    I was curious tο know h᧐w you center yourself and clear your mind before
    writing. Ӏ’vе hɑd a tough tіmе clearing my mind in ɡetting my ideas out theге.
    I ɗo enjoy writing but it јust seems
    liқe the first 10 to 15 minutes аre generaⅼly lost juѕt trying to figure out hoᴡ to Ьegin. Any recommendations ⲟr hints?
    Cheers!

  17. 2018年6月13日21:40 | #17

    If you apply these techniques for increasing traffic on your own website, I am of course you will see the variation in few days.

  18. 2018年7月4日22:16 | #18

    I am happy to see this you tube video at this website, thus right now I am also going to add all my video clips at YouTube website.

  19. 2018年7月6日02:17 | #19

    Hi there to every one, for the reason that I am really eager of reading this website’s post to be updated on a regular basis. It includes good data.

  20. 2018年7月17日03:41 | #20

    free 5 bet grand national
    xforex no deposit bonus
    10 free no deposit slots
    online slot cheats
    no deposit zar casinos

  21. 2018年7月20日01:24 | #22

    For the reason that the YouTube video clips are posted at this place same like I also embed YouTube video code at my own website, because it is simple to obtain embedded code.

  22. 2018年7月20日02:33 | #23

    It is the happiest time of my life so far, when I am watching these} funny video clips at this place, because after full day working I was so tired and now feeling perfectly.

  23. 2018年7月20日02:35 | #24

    It’s my first pay a visit to this web site, and I am really amazed to see such a nice quality YouTube video posted at this place.

  24. 2018年7月26日02:45 | #25

    This is a topic which is near to my heart… Cheers! Where
    are your contact details though?

  25. 2018年7月29日03:28 | #26

    Store pipes, fittings, water heaters, taps and extra.

  26. 2018年7月29日14:06 | #27

    Shop pipes, fittings, water heaters, faucets and extra.

  27. 2018年7月29日16:40 | #28

    The globe of work has actually certainly altered a great deal in the last few years. Outsourcing and TopRatedCanadianPharmaciesOnline.Com – Best Canadian Mail Order Pharmacies increasing quantities of unemployment have brought about great turmoils and changes in the work environment. Also [url=http://topratedcanadianpharmaciesonline.com/]Discount mail order pharmacies[/url] those that are still gainfully used usually discover themselves evaluating their shoulders waiting for the axe to drop. So, just how can individuals locate the ideal profession? While no job is a ‘safe bet,’ they could plan for a sought-after, seemingly bulletproof job such as drug store professional.

    learn more here

  28. 2018年8月1日09:35 | #29

    Oh! Wow its genuinely a funny and jockey YouTube video posted at this point. thanks for sharing it.

  29. 2018年8月1日10:35 | #30

    My grand father constantly used to watch YouTube funny videos, hehehehehe, because he wishes to be happy forever.

  30. 2018年8月1日11:17 | #31

    On each weekend, we all mates jointly used to watch show, because fun is also necessary in life.

  31. 2018年8月11日20:55 | #32

    What a video it is! Truly amazing and pleasant quality, please upload more video clips having such fastidious quality. Thanks.

  32. 2018年8月11日20:57 | #33

    Its my destiny to pay a quick visit at this web site and find out my required article along with video demo, that’s YouTube video and its also in quality.

  33. 2018年8月11日20:57 | #34

    I always used to read paragraph in news papers but now as I am a user of net so from now I am using net for content, thanks to web.

  34. 2018年8月11日21:53 | #35

    My chief is as well eager of YouTube funny videos, he also watch these even in office hehehe..

  35. 2018年8月11日21:57 | #36

    Great article, exactly what I wanted to find.

  36. 2018年8月11日21:59 | #37

    Every weekend i used to go to see this web page, as i wish for enjoyment, as this this web page conations really pleasant funny stuff too.

  37. 2018年8月11日23:24 | #38

    YouTube video clips are famous in entire globe, for the reason that it is the biggest video sharing site, and I become too happy by watching YouTube video tutorials.

  38. 2018年8月12日00:15 | #39

    Hahahaha, what a comical this YouTube record is! I’m still laughing, thanks to admin who had posted at this website.

  39. 2018年8月14日02:52 | #40

    do you need prescription buy viagra online
    buy viagra pfizer
    generic viagra soft tabs

评论分页
1 2 3 508
订阅评论
3+7= (必填)