0

I installed Elementary OS next to Windows 10 on a separate partition. After starting in the bootloader menu - Grub - I can choose both Elementary OS and Windows. Linux starts correctly, but selecting windows returns the same menu, the situation is looped.

I came up with the idea to overwrite Grub with Windows bootloader using the Windows 10 installation CD, I found the following articles about this procedure:

https://www.howtogeek.com/howto/32523/how-to-manually-repair-windows-7-boot-loader-problems/ https://www.howtogeek.com/141818/how-to-uninstall-a-linux-dual-boot-system-from-your-computer/ https://askubuntu.com/questions/133533/how-to-remove-ubuntu-and-put-windows-back-on

This is a photo of Grub: https://1drv.ms/u/s!Ari0rc2rwPVYsBbdiTExfq4nm772?e=kS3OaC

What way of recovering Windows do you recommend, does my method seem good, do you recommend any materials or advice about the process?

0

Linux starts correctly, but selecting windows returns the same menu, the situation is looped.

There are many questions similar, so i am not writing about this here.

I came up with the idea to overwrite Grub with Windows bootloader using the Windows 10 installation CD, I found the following articles about this procedure:

I recommend you to follow these steps !! Have tried it myself !!


How to use windows bootloader to boot linux


Few points

Assuming BIOS + MBR

Written for Ubuntu but will apply for all distros


In short what are we going to do

This will involve copying the boot record of our Ubuntu partition to Windows, and using BCDEdit to create a new entry in the BCD store that will point to that file. This way Windows will display a menu at boot time that will give you a choice between Windows and Ubuntu.


Assuming drive partitioned as (modify for your case accordingly)

/dev/sda1 - 100 MB - Win Reserved

/dev/sda2 - 252 GB - Win (c: drive)

/dev/sda3 - 31000 MB - Ubuntu {mount point - /}

/dev/sda5 - 1000 MB - swap {logical}

/dev/sda6 - optionally created to move the generated .bin file from linux to windows - FAT32 file system - {mount point - /media/share}


Skipping the install part before selecting drives as it is preference based.


The critical step {during installation} is : We need to tell the Ubuntu installer where to install the system bootloader (GRUB 2). We DO NOT want to install the bootloader on /dev/sda, as that would overwrite our disk’s master boot record, nor do we want to install it on /dev/sda1 or /dev/sda2, as that would overwrite the Windows bootmanager files and boot configuration data, or the operating system itself. Instead, let’s have Ubuntu install its bootloader on the partition that will contain the Ubuntu operating system – in our case /dev/sda3. To do this, click on the drop down list under

“Device for boot loader installation”

and select

/dev/sda3

.

Screenshot showing the correct partition for the ubuntu bootloader installation


Select “Install Now” and Ubuntu will begin the installation. When it completes you’ll be asked whether you’d like to reboot or “continue testing”. You should select continue testing as the following steps require access to a terminal. Note : it is important not to reboot now otherwise this methods will not work

Configure Ubuntu for Dual Boot

Now that we have our disk partitioned and Ubuntu installed, let’s set up our system to boot Windows or Ubuntu.


We need a way to move the generated boot record file to windows. It can be achieved in numerous ways using ntfs drives/USB or EXT4 drivers in win. Since i created at fat32 partition i will use it here !! Use any other way if you like !!


First, let’s make a mount point for the FAT32 partition we created {as already pointed out it optional. Open a terminal and enter the following:

sudo su

mkdir /mnt/share 

Next, let’s mount the correct device to this directory. Recall from the partitioning steps above that the FAT32 partition is located at device /dev/sda6:

mount /dev/sda6 /mnt/share 

Generating the boot record .bin file

Write the first 512 bytes of our Ubuntu partition to a file and copy that file to our FAT32 partition:

dd if=/dev/sda3 of=/mnt/share/ubuntu.bin bs=512 count=1

Note: using the FAT32 partition in the aforementioned steps is optional. You may chose to use another device such as a USB drive to copy the *.bin file to.

Exit out of the Ubuntu live system and reboot to Windows. Along the way, you may see Windows perform a disk check (don’t worry, that’s normal, and should only occur once as a result of these procedures). Log into Windows and open the FAT32 volume you created and you should see the ubuntu.bin file. Copy that file to the root of the Windows volume (e.g., C:).

Configure Windows for Dual Boot

Now we’ll use BCDEdit to add an entry to Windows’s BCD store. Administrative privileges are required to use BCDEdit, so use Win+r, type cmd, and then press

CTRL+SHIFT+ENTER

. Let’s start by creating an entry for our Linux distribution. Note here that you are free to choose another entry name if desired:

bcdedit /create /d “Ubuntu” /application bootsector

BCDEdit will return an alphanumeric identifier for this entry that I will refer to as {ID} in the remaining steps. You’ll need to replace {ID} by the actual returned identifier. An example of {ID} is {d7294d4e-9837-11de-99ac-f3f3a79e3e93}. Next, let’s specify which partition hosts a copy of the linux.bin file:

bcdedit /set {ID} device partition=c:

The path to our ubuntu.bin file:

bcdedit /set {ID}  path \ubuntu.bin

An entry to the displayed menu at boot time:

bcdedit /displayorder {ID} /addlast

and finally, let’s specify how long the menu choices will be displayed:

bcdedit /timeout 30

That’s it! Now reboot and you will be presented with menu where you can choose to boot to Windows or Ubuntu. When you choose Ubuntu, you’ll be taken to the it bootloader menu where you can choose to continue booting Ubuntu.

On a final note, if at any time you want to eliminate the Ubuntu menu option simply delete the BCD store entry you created using the following command:

bcdedit /delete {ID}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.