Simulation experiment of Linux emergency rescue mode
Rescue mode: Emergency rescue mode
Start a Linux system on the CD, which detects the local hard disk device during startup and looks for the original root file system to complete some repairs with this system
This system has its own rootfs, but the function is simple, if you can find the original root file system on the hard disk, you can use chroot to switch to this rootfs, complete the follow-up repair;
Experiment One
Fix grub (boot loader broken)
To destroy GRUB under the system:
DD If=/dev/zdro OF=/DEV/SDA bs=200 count=1 (note that the size must not be greater than 446, otherwise the partition table will be erased)
Enter rescue mode, Chroot/mnt/sysimage
Process slightly
To install Grub:
GRUB-INSTALL/DEV/SDA already chroot,--boot-directory=/mnt/sysimage/boot can omit
Experiment Two
Fix BASH,MV/BIN/BASH/TPM simulation bash broken down
Enter rescue
Method One:
Do not chroot to/mnt/sysimage under the file system directly with rescue mode
#mount/dev/cdrom/mnt/cdrom (directory does not exist and can be created by itself)
#rpm-IVH--replacepkgs/mnt/cdrom/packages/bash-4.1.2-33.el6.x86_64.rpm--root=/mnt/sysimage/
Method Two:
Chroot to/mnt/sysimage, with/BIN/TCSH
#chroot/mnt/sysimage/bin/tcsh
#mount/dev/cdrom/mnt
#rpm-IVH--replacepks/mnt/packages/bash-4.1.2-33.el6.x86_64.rpm
Linux Emergency Rescue Experiment