What should I do when the Linux system crashes?

Source: Internet
Author: User
If the problem can be reproduced, the problem has been solved by 80%. for the core of the operating system, if there is a reproduction method of the problem, it can be said that the problem has been solved by 99% and is often encountered.

If the problem can be reproduced, the problem has been solved by 80%. for the operating system core, if there is a problem reproduction method, it can be said that the problem has been solved by 99%, the common problem is that the system can run normally for a period of time and then crashes. if the problem cannot be reproduced, it is necessary to analyze the problem based on the things left on the crash scene.

If the system is not clean, such as disk interruption and file system is good, you may be able to keep the log information in the file, but I have never encountered such good luck, if the keyboard interrupt can still respond (press Num Lock, you can see the keyboard light off), then luck is good enough, then you can sacrifice the sysrq algorithm, at the same time, press Alt-Sysrq-T to obtain the process system stack information, press Alt-Sysrq-M to obtain the memory allocation information, and press Alt-Sysrq-W to obtain the current register information.

Linux/Documentation/sysrq.txt. In addition, it is best to disable the automatic blank function of the terminal so that the system can see at least some information on the screen when the system is dead. the setting method is as follows:

# Echo 1>/proc/sys/kernel/sysrq

# Setterm-blank

These two settings are recommended to be added to the system startup script (for example,/etc/rc. d/rc. local) to ensure that each start can be run.

If it is unfortunate that the keyboard is also dead quietly (more unfortunately, this is common), it is not only a way to wait for death, then you can use the serial port terminal (serial console) send system information

To another system, you can analyze the information to locate the problem. The Setting method is as follows:

Preparations:

1. a monitored server and a PC for monitoring.

2. a serial direct connection.

Configuration:

1. add a new grub project to the server and add the core parameter "console = ttyS0 console = tty1", for example:

Kernel/boot/vmlinuz-2.4.21-9.30AXsmp ro root = LABEL =/1 console = ttyS0

Console = tty1

2. modify/etc/sysconfig/syslog on the server and add the klogd option "-c 7" to ensure that more kernel information is output. For example:

KLOGD_OPTIONS = "-x-c 7"

3. restart the server

4. Use a serial port to connect two Machines. test:

1) Run "cat/dev/ttyS0" on the PC and "echo hi>/dev/ttyS0" on the server to check whether "hi" output exists on the PC.

2) run "cat/dev/ttyS0" on the PC and "echo w>/proc/sysrq-trigger" on the server to check whether the kernel information is output on the PC.

3) run "cat/dev/ttyS0" on the PC and "modprobe loop" on the server to check whether the PC has the corresponding kernel information output.

5. if the test passes, run: cat/dev/ttyS0 | tee/tmp/result on the PC.

In addition, you can use the Windows Super Terminal to obtain the serial port information.

That's it.

In addition, some core debugging functions, such as LKCD and netdump, can also be tested. The rest is based on experience and luck. Generally, the Linux system crashes due to the following reasons:

System hardware problems (SCSI card, Motherboard, RAID card, Nic, hard disk ...)

Peripheral hardware problems (terminal switch, network ...)

Software problems:

Driver bug (try to find the updated driver)

Core system bug (go to LKML and try another core)

System settings:

Finally, google, sometimes you can directly enter "what if the Linux system crashes? "

PE6650 often crashes. "You can see if anyone has encountered the same problem as you. even if you haven't found it, it is also a message that helps you analyze the problem. at least it indicates that your system may be different from others.

Investigating the Linux system crash is both a science and an art. it involves a lot of hardware and software knowledge and experience and is a process of continuous learning.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.