How to fix GRUB boot in Linux system

  

GRUB is the default bootloader for most Linux systems. You can choose to enter different operating systems (if any) by launching the menu. When the <quo;/boot/grub/grub.conf” configuration file is missing, or the critical configuration is incorrect, or the bootloader in the MBR record is corrupted, the Linux host may only prompt the “grub>” A further system startup process cannot be completed. As shown in FIG:

Method 1: In & ldquo; grub & gt; & rdquo; environment manual input command to start the boot Linux system

grub & gt; root (hd0,0) //Specify the operating system name displayed in the boot menu

grub>kernel /vmlinuz-2.6.18-128.el5 ro root=LABEL=/rhgb quiet //Specify the location of the kernel file, kernel load permissions For read-only <;ro”, and specify the location of the root partition device file by <;root=”. (Note: it is best to use the Tab key after vm)

grub>initrd /initrd-2.6.18-128.el5.img //Specify the location of the temporary system image file used to start the kernel. (Note: It is best to use the Tab key after the initrd)

grub>boot //Start the Linux system

Method 2: Put the system CD into the emergency mode

CD-ROM drive, restart the Linux system. Press the ““F2” button at the system startup, and at the “boot:” prompt”, type “linux rescue” and then “Enter”, enter the “First Aid Mode” and boot the Linux system on the CD. Then press the Enter key in turn to receive the default language, keyboard format, prompt whether to configure the network card is generally select "NO", and then the system will automatically find the Linux partition on the hard disk and try to mount it to “ /mnt /sysimage & rdquo; Directory (choose “Continue” confirm and continue). Next, you need to pay special attention: When there is a warning window for initializing the disk, be sure to select “NO” to avoid further damage to the hard disk data. Finally, select “OK” to confirm and enter the Bash Shell environment with the “sh-3.1#” prompt.

1. If the MBR sector bootloader is not corrupted, confirm the mount of the Linux system partition to be repaired and rebuild the grub.conf file. The command is as follows:

shsh-3.1#chroot /mnt/sysimage //Switch to the root environment of the Linux system to be repaired

shsh-3.1#mount

shsh-3.1# Vi /boot/grub/grub.conf //Rebuild the grub.conf file, the following content is for reference only

shsh-3.1#exit //Exit the chroot environment

shsh-3.1#exit //Exit the shsh-3.1 environment, the system will automatically restart

2. If the MBR sector bootloader is damaged, the system will not boot even after rebuilding the grub.conf configuration file. At this point, you can reinstall grub in the shell environment of the emergency mode. The command is as follows:

shsh-3.1#chroot /mnt/sysimage //Switch to the root environment of the Linux system to be repaired

shsh-3.1#grub-install /dev/hda //Reload Grub

shsh-3.1#exit //Exit chroot environment

shsh-3.1#exit //Exit shsh-3.1 environment, the system will restart automatically

Copyright © Windows knowledge All Rights Reserved