Linux System Recovery

Source: Internet
Author: User

Experimental Purpose: familiar with the previous start-up process, the system of a general start-up process is how, and it involves a few files, these files are used to connect the steps when the system starts, if the files are damaged or missing, the system will not start normally, The content of this writing is how to fix the files when they are damaged or missing.


Lab Environment: CentOS 6.8


Experimental steps:

1) How to fix grub when stage 1 and stage 1.5 are damaged

(1) Because there is no MBR, the system will go directly into the rescue mode after the selection interface, choose to enter the rescue mode

(2) After entering on rescue mode, DF View hangs in the case and uses chroot to toggle the real root filesystem

(3) Use GRUB-INSTALL/DEV/SDA (/DEV/SDA is the hard disk on which the MBR resides)

(4) Restart after exit

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/4A/wKioL1fbe5vjBuQLAAENBg_FerY335.png "title=" 2016-09-13_150753.png "alt=" Wkiol1fbe5vjbuqlaaenbg_fery335.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/4A/wKioL1fbf3qzTh8HAAZ2d_0wMrU024.png "style=" float: none; "title=" boot directly into rescue mode. png "alt=" Wkiol1fbf3qzth8haaz2d_0wmru024.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/87/4C/wKiom1fbf3vC_CgNAAAWzAz9Vk4261.png "style=" float: none; "title=" 2016-09-12_202009.png "alt=" Wkiom1fbf3vc_cgnaaawzaz9vk4261.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/87/4A/wKioL1fbf3uCOOYOAAAfTt1WTWQ661.png "style=" float: none; "title=" Reboot.png "alt=" Wkiol1fbf3ucooyoaaaftt1wtwq661.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/87/4A/wKioL1fbf3uSp39YAABYEjnhNhc028.png "style=" float: none; "title=" fix. png "alt=" Wkiol1fbf3usp39yaabyejnhnhc028.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M00/87/4C/wKiom1fbf33iGrCvAALvz2oY9sA574.png "style=" float: none; "title=" Success.png "alt=" Wkiom1fbf33igrcvaalvz2oy9sa574.png "/>


2) Delete the grub.conf file

(1) There is no grub.conf file, that is, there is no way to load the kernel and rootfs driver files

(2) After the boot will go directly to the grub interface, according to the contents of grub in the kernel file and the Ramfs file path input, the system will be based on the path you entered to find relevant files

(3) After start-up need to write a copy or copy a copy of Grub.conf, because previously written only temporary search path, and did not write to the file inside, if not write, the next boot to enter the Grub interface

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/4A/wKioL1fbgseB9RGlAAIJOL6fY6A746.png "style=" float: none; "title=" Delete grub.conf.png "alt=" Wkiol1fbgseb9rglaaijol6fy6a746.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/87/4C/wKiom1fbgsfgrtORAAAYhRVw_4M501.png "style=" float: none; "title=" Error interface. png "alt=" Wkiom1fbgsfgrtoraaayhrvw_4m501.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M02/87/4A/wKioL1fbgsexLjAuAAAv5peCMNo963.png "style=" float: none; "title=" grub fix. png "alt=" Wkiol1fbgsexljauaaav5pecmno963.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/4C/wKiom1fbgsmTziGYAAMEvt0Eq-E236.png "style=" float: none; "title=" Succes.png "alt=" Wkiom1fbgsmtzigyaamevt0eq-e236.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/87/4A/wKioL1fbgsmT5KJQAAGo_daagPM917.png "style=" float: none; "title=" creates Grub.conf.png "alt=" Wkiol1fbgsmt5kjqaago_daagpm917.png "/>

3) Delete the boot directory (which contains stage2 and grub and kernel-related files)

(1) boot will appear error15 error interface, (because the Stage2 file is missing)

(2) reboot into rescue mode and switch to real rootfs

(3) Mount the local CD-ROM and install the kernel package using the RPM command (it will alert aleady installed, add--force option or--replacepkgs option)

(4) GRUB-INSTALL/DEV/SDA (/DEV/SDA is the disk on which boot is located), the Grub directory under/boot is created, but there is no grub.conf file

(5) Writing grub.conf files

(6) Restart after installation is complete

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/87/4A/wKioL1fbjSCiKypTAAIF-Q0vEsY951.png "style=" float: none; "title=" 2016-09-12_210808.png "alt=" Wkiol1fbjscikyptaaif-q0vesy951.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/87/4A/wKioL1fbjSDzV3NxAAAN8shU7OM859.png "style=" float: none; "title=" Error interface. png "alt=" Wkiol1fbjsdzv3nxaaan8shu7om859.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/87/4D/wKiom1fbjSGBGE5RAABS68LiCdU903.png "style=" float: none; "Title=" Installs Kernel.png "alt=" Wkiom1fbjsgbge5raabs68licdu903.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/87/4D/wKiom1fbjSLjLCCzAAAmbDjR4yc950.png "style=" float: none; "title=" Grubinstall.png "alt=" Wkiom1fbjsljlcczaaambdjr4yc950.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/87/4A/wKioL1fbjSOB_fPnAAAXfcgCH8Y818.png "style=" float: none; "Title=" creates a grub.conf file. png "alt=" Wkiol1fbjsob_fpnaaaxfcgch8y818.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/4D/wKiom1fbjSSQlXj9AAAe_x4vSXk330.png "style=" float: none; "title=" Reboot.png "alt=" Wkiom1fbjssqlxj9aaae_x4vsxk330.png "/>

4) Delete the/etc/fstab file and delete the/boot directory

(1) because there is no/etc/fstab, after entering rescue mode and the root directory is not mounted.

(2) Mount the root directory, and then go to the real root, write the/etc/fstab file, you need to write the/boot partition and//partition on (Mount/F partition, if you remember the original/partition, directly hanging up can, if not remember, need to try each)

(3) After the completion of the restart, and then again into the rescue mode, if you/etc/fstab file is written correctly, then mounted on the back of the operation and the above 31 samples.

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/87/4A/wKioL1fbkGbRdQAIAAEgZVqj3Mc071.png "style=" float: none; "Title=" delete the. png "alt=" Wkiol1fbkgbrdqaiaaegzvqj3mc071.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/4D/wKiom1fbkGaiOasGAAAOZLbzhhc401.png "style=" float: none; "title=" Error interface. png "alt=" Wkiom1fbkgaioasgaaaozlbzhhc401.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/4D/wKiom1fbkGbRu3SYAAADor_0ENQ577.png "style=" float: none; "Title=" mounts the root. png "alt=" Wkiom1fbkgbru3syaaador_0enq577.png "/>

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/87/4A/wKioL1fbkGaypK-AAAAEFpkrT3I950.png "style=" float: none; "title=" switch to etc under. png "alt=" Wkiol1fbkgaypk-aaaaefpkrt3i950.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/4D/wKiom1fbkGehKMxZAAAWLMpIzsg229.png "style=" float: none; "title=" Edit Fstab.png "alt=" Wkiom1fbkgehkmxzaaawlmpizsg229.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/4A/wKioL1fbkGeybtyZAAAbOgE-8Nw219.png "style=" float: none; "Title=" re-enter the rescue. png "alt=" Wkiol1fbkgeybtyzaaaboge-8nw219.png "/>

Note: If partitions are partitioned in LVM partitioning, and/or directories/usr and/var directories are partitioned separately, the first time you enter rescue mode, you need to activate the VG first, then mount it, and write the/etc/ Fstab files need to write these separate partitions all on, exit and then into the rescue mode, the following steps and above are the same.

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M01/87/4A/wKioL1fbkdTAaZBVAAAxCINGqVo129.png "style=" float: none; "title=" Lvscan.png "alt=" Wkiol1fbkdtaazbvaaaxcingqvo129.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/87/4D/wKiom1fbkdSABEOWAAAnTFShO3o026.png "style=" float: none; "title=" Vgchange.png "alt=" Wkiom1fbkdsabeowaaantfsho3o026.png "/>

650) this.width=650; "src=" Http://s1.51cto.com/wyfs02/M02/87/4A/wKioL1fbkdSxT67yAAAMF43ha6Q877.png "style=" float: none; "title=" Fstab.png "alt=" Wkiol1fbkdsxt67yaaamf43ha6q877.png "/>

Thanks for browsing.

This article is from the "Endless Learning" blog, please be sure to keep this source http://dashui.blog.51cto.com/11254923/1853105

Linux System Recovery

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.