CentOS 6 System Rescue mode
Linux学习笔记
王振中
M21
马克飞象
After learning about the CentOS 5, 6 system start-up process and troubleshooting, the following destructive attempts were made to deepen the impression.
try to repair the system after deleting the/boot directory and the/etc/fstab file
1. First step is to delete the/boot directory and/etc/fstab
Delete/boot/etc/fstab
You can see that although the boot directory cannot be deleted, the files in the directory have all been deleted.
2. Reboot because there is no/etc/fstab file and boot directory system is unable to boot, only through the CD-ROM boot into the system rescue mode
Select optical Drive Boot
Select rescue Mode
After choosing a language and keyboard select No repair does not require network
Select Continue
Partition was not found because the/etc/fstab file was deleted
Select shell start Shell to enter command line mode to start repair
3. Start the Repair
View the hard disk partitions and hang them separately in the search for and/boot partitions
Run Blkid View all block devices found/DEV/SDA1, 2, 3, 54 partitions where partition 5TYPE is swap can be taken. Talk sda1 2 3 respectively, you can see that sda2 is the root, and sda1 is the/boot partition.
A new Fstab file is written to mount information in the/etc/directory under the directory that is mounted on the SDA2 partition.
/dev/sda1 /boot ext4 defaults 0 0
/dev/sda2 /boot ext4 defaults 0 0
Re-enter rescue mode after saving.
After re-entering rescue mode, the system prompts you to find the root
Toggle Root and Mount CD-ROM ready to repair
Run Chroot/mnt/sysimage cutting root and mount the glazing drive to prepare for the next installation kernel
Force the kernel installation with the RPM command! [Alt Text
When installing the kernel, remember to use the –force option to force the installation
The kernel and init files are in the boot directory after installing the kernel successfully
Rewrite the/boot/grub/gurb.conf file
default=0
timeout=5
root (hd0,0)
kernel /vmlinuz-2.6.32-642.el6.x86_64 ro root=/dev/sda2
initrd /initramfs-2.6.32-642.el6.x86_64.img
4. System returns to normal after reboot
November 24, 2016 21:47:27
CentOS 6 System Rescue mode