RHCE exam Troubleshooting

Source: Internet
Author: User
RHCE exam Troubleshooting-Linux general technology-Linux technology and application information, the following is a detailed reading. I. MBR Error

Due to unexpected reasons, the primary Boot Record is damaged. When a new user installs multiple operating systems, the system often installs linux first, then installs windows systems, and then only guides win. In this case, grub. conf or lilo. conf is normal. You only need to re-install MBR in rescue mode.

Situation description: You can only access the Windows system or the black screen without any prompt after the BIOS passes self-check after the system is turned on.

2. BOOT program error

The grub. conf or lilo. conf file is incorrect. After grub. conf or lilo. conf is modified, or the physical location and partition of the hard disk are changed, the startup may fail. Go to rescue mode and modify grub. conf or lilo. conf. Note that after lilo. conf is modified, run the lilo command (you can add the-v parameter to view details ).

(1) General Situation of grub

1. If the kernel (vmlinuz-x.x.x file) is not found ),
File not found
Press any key to continue ....
Root (hdx, x) error or incorrect Kernel File Name

2. If you find the kernel and run it for a while,
Kernel Panic: Not init Found,
Generally, root =/dev/xxx is not found.

3. If you find the kernel and run it for a while,
Kernel panic: VFS: Unable to mount root fs on ...,
In general it may be forgotten to add initrd/initrd-2.4.21-4.EL.img (most of the time it happens when using a scsi hard disk)

4. In general, there must be several lines in grub. conf.
# More grub. conf
Title linux
Root (hd0, 1) #/location of the boot Partition
Kernel/vmlinuz-2.4.21-4.EL ro root =/dev/TEST/root # kernel and root partition (/partition) Location
(The root partition may be LVM and raid, not only hdx and sdx)
Initrd/initrd-2.4.21-4.EL.img

The best way to practice the grub. conf menu file is to delete the file and use grub at each restart.
The interactive command line will quickly become familiar with the content in the file.

(2) general situation of lilo

The prompt that the kernel file or ramdisk file (initrd-2.4.xx.x.ximg) is not found in lilo is the same as in grub, but if the partition changes, it will produce well-known errors such as L, LI, 010101.
The lines that must appear in lilo. conf.
Image =/boot/vmlinuz-2.4.21-4.EL # kernel location
Label = linux # equal to the title in grub
Root =/dev/sdc1 # root partition location
Initrd =/boot/initrd-2.4.21-4.EL.img
Note: If you do not add boot =/dev/sdx to lilo, you must add a parameter to specify the value when running the lilo program.
Lilo-B/dev/sdx


(3) Summary

1. grub. if the conf file is set incorrectly, you can use interactive commands to enter the system, while lilo. if the conf file is set incorrectly and the delay value is not set, the sigle mode cannot be accessed and can only be repaired using rescue. After modifying the file, you can send a normal restart signal without executing the sync command.
2. lilo. basically, no matter whether there are/boot partitions in the conf file, grub must distinguish whether there are/boot partitions, grub. root (hdx, x) in conf. If there is a/boot partition, this root refers to the/boot partition. If/boot is only used as a directory in the root partition (/partition ), this root (hdx, x) is the location of the/partition.
3. Can the kernel and root partition (/partition) locations in the lilo. conf file be written like grub. conf:
Lilo:
Images =/boot/vmlinuz-2.4.21-4.EL root =/dev/sdc1
Grub:
Kernel/vmlinuz-2.4.21-4.EL ro root =/dev/TEST/root
As a result, lilo cannot find/partition.
4. Remember that lilo. conf and grub. conf must be written in four lines. The difference is that grub. conf has a new line indicating/boot
Directory (note that not the/boot partition, but the/boot directory) is located in the partition location, while in lilo. conf
And root partition (/partition) split.
5. I guess grub and lilo are required items in troubleshooting.

Iii./etc/inittab

(1) If INIT: No inittab file found appears
Enter runlevel:
In general, the inittab file is lost or has errors.

(2) If the startup is normal, a series of errors will occur after INIT: Entering runlevel: 3 (or 5). It is very likely that si: sysinit in the/etc/inittab file is: /etc/rc. d/rc. sysinit errors because many modules of the system have not yet been initialized.
You can only enter the rescue mode. If you are not familiar with the inittab file, you 'd better reinstall the rpm package of initscripts once. The default/etc/inittab file should be properly started.




(3) first go to the rescue mode in linux!
Run the following command:
Rpm-qf -- root/mnt/sysimage/etc/inittab
Find out which RPM package the file belongs!
Then reinstall this rpm package!
Rpm-ivh -- force -- root/mnt/sysimage/mnt/source/Redhat/RPMS/packagename
Sync
Sync
Sync
Exit
[! -- Empirenews. page --]

Iv./etc/fstab

/Etc/fstab file error (error after/etc/inittab file)

(1) The following error occurs: WARNING: coundn't open/etc/fstab: No such file or directory.
/Etc/fstab file loss
The/etc/fstab file does not belong to any rpm package. Use the fdisk and e2label commands to view the root partition (/partition) ,/boot,/home,/usr,/var partition (if there are these partitions), and then edit the/etc/fstab file. Note the format of the fstab file. If you cannot remember it, view help: If no mount/partition is available, load first. If the/usr partition is a single column, load the/usr partition. If you are in rescue mode, chroot is used first. Find the fstab help file:

1. Direct man fstab
2. locate fstab
You will find a file named fstab.5.gz, usually in/usr/share/man/man5/fstab.5.gz
Man/usr/share/man/man5/fstab.5.gz
Or zless/usr/share/man/man5/fstab.5.gz
3. rpm-ql mount | grep fstab can also find the Help File of fstab.
4. find/-iname "* fstab *" the most stupid way
If it is not in rescue mode, what should I do when I modify the fstab file to Read-only file system? Reload to read/write mode
Mount-o remount, rw/dev/sdax/

(2) The mount file is lost or replaced
Mount file errors may result in/proc file errors. The red letter is very eye-catching, Which is troublesome. You need to enter rescue mode instead of entering the root password for modification, because the root partition is mounted to read-only (ro) mode, you do not have the mount command to mount the root partition to read/write (rw ).

(3) File System Errors
1. If you use fsck to fix the issue, you can only select y regardless of the prompt, or the system still has a problem.
2. The file system's superblock may be faulty. Recover the backup. (This is almost impossible in the exam)
Fsck. ext3-B (8192 * n) + 1

(4) raid or LVM errors
Use raid and lvm knowledge to fix the problem. If the raid disk or lvm disk has no data, comment out/dev/mdx and/dev/xxxxxx/xxx mentioned in/etc/fstab. Estimation of Redhat on raid or lvm data is not considered. I found/etc/rc in RedHat Enterprise as3. sysinit has a small bug. If I implement raid in LVM Based on raid, an error will be reported when the system is restarted.
For example:
1. edit/etc/raidtab # Set an arbitrary md0
2. mkraid/dev/md0 # if everything is normal, the raid can be used.
3. pvcreate/dev/md0 # create LVM pv
4. (method 1). vgextend VGname/dev/md0 # Add md0 to the existing vg.
4. (method 2) vgcreate VGname/dev/md0/dev/sdax # create a vg
5. lvcreate-L 5G-n newlv VGname # create a 5G lv named newlv lv in the VGname vg
6. mkfs. ext3/dev/VGname/newlv # format it into an ext3 File System
7. Add/dev/VGname/newlv to/etc/fstab.
8. reboot

You will find a system error. Original/etc/rc. sysinit starts raid based on the/etc/fstab file. If/etc/fstab does not start with/dev/mdx, do not start md0, md1. ...... in/etc/raidtab ....., restart the system and you will find that there is a (skiped) problem when you start raid. If the raid is a pv in the LVM, an error occurs when the LVM is started. The temporary method is to edit/etc/rc. sysinit, because in the rc. sysinit file, are there raid in/etc/fstab? Br>? Use the grep command:
INFSTAB = 'lc _ ALL = C grep-c "^ $ I"/etc/fstab'
INFSTAB is a variable used to determine whether the command is successful. $ I is md0 or md1. .. etc in the/etc/raidtab file. just remove the ^ above $ I.

(5) quota setting error
Big deal: Disable usrquota and kgquota in/etc/fstab.
FIXME: Is there any other possibility of errors?

V./etc/inittab

The system is shut down after repeated restart or startup.
An error runlevel is set, such as 0 or 6.

* ** If the service has basically been started, it appears ***

INIT: no more processes left in this runlevel
Maybe there is no program to guard tty1 or tty2 ............ , That is, the/etc/inittab file is missing.
1: 2345: respawn:/sbin/mingetty tty1
2: 2345: respawn:/sbin/mingetty tty2
And so on.
In this case, if you do not understand the format of // etc/inittab, force re-install the rpm package of initscripts.

6. Other daemon errors
The situation is complex. You can decide how to fix the problem based on the error information displayed.

VII. xwindow Error
Generally, it is related to the/etc/X11/XF86config file. Hard Disk problems cannot be involved in the exam. Running redhat-config-xfree86 can solve the problem, may occur more, the general point is the flushing rate, display mode such as 800x600

8. the root user cannot log on normally.

* ******* Password and PAM-related *******
(1) Login incorrect is mostly password-related.

1. It is true that the password is incorrectly modified in single-user mode.
2. the root user is locked to the single user mode usermod-U root.
3. There is no root user, that is, there is no user whose uid is 0
4. the/etc/securetty file does not contain tty * (* Indicates 1, 2, 3, 4, etc)


(2) After you enter your username and password, the screen will pop up, most of which are related to authconfig and pam.

1. What happened to Comrade trigger. In authconfig, ldap authentication is selected. After the address of the ldap server changes, the server cannot log on.
Solution: Run authconfig to cancel this option.

2. Added/etc/pam. d/system-auth
Account required/lib/security/$ ISA/pam_access.so or other similar pam mode restrictions, such as pam_listfile.so and pam_time.so.
The solution is the same as above. It will be deleted automatically after running authconfig.

3. Added/etc/pam. d/login
Account required/lib/security/$ ISA/pam_access.so
Or other similar pam mode restrictions, such as pam_listfile.so and pam_time.so.
Solution: you only need to manually view the login file. It will not be automatically canceled after running authconfig.

4. The module File Name in system-auth or login in the/etc/pam. d/directory is incorrect.
If the module File Name is incorrect, the system cannot log on.
We recommend that you view the/var/log/secure and message files in single-user or rescue mode when you cannot log on.

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.