Linux System File Deletion and repair

Source: Internet
Author: User

1. Delete all files in the boot directory

# Delete/boot and restart
[Root @ serv01 boot] # rm-rf *
[Root @ serv01 boot] # ls
[Root @ serv01 boot] # reboot
# Errors
Error 15
 
# We close the virtual machine, and then use the CD Drive, pay attention to the memory adjusted to 800 M; restart the computer, at the moment of startup, press the ESC key, enter the Boot Menu, choose CD-ROM Drive
# Enter the boot page, select Rescueinstalled system, Choose a language, select English, Keyboad Type, select us, Rescue method select Local CD/DVD, Setup networking select no, Rescue select Contiune, select "OK" for Rescue, and then select "OK" for the next interface, shell start shell, and start shell.
 
# It is found that bash is entered. At this time, cd/boot won't work.
# Input chroot/mnt/sysimage to enter/, then enter/boot, and find that bash changes to sh
# Configure the yum source,
Ls
Ls/iso
Mount/dev/cdrom/iso
# Reinstall the kernel
Yum reinstall kernerl-y
# You can also use rpm to install rpm-ivhkenerl-xxx -- force -- replacefiles
 
# Installing grub
Grub-install/dev/sda
# Exit sh
Exit
# Go to bash and restart
Reboot
# Go to grub and execute the following content in sequence (press the Tab key)
Root (hd0, 0)
 
Kernel/vmlinuz-2.6.32-131.0.15.el6.x86_64
Initrd/initramfs-2.6.32-131.0.15.el6.x86_64.img
Boot
# Go to grub again and execute the following content in sequence
Root (hd0, 0)
 
Kernel/vmlinuz-2.6.32-131.0.15.el6.x86_64
Initrd/initramfs-2.6.32-131.0.15.el6.x86_64.img
Boot
 
 
# If the repair is successful, you can edit the grub. conf file. The grub. conf file will not be rebooted next time. The grub. conf file is as follows:
[Root @ serv01 opt] # cd/boot/grub/
[Root @ serv01 grub] # vim grub. conf
[Root @ serv01 grub] # cat grub. conf
Default = 0
Timeout = 5
Title RedHat Server 6.1
Root (hd0, 0)
Kernel/vmlinuz-2.6.32-131.0.15.el6.x86_64 ro root =/dev/sda2
Initrd/initramfs-2.6.32-131.0.15.el6.x86_64.img
 
 
[Root @ larrywen/] # ssh 192.168.1.11
Root@192.168.1.11's password:
Last login: Wed Jul 31 18:05:19 2013 from192.168.1.1
 
# We recommend placing the/boot partition in the first position.

2 rc. sysinit file loss

# Rc. sysinit file is lost and enters the repair mode. The method is the same as above. You only need to reinstall (copy) the file.
[Root @ serv01 grub] # ls/etc/rc. d/rc. sysinit
/Etc/rc. d/rc. sysinit
# Installation Error
[Root @ serv01 grub] # yum install/etc/rc. d/rc. sysinit
# Reinstall
[Root @ serv01 grub] # yum reinstall/etc/rc. d/rc. sysinit
 
[Root @ serv01 ~] # Rpm-qf/etc/rc. d/rc. sysinit
Initscripts-9.03.23-1.el6.x86_6
# Other System File loss, similar operations

Next, let's take a look at the highlights of page 2nd:

Recommended reading:

Basic usage and advanced usage of the find command in Linux

Naming rules for file names of operating systems such as Linux and Windows

Location of Linux system files

Linux File concepts and types

  • 1
  • 2
  • 3
  • Next Page

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.