1. fault recovery for Grub configuration file loss: the Grub configuration file generally refers to/boot/grub. conf file, which indicates the partition from which the kernel and memory image (RAMDISK) files will be loaded during system boot, the loss of this file will cause the computer to be stuck in the grub configuration interface at startup. To solve the file loss, the administrator needs to remember the basic configuration information of grub. conf, for example, [root @ localhost ~]. # Cat/etc/grub. confde
1. fault recovery for Grub configuration file loss:
The Grub configuration file generally refers to/boot/grub. conf file, which indicates the partition from which the kernel and memory image (RAMDISK) files will be loaded during system boot, the loss of this file will cause the computer to be stuck in the grub configuration interface at startup. To solve the file loss, the administrator needs to remember the basic configuration information of grub. conf, for example:
[Root @ localhost ~] # Cat/etc/grub. conf
Default = 0 # default number of systems loaded, starting from 0
Timeout = 5 # Time on the Grub configuration page at startup
Splashimage = (hd0, 0)/grub/splash.xpm.gz # Grub background image
Hiddenmenu # Hide a menu
Title Red Hat Enterprise Linux Server (2.6.18-8. el5) # operating system title
Root (hd0, 0) # operating system boot Partition
Kernel/vmlinuz-2.6.18-8.el5 ro root = LABEL =/rhgb quiet # Set the loaded kernel initrd/initrd-2.6.18-8.el5.img # Set the loaded memory disk file
Solution:
1. input the following statements in the grub configuration environment that the system starts;
Root (hd0, 0)
Kernel/vmlinuz-2.6.18-8.el5 ro root = LABEL =/rhgb quiet
Initrd/initrd-2.6.18-8.el5.img
2. Press boot to start the instance;
3. Create a grub in/boot/grub. conf file (the file content is the content just displayed), or restore the backed up grub file to grub. conf; then the system can be properly guided after restart;
2. fault recovery for the loss of the fstab partition mounting table:
The fstab file is located at/etc/fstab, which indicates how the system loads system partitions after startup, such as the important system partitions such as/,/boot,/home, all swap partitions must be mounted to the system through fstab. If the file is lost, the system mount process will fail, although the fstab loss system in RedHatLinux Enterprise 5 can still be started to the graphic interface (if installed), an error will occur when you access the command line interface. Let's take a look at fstab:
[Root @ localhost ~] # Vi/etc/fstab
LABEL = // ext3 defaults 1 1
LABEL =/boot ext3 defaults 1 2
Devpts/dev/pts devpts gid = 5, mode = 620 0 0
Tmpfs/dev/shm tmpfs defaults 0 0
LABEL =/home ext3 defaults 1 2
Proc/proc defaults 0 0
Sysfs/sys sysfs defaults 0 0
LABEL = SWAP-sda3 swap defaults 0 0
Let's take a look at this line.
LABEL = // ext3 defaults 1 1
This line shows that the partition with the label equal to/is mounted under the root (/) directory, and the partition is in ext3 format. Column 1 in the fifth column indicates whether the access partition needs to be backed up (0 indicates no backup, 1 indicates that the partition is to be backed up. Generally, the root partition must be backed up. 1 in column 6 indicates that the partition must be self-checked (0 indicates no self-check, and 1 or 2 indicates self-check, if the root partition is set to 1, other partitions can only be 2 ).
We set the tag because the partition name (such as/dev/sda1) is hard to remember, so the system will automatically set the partition tag /, set the partition label mounted to the/home directory to/home. The command for setting the label is as follows:
Name the/dev/sda1 partition as abc:
[Root @ localhost ~] # E2label/dev/sda1 abc
Query/dev/sda1 partitions:
[Root @ localhost ~] # E2label/dev/sda1 abc
Search for partitions labeled abc:
[Root @ localhost ~] # Findfs LABEL = abc
Solution:
If A system can be started and can use commands, You can manually copy fstab to/etc. However, because fstab is hard to remember, it is better for the Administrator to have A backup, copy the backup file to/etc/fstab.
B. If the system cannot be started, the rescue mode of the system CD should be taken as follows:
1. Put the Redhat system CD, set the boot from the CD, and enter the rescue mode (input the linux rescue );
2 findfs LABEL =/to find the partition name mounted to the original/directory;
3. If the partition found in step 1 is/dev/sda9, create a directory with mkdir/mnt/sysimage and use
Mount/dev/sda9/mnt/sysimage;
5. Go to the/mnt/sysimage/etc directory. If fstab has a backup, restore it (for example, mv fstab. bak fstab). If not, create a fstab by yourself;
If you use chroot/mnt/sysimage to set the current root directory to the root directory of the disk (otherwise, the current root directory is on the disc), enter the/etc directory, if fstab has a backup, restore it (for example, mv fstab. bak fstab). If not, create an fstab by yourself;
6. Press reboot or exit twice and restart the light tray.
3. fault recovery when the boot system boot directory is deleted
The/boot directory contains grub. conf and kernel and memory disk files used for system boot. deletion of this directory usually causes the grub configuration interface to be unavailable and the error error15 is prompted, the solution can only rely on the rescue mode of the system CD.
The worst case is that the/boot directory is deleted and fstab is deleted. How can this problem be solved?
Previous system environment:
The system assumes that linux and winxp are installed.
Mount/dev/sda8 to the/boot directory.
Mount/dev/sda9 to the/directory
Mount/dev/sda12 to the/home Directory
And/home directory backup has a kernel-2.6.18-8.el5.i686.rpm (this file is used to install the system kernel, very important, it is recommended that the Administrator back up one, in the System Disk also has), fstab, grub. conf file
The configuration of grub. conf is as follows:
Default = 1
Timeout = 5
Splashimage = (hd0, 7)/grub/splash.xpm.gz
Hiddenmenu
Title Red Hat Enterprise Linux Server (2.6.18-8. el5)
Root (hd0, 7)
Kernel/vmlinuz-2.6.18-8.el5 ro root = LABEL =/rhgb quiet
Initrd/initrd-2.6.18-8.el5.img
Title Other
Rootnoverify (hd0, 0)
Chainloader + 1
The result of df-h is as follows:
Filesystem Size Used Avail Use % Mounted on
/Dev/sda9 9.5 GB 2.7G 6.3G 30%/
/Dev/sda8 99 M 28 M 67 M 30%/boot
Tmpfs 474 M 0 474 M 0%/dev/shm
/Dev/sda12 965 M 53 M 863 M 6%/home
/Dev/sda10 965 M 18 M 898 M 2%/zjg
/Dev/sdb5 983 M 628 M 355 M 64%/media/disk
Solution:
1. Enter the system disk, set the boot from the disc, and press linux rescue to enter the rescue mode;
2. At this time, the disc cannot be automatically mounted/partitioned to/mnt/sysimage. You need to manually mount the disc;
Use findfs LABEL =/to find the partition to which the original/partition is mounted, for example,/dev/sda9. Similarly, find the partition/dev/sda12 corresponding to the original/home And/boot, /dev/sda8
Mount/dev/sda9/mnt/sysimage mount/
Mount/dev/sda8/mnt/sysimage/boot mount/(Note: Do not attach)
Mount/dev/sda12/mnt/sysimage/home mount/home
3. Switch chroot/mnt/sysimage to the root partition of the original system. Otherwise, it is the partition on the CD;
4. For example, if the Administrator has a fstab backup under the/home directory, copy the fstab backup under/home to/etc/fstab. If not, configure it and restart it;
5. Switch chroot/mnt/sysimage to the root partition of the original system,
6 go to the/home directory and install kernel-2.6.18-8.el5.i686.rpm
Rpm-ivh kernel-2.6.18-8.el5.i686.rpm -- root =/-- force
7. Now you can view the/boot directory and have installed the Kernel File and file system file.
Vmlinuz-2.6.18-8.el5
Initrd-2.6.18-8.el5.img
8. install grub: grub-install/dev/sda.
8. Copy grub. conf in/home to/boot/grub. conf. If not, configure it by yourself;
9 reboot or two exit restarts, and take out the disc to start;