How to fix Grub boot

  
under Ubuntu

Due to the installation of windows system, Grub has problems, many people will choose to reinstall Ubuntu system, in fact, it is completely unnecessary, as long as the Grub can be repaired, the following small series will give you Brought to use the Ubuntu Live CD to fix the Grub boot method, let's learn together.

In this paper, Ubuntu Live CD to repair Grub boot, for example, Fedora has been installed in the /dev /sda3.

First make Ubuntu boot USB

Copy the code as follows:

sudo dd if=ubuntu-13.10-desktop-amd64.iso of=/dev/sdb #/dev /sdb is the USB drive letter

1. Use the boot USB to enter the Ubuntu trial environment

2. Check the hard disk partition status and obtain the Linux system installation partition number

The code is as follows: Br>

sudo fdisk -l

View the output and determine which hard disk and installed partition the Linux system is installed based on the file type and partition size. My computer is installed with Fedora on /dev/sda3.

Alternatively, open the Gparted graphical tool to view partition information.

Mounting Fedora Installation Partitions

3. Fedora is installed on /dev/sda3, so we can mount the Fedora installation partition with the following command. You need to replace /dev/sda3 with your own Linux installation partition.

The code is as follows:

sudo mount /dev/sda3 /mnt

4. Mount other required directories (using --bind)

The code is as follows:

sudo mount --bind /dev /mnt/dev

sudo mount --bind /proc /mnt/proc

sudo mount --bind /sys /mnt/sys

5.Chroot to the Linux system on the hard disk

The code is as follows:

sudo chroot /mnt

6.Install & update Grub

The code is as follows:

grub2-install /dev/sda

grub2-mkconfig -o /boot/grub2/grub.cfg

7. Grub has been fixed successfully. We also need to exit the chroot environment and uninstall the mounted devices and directories:

The code is as follows:

exit #Exit chroot environment

sudo umount /Mnt/dev

sudo umount /mnt/proc

sudo umount /mnt/sys

sudo umount /mnt

8. Restart!

The above is the way to use the Ubuntu LiveCD to repair grub. If you have a Grub boot error in the dual system installation windows, you can use this method to fix it.

Copyright © Windows knowledge All Rights Reserved