Troubleshooting of Linux operating system crashes

Source: Internet
Author: User
Article Title: troubleshooting of Linux operating system crashes. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

Generally, when a system crash occurs, you may worry about another fault. However, you cannot analyze the cause of the fault because the system logs do not record any information before or after the crash, think there is no medicine to save. However, in fact, Linux has multiple mechanisms to ensure that valuable information can be obtained to analyze problems after a system crash occurs. Determine whether the fault is caused by hardware faults or application bugs.

In Linux, there are several methods to obtain information generated during various crashes.

1. Core dump

Core dump is usually used to debug application errors. When some application programs run abnormally and crash, you can enable the core dump function of the system to obtain the memory information when a program crashes, used to analyze the cause of the crash:

Add (or modify) one in/etc/profile:

Ulimit-c 0

Run the command: sysctl-w "kernel. core_name_format =/coredump/% n. core"

This command indicates that the core file is stored in the/coredump directory, and the file name is process name +. core.

  2. Diskdump

The diskdump tool allows you to create and collect vmcore (kernel dump) on a single machine without using the network. When the kernel itself crashes, the current memory and CPU status and related information will be saved to the reserved partition on a disk that supports diskdump. During the next restart, when the system restarts, The diskdump initialization script reads the saved information from the reserved partition and creates a vcore file, the file is stored in the/var/crash/directory again, with the file name 127.0.0.1-

The following is a procedure to enable diskdump on an hp scsi device. If it is not an hp scsi device (in the form of a device name/dev/sdX), you do not need to perform Steps 3 and 4. However, you need to execute the command modprobe before step 1.

Diskdump

Step 1: edit the/etc/sysconfig/diskdump file, enter the device name of a blank partition, and save and exit. For example:

DEVICE =/dev/cciss/c0d0p2

Step 2: Enable the dump Device

# Service diskdump initialformat

Warning: Data in this partition will be lost.

Step 3: Use the cciss_dump module to replace the current cciss module:

Find the following lines in/etc/modprobe. conf:

Alias scsi_hostadapter cciss

To:

Alias scsi_hostadapter cciss_dump

Add another row:

Options cciss_dump dump_drive = 1

Note: If the diskdump file is configured with/dev/cciss/c0d [# a] p [# B], set it to options cciss_dump dump_drive = [# a].

Step 4: rebuild the initrd file:

# Mv/boot/initrd-'uname-R'. img/boot/initrd-'uname-R'. img. old

# Mkinitrd/boot/initrd-'uname-R'. img 'uname-R'

Step 5: Set the diskdump service to enable auto-start upon startup:

# Chkconfig diskdump on

  3. Netdump

If you use the red-flag DC4.0 or 3.0 system, diskdump is not supported. You can use netdump to output vmcore. However, Netdump requires at least one server and any number of clients. The server is used to receive information when the client crashes. The client Often crashes.

(1) Server Configuration:

(1) check whether the netdump server has been installed:

Rpm-q netdump-server

If not, find the netdump-server software package in the RedFlag/RPMS/directory on the CD, and run the following command:

Rpm-ivh netdump-server-x.x.x.rpm (x is version)

.

(2) after installing the server package, run the following command:

Passwd netdump

Change the user password.

(3). Open the service:

Chkconfig netdump-server on

(4). Running Server:

Service netdump-server start

[1] [2] [3] [4] Next page

Related Article

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.