Recovery countermeasures for Linux fault-caused boot Deletion

Source: Internet
Author: User
Article Title: Recovery countermeasures for Linux fault-caused boot deletion. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

The Linux administrator should be clear about the configuration information in grub. conf and can use the CD to enter the linux rescue mode for operations,

/Boot system boot directory and/etc/fstab deleted fault recovery

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?

If the system is not restarted, do not restart it first. If the system has restarted and remains on the grub interface, perform the following operations in Linux rescue mode:

1. Install initrd-2.4.20-8.img

Copy isolinux/vmlinuz from the first system disk to the/boot/directory and run the following command:

Mkinitrd/boot/initrd-2.4.20-8.img 2.4.20-8 # Set the loaded memory disk file

2. Install grub

Enter the mount command in the command line to obtain the following information:

[Root @ localhost root] # mount

/Dev/sda2 on/type ext3 (rw)

None on/proc type proc (rw)

Usbdevfs on/proc/bus/usb type usbdevfs (rw)

/Dev/sda1 on/boot type ext3 (rw)

None on/dev/pts type devpts (rw, gid = 5, mode = 620)

None on/dev/shm type tmpfs (rw)

You can also use df-h

Or the findfs output is as follows:

[Root @ localhost root] # findfs LABEL =/boot

/Dev/sda1

Because everything in the/boot directory has been deleted, you need to re-create the grub file in the/boot directory to install grub.

A. If the grub of the original system is clear. conf content or grub. conf backup is simple. You can directly create a grub. put the conf file under/boot/grub and enter the following command to install grub:

Grub-install/dev/sda

B. If you are not clear about grub. conf

Go to the/usr/share/grub/i386-redhat/directory and copy all the files to the/boot/grub directory.

[1] [2] Next page

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.