Denoted: a process that fixes a CentOS7 that causes startup file loss and subsequent problems after unloading the extra kernel

Source: Internet
Author: User
causes

CentOS system startup, either normal, or rescue, can not enter the system, directly into emergency Mode.
Carefully review the log: JOURNALCTL-XB

Discovery Log can not find the boot file, to/boot next look, I wipe tears, this Nima what ghost, unexpectedly is empty ....
In retrospect, it seems like the last time you did this: Yum Erase kernal
Madan, hands are cheap. Fix

Train of thought: from the internet turned over the information, know that you can copy the RPM package from the CD, re-install the kernel to generate the boot file.
Insert installation CD boot, enter rescue mode, copy kernel install RPM:

    Chroot/mnt/sysimage
    mkdir/mnt/cdrom 
    mount/dev/cdrom/mnt/cdrom
    cd/mnt/cdrom
    CP package/kernel-*. Rpm/root
    cd/root
    rpm-ivh kernel-*.rpm
    reboot
transition

This thought the reboot should be no problem, the results of the screen on the compelled of grub rescue hit the face dozen.
I thought, well, then get in there and fix the Grub boot menu.

Hang the disc again, enter rescue mode, the result, dead or alive can not chroot. I wipe tears, this what ghost AH.
No way, had to think of MOUNT/DEV/SDA to see the file on the disk, perhaps manually change it ~
As a result, mount failure ... structure needs clean.

Hey. Are you doing this on purpose?
OK, turn over the material, say is XFS file system has metadata damage, need repair, line, I repair:

XFS_REPAIR/DEV/SDA
>log ..... What the hell, anyway, log has a problem; According to the data, add-l parameter

xfs_repair-l/dev/sda
>success. There are 7 stages, no problem. OK, hang the disc, back into rescue mode, chroot

chroot/mnt/sysimage
grub2-install--boot-directory=/boot/dev/sda
sync
Reboot

Restart, enter the system, a complete summary

Do not panic, look at the previous cases: their own problems, unless very special, generally other people will encounter.

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.