Common Linux Fault Diagnosis

Source: Internet
Author: User
Tags domain name registration
Common Linux Fault Diagnosis instructions-general Linux technology-Linux technology and application information. For details, refer to the following section. For most users, the ease of use of the Linux operating system is different from that of the Windows operating system. In a Windows operating system, when the system encounters some faults or problems, we often use some remedial measures for troubleshooting. These methods are many and easy to use. However, troubleshooting in Linux is complicated, and fault discovery is not as predictable as in Windows, you need to manually run some system and network management commands. The following describes the common fault diagnosis of the system and network in the Linux operating system.

System Fault Diagnosis

1. startup fault
This is a common problem in Linux. The main reasons for the system failure include: during Linux operating system installation, LILO configuration information is incorrect, resulting in the system failure to start after the installation is complete; reinstall other operating systems, also, the original Linux cannot be started. Because these newly installed operating systems do not have any other operating systems in the computer by default, the Master Boot Record (MBR) of the hard disk is rewritten ), the Linux operating system LILO boot program is overwritten, so that LILO cannot be started at last. During linux operating system operation, the system restarts due to incorrect Linux commands, an exception occurs.

Solution:
If you have created an emergency boot disk group for the Linux system during or after the installation of the Linux operating system, use the First Aid disk to start the system and then access the system, configuration can solve the problem. If the First Aid boot disk group is not created, the Linux system cannot start. What should I do? Three solutions are described below:

(1) enter the single-user mode of the Linux operating system. After the boot prompt, enter: linux single. In this mode, start Linux, LILO configuration and network configuration information are not loaded during startup.

(2) boot the disk. Use the first CD (boot CD) to install the Linux operating system to start the Linux system on the hard disk. Set the boot disc in the BIOS of the motherboard. After the machine is restarted, boot will appear: enter:

Vmlinuz root =/dev/linuxrootpartition noinitrd

Enter the Partition Number of your Linux root partition, that is, the hard disk partition location of the root file system of the Linux system, for example, vmlinuz root =/dev/hda3 noinitrd. After you press enter, you can enter the Linux system. To recover the corrupted LILO boot program, edit/etc/lilo. conf and run/sbin/lilo. This method is also suitable for other causes of damage to the Linux operating system. (Note: The process of starting an operating system on a floppy disk is the same as that on a floppy disk ).

(3) run the loadlin program in DOS to start the system. When a personal computer uses a Linux system, it usually coexist with Windows 9x or Windows 2000. If you know the exact installation partition of the Linux system on the hard disk and the loadlin Program (this program exists in the dosutil directory of the Red Hat Linux cd), you can also start the Linux system. Loadlin is a program in the dossystem. You can run it to directly start the Linux system from the dossystem and quickly enter the Linux environment. In addition to the loadlin program, you also need a Linux Startup kernel image file vmlinuz, which is available in the images directory of the Red Hat linux CD. For example, if you enter the DOS command mode under Windows 2000, and then run the following loadlin command, you can re-enter the Linux system:

Loadlin vmlinuz root =/dev/linuxrootpartition

After the command is executed, start to guide the Linux system. After logging on as a root user, edit/etc/lilo. conf and run/sbin/lilo. Then, reload the LILO system boot program into MBR.

2. File System Faults
In Linux, this is also a common fault. The file system is damaged due to abnormal system shutdown or sudden power loss.

Solution:
When the file system is damaged, you can use the fsck command to repair the file system. For example, the following command:

Fsck/dev/hda5

For more information about how to use the fsck command parameters, see the MAN reference manual. If an ext2fs file system is used, you can run the e2fsck command from a floppy disk to correct corrupted data in the file system.

Note: If the file system is damaged because the super block is damaged, the super block is the "Header" of the file system ". It contains information such as the status, size, and idle disk block of the file system. If a file system's super block is damaged (for example, data is accidentally written directly to the file system's super block partition), Linux may not recognize the file system at all, even if you use the fsck or e2fsck command, you cannot fix it. At this time, you only need to check whether there is a corresponding file system in the installation disc, and overwrite the file damaged by the original operating system to restore it. If you accidentally delete important files in the system, you can try this method.

3. function library fault
In Linux, if the function library file in the system is accidentally damaged or the symbolic link in the/lib directory is damaged, the commands dependent on these libraries cannot be executed. This is also a common system fault.

Solution:
The simplest solution is to use the first aid boot disk group to start the system, install the hard disk file system in the/mnt directory, and then repair the library in the/mnt/lib directory.

4. logon system faults
The system password file is modified because the Administrator forgets the password or the system is hacked. The Administrator may not be able to log on to the system using an account.

Solution:
Method 1: when the system is started, enter the single-user mode (linux single), then use the passwd command to reset the password, or change the password file to restore normal.

Method 2: Use the First Aid boot disk group to start the system, install the file system of the hard disk in the/mnt directory, and edit the/mnt/etc/passwd file for recovery.

Method 3: remove the hard disk of the installation system and place it in another Linux system. Then, mount the system installation area of the hard disk and mount/etc/passwd in the hard disk partition, the/etc/shadow and/etc/group files can be overwritten or modified or restored.

5. KDE environment faults
If the KDE environment of Linux cannot be started normally, for example, after running the startx command with a common account, the following error occurs: can not start X server. perhaps you do not have console ownershiip? . The cause of this prompt is that another user may have run the KDE environment and left a cached file indicating this user in the system.

Solution:
Run the following command:
Rm-rf/tmp /*

Then, run the startx command again to enter the KDE environment.

If the "can not start X server" error message is displayed after running the startx command with a common account, and the English characters of the error message are continuously tumble up, the KDE cannot be entered. In this case, it may be because the Linux system is not properly shut down, and thus cannot enter the Linux KDE environment.

Solution:
Log on to the console as a root user, type the setup command, and select "X Window Settings" in the system settings menu ", follow the prompts to correctly set the display type, refresh frequency, display size, and resolution. In this way, you can reset the X Window in the system. If no error is reported, the system automatically starts the KDE environment. Note that when you use the setup command, there may be a large number of English characters tumble on the screen. It doesn't matter. Please continue to see the screen, use the TAB or direction key for the above configuration, after the configuration is correct, the KDE environment will be restored immediately.

Network faults

1. The IP address cannot be pinged.
When the IP address cannot be pinged in linux, the main cause is the network information configuration error.

Solution:
(1) Use the ifconfig command to reconfigure the NIC address. The command line is as follows:
$ Ifconfig eth0 192.168.1.2 netmask 255.255.255.0
$ Ifdown eth0
$ Ifup eth0

Run the ping command to ping the IP address 192.168.1.2.

(2) modifying the network configuration file in the system can also achieve the above purpose. We recommend that you use this method to make the operation more reliable. The procedure is as follows:

Enter the directory where the network configuration file is located:
$ Cd/etc/sysconfig/network-scripts
$ Ls
Ifcfg-eth0 ifdown-ipv6 ifdown-sit ifup-aliases ifup-plip ifup-ppp ifup-sl
Ifcfg-lo ifdown-post ifdown-sl ifup-ipv6 ifup-plusb ifup-routes network-functions
Ifdown-ppp ifup-ipx ifup-post ifup-sit network-functions-ipv6

Use the vi command to modify the line below the ifcfg-eth0 file, for example:
IPADDR = 192.168.1.2

192.168.1.2 is the address to be modified or reconfigured. After the configuration is complete, the IP address change can take effect after the machine is restarted.

2. External access failure
If you cannot access the external network in the Linux operating system, for example, the IP address of the public network cannot be pinged, but the IP address of your machine can be pinged, the general reason is that the gateway information is not correctly configured.

Solution:
You can use the second method (directly modify the gateway configuration file) to quickly solve the problem. The procedure is as follows to enter the directory of the gateway configuration file:

$ Cd/etc/sysconfig
$ Ls
Apmd authconfig clock. OLD gpm i18n keyboard network provider sendmail apm-scripts cbq console harddisks identd kudzu

Run the vi command to modify the line in the network file under this directory, for example:

GATEWAY = 192.168.1.1

192.168.1.1 is the gateway address to be modified or reconfigured. After the configuration is complete, restart the machine to make the gateway address change take effect.

3. Domain Name faults
If domain name resolution fails in linux, the most likely cause is that a valid Domain Name Server is not specified locally. This is common.

Solution:
Generally, modify the files related to the Domain Name Service, such as/etc/hosts or/etc/resolv. conf, and add the IP addresses of valid domain name servers to these files. If the problem is not resolved by the local domain name, for example, the local domain name can be resolved, but the external customers cannot resolve the Company domain name, you need to contact the domain name registration service provider to solve the problem. This may be because the IP address in the company system does not correspond to the registered domain name.

Due to the length of the article, the introduction to common faults and problems in Linux is here. In fact, there are still many common errors and solutions. Here we will introduce some common mistakes and hope to help you.
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.