I'm new to Elementary.

Initially I had Ubuntu 14.04 LTS along with Windows 10. I wanted to remove Ubuntu and install Elementary OS. So, my friend ran sudo rm -rf / --no-preserve-root and then it started removing a lot of things. Suddenly it stopped showing progress (or that is what I felt), so I turned off the computer. When I tried booting it, it started checking for hardware malfunctions and it said "No hardware malfunctions, OS image might have been corrupted or USB boot is not setup in BIOS."(not exactly sure of the error message, it was somewhat like this). So, I tried to go the BIOS setup menu. Here, I restored the setting hoping this would allow me to boot to Windows. This attempt was unsuccessful.

Then I tried installing Elementary OS using a bootable USB. I was able to install on the partition containing Ubuntu by formatting it. After successful installation I rebooted and was directly led to Elementary (without any grub page). On mounting Windows partition I found all my files were intact (as far as my knowledge goes).

Then I noticed that line 7 in /etc/default/grub was GRUB_HIDDEN_TIMEOUT=0 rather than #GRUB_HIDDEN_TIMEOUT=0 (the one in my friends file). After commenting this line, updating grub and rebooting, the grub menus was back although there was no option to boot to Windows. The link to the image of this menus is has been posted as a comment below (since I can't post more than two links in the question due to lack of reputation)

Now, we checked the /boot/grub/grub.cfg. Here, there was a difference in line 270 onwards when compared to my friends file. These are shown below:

My file

My friends file

Now, as you can see, some lines are missing in my case. Also, line 254 in my friend's file has different numbers when compared to the corresponding line in my file, I decided not to copy the missing lines or change the file (as it also said in the beginning not to edit the file).

On googling, all the situations had the problem of not being able to boot into Linux rather than the other way round.

So, I'm posting this question here: Can you suggest any way to add the Windows boot loader option in the grub menus?

Thanks in advance.

  • This is the pic of the grub menus mentioned in the post.
    – Vignesh S
    Commented May 31, 2017 at 13:03

1 Answer 1


There's no way to repair the windows boot loader from linux and trying to code that is useless because the disk ID is something that is unique, believe me I tried hard.

You must do a windows pendrive to fix the bootloader(do it from another windows machine because linux doesn't handle fat32 too well), because you deleted ubuntu's grub, the disk ID for the windows partition lost, and then you overwrited that, putting elementary on it, so that's why linux can't detect your untouched windows partition.

What you can do is download the Windows 10 ISO and use the "repair option" that is in the first screen after booting up the usb key as you can see here :

windows 10 first screen

When entering the repair option, go to Troubleshoot -> Advanced options -> Command prompt and type this in the console to fix the bootloader.

bootrec /fixboot
bootrec /fixmbr
bootrec /rebuildbcd

with that done, you will be able to boot windows, but you deleted the grub menu so for fixing that launch the elementary os as live image and open a terminal SUPER + T and write this

sudo grub-install /dev/sda
sudo update-grub

the lsblk command is used for seeing the disk partitions, you must see the name of your disk, I'm assuming that your disk is called 'sda' with that done you will fix all your problems, good luck and google more

  • 1
    Hey Renato, I couldn't find a way to send PM, but I noticed you showing up and answering a lot of questions with great info. Glad to see someone around here doing that. Welcome to the Elementary OS forum! Props Renato, it is appreciated.
    – Eosdude
    Commented Jun 3, 2017 at 4:12
  • Thanks for the help, but I had a few doubts, by windows pendrive do you mean a bootable usb they contains the image or just the image downloaded in it (I thought it's the first one but just confirming it) also can you explain the procedure for launching elementary OS as live image. Thanks again.
    – Vignesh S
    Commented Jun 17, 2017 at 17:13
  • for making an elementary os pendrive and launching it as a live image elementary.io/en/docs/installation#installation and yes windows pendrive is putting the archived windows.iso file in the usb key, use tools like rufus for unzip the files properly Commented Jun 19, 2017 at 1:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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