Various Linux common fault solutions

  

Linux system common fault resolution In the Windows system, when the system has some faults, we will use some common remedy measures to repair the system, also under the Linux system Some of the more common measures to solve common faults are more convenient to use. First we need to set up a rescue disk set, including two boot disks and rootdisk floppy disks, which can provide a separate boot and run full Linux system support. If you are a system administrator, then this is definitely your daily maintenance tool. The first disk of the rescue disk group stores the Linux system bootable kernel program system, and the second disk in the rescue disk group has a complete Linux system, including the "root" file system. Using the rescue disk set maintenance system is relatively simple to operate. When starting the system, you need to use these two disks to start the system, so you can enter the emergency mode, then we use the "root" account. However, in order to access the files already on the hard disk, we need to manually install the file system of the hard disk. The root directory of the system now refers to the root directory on the rescue disk. In order to be able to access files in the hard disk file system, you must first install the files into a directory that you specify. Thus, if the file system on the hard disk is installed in the /mnt directory, the path to the original /etc/passwd file on the hard disk is /mnt/etc/passwd. For example, use the following command to install the ext2fs type Linux filesystem on the /dev/hda2 disk in the /mnt directory: # monut -t ext2/dev/hda2/mnt. The most common mistake we make is that we have accidentally deleted some of the more important files and can't directly recover them. However, there is a corresponding file in the rescue disk group, we can find this file from the rescue disk group and copy it to the hard disk. For example, if the file /bin/login is deleted, the system will not be able to enter the login interface normally. We can start the system with the rescue disk group first, install the hard disk file system to the /mnt directory, and then use the following command. : #cp -a /bin/login /mnt/bin The “-a” option is used to tell “cp” to maintain file access when copying files. Of course, if the deleted basic file is not in the rescue disk set, this method cannot be used. But if you have done a backup of the system before, you can use the previous backup to recover. It is also common to destroy the file system. If you are using the file system of type “ext2fs”, we can run the “e2fsck” command from the floppy disk to repair the damaged file system. For other types of file systems, you can use the corresponding “fsck” command. A common cause of file system corruption is the file system's "head" (that is, "superblock") corruption, which contains information such as the state, size, and free disk blocks of the file system. If the file system's "header" is damaged, the system may not recognize the file system at all, and thus it cannot be installed. Even if the "e2fsck" command is used, the problem cannot be handled. However, the "ext2fs" type of file system backs up the contents of the "superblock" and stores it in the driver's block group boundary. You can use the following command to tell “e2fsck” to use the backup of the super block: # e2fsck -b 8193 <partition> where “ If you accidentally destroy the system function library file, or destroy the symbolic link in the /lib directory, then Commands that rely on these libraries will not execute properly. The easiest solution is to reboot the system with the rescue disk set, install the hard disk file system in the /mnt directory, and then repair the libraries in the /mnt/lib directory. If the superuser forgets the password, he or she will not be able to enter the system, and will not be able to manage and use the system. The rescue disk set can solve the problem. If the password may have been modified by the hacker, the system administrator cannot enter the system normally. That is, the Linux system completely loses control, so the system should be regained control as soon as possible. The general solution is to format the hard drive to reinstall the system, but this is a bit of a fuss. Prepare two floppy disks for bootdisk and rootdisk, boot from the floppy drive, boot to the <quo;root” disk and the “shell” prompt appears. Partition the Linux root directory to the /mnt directory. For example, if your Linux is on the first partition of the hard disk, enter mount /dev/hda1 /mnt in the command line, then enter the mnt directory and place the etc/passwd file. Rename, type mv /mnt/etc/passwd /mnt/etc/passwd.bak; then use the command cp /etc/passwd /mnt/etc/passwd to copy the /etc/passwd file on the floppy disk to the hard disk. “etc” directory, this will be restarted by the hard disk, you will not ask for the super password when you log in; finally use the mv/etc/passwd.bak passwd command to change the passwd file back, and then run the passwd command to reset the password. . System administrators should change passwords from time to time to prevent long-term use of a number and be stolen by others. When a personal computer uses a Linux system, it usually coexists with Linux and MS Windows 9x or MS Windows NT. Due to the installation of other operating systems, the original Linux system will not start properly. This is mainly because these operating systems default to no other operating system on the computer, thus rewriting the hard disk's master boot record (MBR), flushing out the Linux LiLo system bootloader. If there is a rescue disk set, of course, it is very simple, you can use the first boot disk to boot the hard disk Linux system, re-run the LiLo command, you can write the LiLo system boot program back to the hard disk master boot record, restart the machine. But if you don't make a system boot disk, how can you restore the Linux system on your hard disk without a rescue disk set? In this case, if you know the exact installation partition of the Linux system on the hard disk, and there is a loadlin program, you can return to the Linux system. The loadlin program is a program that runs under DOS. It can run Linux directly from DOS. This program is available in the DOSutil/directory of the Red Hat Linux 6.0 CD. In addition to this, you need an image file for the Linux boot kernel. This file --vmlinuz is available in the images/directory of the Red Hat linux 6.0 CD. For example, under Windows 98, enter the single-user mode of DOS, and then run the following loadlin command to re-enter the Linux system: loadlin vmlinuz root=/dev/hda8 where “/dev/hda8” is a Linux system “root” The location of the hard disk partition where the file system is located. After the command is executed, the Linux system is booted with “root” and after running the LiLo command, you can reload LiLo into the MBR, and you can return to the state where multiple operating systems were used together. Maybe you are not a system administrator, but with the increasing configuration of personal computers, installing Linux on your own computer is nothing new. Suppose we have both Windows and Linux operating systems on our computer. How do I start Linux? Do you need to restart your computer every time, booting through LiLo? In fact, if we are in DOS, there is a simple and quick way to start Linux, that is Load Linux. “loadlin.exe” is an executable program under DOS, it can start Linux quickly in a pure DOS environment, and there is no need to restart the computer, usually we can find this program in the /kernels directory of the CD. If you don't know where this program is placed on the installation disk, you can use the “find -name loadlin*” command to find it. Once you find it, copy it to the DOS partition and copy the Linux kernel file you are using. You can copy directly from the CD through Windows, or use the mcopy command to copy the file to the DOS partition in the Linux environment; then write a Linux.bat batch file with the following contents: c:loadlin c:vmlinuz root=/dev /hda1 ro We assume that the two kernel files loadlin.exe and vmlinuz are in the root directory of the c drive, and root is the Linux root device, and Linux is in the first partition of the hard disk, so the device name is /dev/hda1, which means Readonly. Later, when you want to start Linux under DOS, you can run Linux.bat. This makes Linux fast and efficient, greatly reducing the amount of time waiting for the system to self-test. If we run Linux in Xwindows state, due to hardware problems or improper operation, sometimes it may cause the system to suddenly lose response, which is a kind of crash phenomenon that we often get. In fact, the system does not crash at this time. . We can use two common methods to eliminate this phenomenon: First, use the composite key Ctrl+Alt+Backspace on the keyboard to close the currently running task; second, first press and hold Ctrl+Alt+F2 on the keyboard. Composite key, let the system switch to another console, then log in to the system, then execute #ps -ax| Grep startx command, this will list your Xserver process ID (PID), then enter the following command on the command line to eliminate the crash phenomenon under Xwindows: #kill -9 PID_Number, and finally return through the Alt+F1 composite key The original platform. There are a lot of common mistakes and solutions. I just mentioned a part here. If you still need to add something or if there is a need to correct it in this article, let us improve it.

Copyright © Windows knowledge All Rights Reserved