GRUB+Windows: How do I restore the ability to select at boot? [duplicate]

This question has already been answered here: How to restore GRUB? (2 responses) Closed 5 years back.

Good people help me!

The bottom line is that the screw is divided into two parts: one is Windows, the second is CentOS, or rather it was until today. Today I had to forcibly reinstall Windows and of course the choice of OS was lost when loading, because Windows erased the centos and by default, Windows automatically loads. Question: how to restore the selection option at boot.

Thank you in advance.

P.S was XP, now seven is installed. Where and what you need edit?

Author: aleksandr barakin, 2012-01-16

7 answers

The universal recovery scheme is approximately as follows:

  1. Booting from a livecd of the same architecture
  2. Manually mount root in some directory, for example in /mnt

    # mount /dev/sda1 /mnt
  3. If /boot is on a separate partition, then mount it in /mnt / boot

    # mount /dev/sda2 /mnt/boot
  4. Bind the /dev and /proc file systems to the corresponding directory in /mnt

    # mount --bind /proc /mnt/proc# mount --rbind /dev /mnt/dev
  5. Making a chroot

    # chroot /mnt /bin/bash
  6. Now you can restore it grub

    # grub-install /dev/sdaInstallation finished. No error reported.

If windows was not in the list, then before doing grub-install, you need to add the corresponding entry to /boot/grub/menu. lst.

title Windows 7 rootnoverify (hd0,3)makeactivechainloader +1
 2
Author: Ilya Pirogov, 2012-01-18 07:53:22

Maybe not a very kosher option, but try Acronis OS Selector - also an OS loader, like Grub. It is installed from under windows, and searches for installed OSS on all partitions.

 1
Author: sergarcada, 2012-01-17 05:01:09

Apt-get install grub

 1
Author: luk4196, 2012-01-17 10:32:13

If the folder with grub is visible, then you need to separate about 200 MB and, for example, install grub from live usb, then you need to make this section bootable in the menu file, specify where the Windows is loaded from.

Grub setup command vrodeb. here by the way is a more pleasant guide in English really http://www.linuxselfhelp.com/gnu/grub/html_chapter/grub_3.html

 1
Author: e_klimin, 2012-01-17 13:13:35

Hmm, maybe a little off topic, but I decided for myself in favor of the Windows bootloader plus GRUB4DOS and forgot about all the problems. In the MBR, I have a Windows bootloader, which loads the grub, and that in turn is ArchLinux. Everything is easy, simple and the head does not hurt when reinstalling Windows.

 1
Author: ruff, 2012-10-06 15:42:35

By the way, yes, if there is a Windows on a computer with other OSS, which, in the future, it is planned to reinstall at least once, then it makes sense to immediately use not GRUB, but the Windows loader.

 1
Author: Pavlus, 2012-10-08 13:54:28
/sbin/grub-install <location>

Where - where to install the GRUB Stage 1 boo loader. For example, to install GRUB on the MBR of the master IDE device on the first IDE controller, the command would look like:

/sbin/grub-install /dev/hda

Centos will find the windows itself and generate a bootable one. menu. If it is crooked, then find and edit the menu config in the /boot directory

 -1
Author: Бёрни, 2012-01-18 08:35:54