Linux boot failure handling-Beginner

Source: Internet
Author: User

    1. MBR (boot grub) lost (dd If=/dev/zero OF=/DEV/SDA bs=446 count=1) Erase MBR

      1) Enter rescue mode

      2) Chroot/mnt/sysimage put the real root on the hook

      3) Start repairing grub and loading grub onto the hard drive. Grub2-install/dev/sda

      After the installation is complete, 2 exit will be restarted automatically.


DD IF=/DEV/SDA of=mbr bs=512 count=1 #备份MBR

DD IF=MBR OF=/DEV/SDA #恢复MBR


2. The bootloader configuration file is missing (/boot/grub2/grub.cfg)

Grub> set root=hd0,msdos1 grub> linux16/boot/vmlinuz-###### root=/dev/sda1 ro grub> initrd16/boot/initramf s-####### grub> Boot
# grub2-mkconfig >/boot/grub2/grub.cfg #用此命令生成新的引导配置文件

Over


3. Kernel and driver lost

In rescue mode, forcing the kernel to be reinstalled.


4. Root password is missing

1) On the Boot Menu page, press E to find linux16, remove the parameters from the RO, and add rd.break

2) Ctrl-x continue to start and then be interrupted

3) At this time the real root of the system is hung in a read-only manner under the/sysroot

4) Mount-o remount,rw/sysroot/re-mount as writable

5) chroot/sysroot/to hang the real roots back.

6) passwd command to change password

7) Touch/.autorelabel #打标签

Sync #硬盘同步

2 exit system will continue to start

Over

Linux boot failure handling-Beginner

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.