Home / the Internet / OS / How to put grub

How to put grub

/
163 Views

How to put grub</a>

When installing multiple systems on a computer, there is a problem with managing the boot sector of the hard disk.

For example, if the computer was firstInstalled Linux OS, and only then was Windows installed, then the OS from Microsoft will erase the GRUB boot loader and when the computer starts it will be impossible to select the system, and by default Windows will boot.

You will need

  • - Any Linux LiveCD.

Instructions

    1

To restore the Grub bootloader, you will need a LiveCD or a boot disk from Linux. A Ubuntu drive that is both a "live" and an installation disc at the same time is best suited.

    2

Boot from the LiveCD. After the system has been booted, start the Terminal ("Menu" - "Applications" - "Default apps" - "Terminal") and enter the command:
Sudo grub.
Sudo allows you to get the superuser rightsTo execute this command, and the grub request starts the shell. Thus, you will find yourself in the bootloader shell and a corresponding prompt will appear - grub & gt-.

    3

Then type the following command:
Find / boot / grub / stage1.
This query returns the value of the location where theLoader (for example, hd0,1 or hd0,6). In the MBR boot sector, only a small amount of grub information is located, and with find you find all the files needed for installation.

    4

Enter the number of the received section in the following query:
Root (hdValue, value).

    5

Then install the files in the boot partition of the hard drive:
Setup (hd0).
This request installs the bootloader on the hard disk, and since the second parameter is missing, the installation is performed directly on the MBR.

    6

Then exit the grub shell:
Quit.

    7

There is a second way to solve the problem. Boot from the Live CD and mount your hard drive in the most convenient folder. For example:
Mount / dev / hda / media / hard.

    8

After that, execute the request through the Terminal:
Sudo grub-install / dev / hda -recheck -root-directory = / media / hard.
The recheck option is used to check the correctness of the installed /boot/grub/device.map file, and in case of an error the command corrects it.

    9

Extract the LiveCD, reboot the computer, and you will be able to boot into your installed system again.

How to put grub Was last modified: June 20th, 2017 By Suumeusx
It is main inner container footer text