System failure and its recovery

Source: Internet
Author: User
I. System start-up

1. System Startup process

Power-on------->bios (read-only storage on motherboard) function, hardware detection, activation hardware)

Grub System boot (grub boot divided into two stages)

1) Stage 1 MBR (Master boot record) master boot record on hard disk track, one sector, 446 bytes

2) Phase 2 Grub File boot phase

By the file/boot/grub2/grub.cfg control process, specify the/boot partition location-load the kernel-and start the system initialization process-->grub2-mkconfig

2. Kernel Boot phase

Detect hardware devices--device driver initialization---load/read-only mount initialization process systemd--> kernel file is missing please reinstall kernel

3.SYSTEMD initialization

Enable SELinux and systemd-tools--> load kernel parameters-load system clock, keyboard, host name--read/write mount/File system--Activate RAID,LVM device--activate system quota-- Start all service scripts in Multi-user.target.wants--Enable Virtual Console--start graphics
Two. System startup error Recovery

1./boot/gurb Error in Boot program

Destroy/dev/vda First 446 bytes boot: dd if=/dev/zero if=/dev/vda bs=446 count=1 (boot partition where mount is destroyed)



SELinux kernel-level enhanced firewall

Boot not bootable program

Turn off the virtual machine, add the ISO image disc, boot from the CD drive

Troubleshooting #系统修复

Rescue a Res Hat Enterprise Linux system #选择挽救模式 (second item of menu)

1. Continuation 2. Read-only 3 Skip Select first item


Chroot/mnt/sysimage

GRUB2-INSTALL/DEV/SDA #根据实际boot分区挂载

Execute two exit exit from hard drive, restore success

2. boot file/boot/grub2/grub.cfg missing


When the system does not restart
Grub > Set root= ' hd0,msdos1 ' position is not fixed, specify/boot partition
Grub > linux16/boot/vmlinuz-3.10.0-123.e17.x86_64 ro root=/dev/vda1 The device name of the root partition
Grub > Initrd16/boot/initramfs-3 .... tab-Padded
Grub > Boot


Note: You can allow the system to start normally, but temporarily, you will need to do the following:

Grub2-mkconfig >/boot/grub2/grub.cfg

3. Kernel loss

Simulation Problem rm-rf/boot/vmlinuz-3.10 ..... .....

.

Go to rescue mode



Go to rescue mode

Chroot/mnt/sysimage to mount the root partition on the hard disk

MKDIR/RHEL7 Establishment Directory

MOUNT/DEV/SR0/RHEL7 Mount the disc

Cd/rhel7/packages into the Packages of the disc

CP kernel-3.10.0-123.e17 .../mnt copy the kernel to MNT

Cd/mnt into the MNT

Rpm2cpio kernel-3.10 ... rpm |cpio-id compress kernel using cpio format and unzip

CD boot into the boot directory of the split build

Copy the missing kernel files back

CP vmlinuz-3.10 ..../boot

Exit two times



4) when the/boot partition is deleted



1 "Recover Corrupted boot boot bootloader


2> Recovering the kernel


3> Restore Initialization files


4> Restore boot file/boot/grub2/grub.cfg, you only need to execute Grub2-mkconfig >/boot/grub2/grub.cfg at this time


5) Loss of initialization file

Initramfs-3.10.0-123.el7.x86_64.img #初始化文件


Enter Rescue mode

Chroot/mnt/sysimage

mkinitrd/boot/initramfs-$ (UNAME-R). IMG $ (UNAME-R)

Execute two exit, boot success from hard drive


6. Flash Back

Boot from CD into rescue mode

Chroot/mnt/sysimage

Cp/bin/bash/mnt/sysimage/bin/bash

Exit exits

Note: In case of system startup error recovery, except the boot file/boot/grub2/grub.cfg loss does not require the CD boot into the rescue mode, all other situations need to boot from the CD into the rescue mode

################################ #附录 ####################################

The boot is tampered with.

Error formation

Systemctl Set-default Reboot.target


Solution Solution
Press the up and down keys in the power on option to stop reading seconds
Press E to enter edit mode
Select Kernel Boot Line
Linux16/vmlinuz-xxxxxxxxxx ro xxxxxxxxxxxxxx changed to:

Inux16/vmlinuz-xxxxxxxxxxx RW Rd.break


CTRL +X
Chroot/sysroot
Rm-rf/etc/systemd/system/default.target
Ln-s/lib/systemd/system/graphical.target/etc/systemd/system/default.target
Exit


Forgot root password


Press the up and down keys in the power on option to stop reading seconds

Press E to enter edit mode


Select Kernel Boot Line

Linux16/vmlinuz-xxxxxxxxxx ro xxxxxxxxxxxxxx changed to:


Linux16/vmlinuz-xxxxxxxxxxx RW Rd.break

chroot/sysroot/


Touch/.autorelabel













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.