0

Please excuse me if this sounds stupid, I am very new to Linux and just trying to learn.

I installed Ubuntu 18.04 and updated the Boot Configuration Data through the Admin command line of Windows 10 hoping for a dual boot. The first time I rebooted my laptop right after BCDEdit, it showed the grub screen and took me to Ubuntu. But since that one time, the system always boots with Windows 10 without showing the grub screen.

I tried the bcdedit command to set the path again but it gives this output: The element data type specified is not recognized, or does not apply to the specified entry.

The command I used was:

bcdedit /set {bootmgr} path\EFI\ubuntu\grubx64.efi

Edit: So I tried changing the boot order with the following commands:

bcdedit /set "{bootmgr}" path \EFI\ubuntu\shimx64.efi

bcdedit /set "{bootmgr}" description "ubuntu"

Now my boot order is: 1)Ubuntu(P1...) 2)Windows manager 3)UEFI SanDisk (this is the path to Ubuntu that I had added previously) 4)P1: HL-DT-ST... 5)P0: ST1000LM...

And yet the system boots directly with Windows. I am working on Asus A555L.

  • What make/model is your computer? Go into your BIOS. Under the 'Boot' tab what is shown as first in boot order? – Paul Benson Jun 24 '18 at 12:57
  • Am working on Asus A555L laptop. The boot option priorities are:1) windows boot manager 2) windows boot manager 3) UEFI: SanDisk (this is Ubuntu) 4) P1: HL-DT-ST DVDRam 5) P0: ST1000LM024 HN... – Voyno Jun 24 '18 at 13:34
0

Well there's part of your problem. There was no boot entry in your BIOS showing for Ubuntu. You should not need to touch Windows BCD config, as it will inevitably mess things up with a dual-boot. Just because you've now forced that as a description doesn't mean GRUB is correctly configured. Sometimes BIOS just shows the GRUB boot-disk as the disk id instead of Ubuntu.

In order to correctly configure GRUB there are a few methods available, so I'll recommend the easiest one that usually works (but not always). First make sure Secure Boot and Fast Boot are disabled in BIOS/UEFI.

Boot up into Live Ubuntu from your UFD. Open the Terminal (R. Click Desktop). Download and install this repository with: s:sudo add-apt-repository ppa:yannubuntu/boot-repair, then sudo apt-get update, then run: sudo apt-get install boot-repair, then boot-repair and follow instructions. The process may take several minutes but at the end you should see a message whether boot-repair was successful or not. If good, restart your computer and report back.

  • Thank you very much! I am finally getting a GRUB screen. – Voyno Jun 27 '18 at 12:44
  • You're welcome. They're probably a number of extraneous entries in your grub menu now which can easily be removed. If you want to get rid of them, let me know. – Paul Benson Jun 27 '18 at 15:28
  • True, other than Ubuntu, advanced options for Ubuntu, windows boot manager and system setup there's 4 other options. How do I clean this up? – Voyno Jun 28 '18 at 9:25
0

OK. If you boot into grub you'll see a number of options for Windows. All you need is one that boots you directly into W10.There should be 2 or 3 that do that, one of them called Windows Boot Manager. Try it out a few times to ensure that it does that without an issue. If so we'll keep that entry and delete all the other Windows and EFI options.

Next, back-up the grub.cfg file - sudo cp /boot/grub/grub.cfg /boot/grub/grub2.cfg, then go into File Manager and check that grub2.cfg exists. You can always restore your grub from that file if you mess up the original. From File Manager, open (with gedit) grub.cfg. This is open in ro mode and is just a dry run. From the gedit menu select Search --> Find. Enter in the Search Box menuentry 'Windows Boot Manager. You should now see this entry highlighted in gedit. The lines of code start with menuentry and end with a closed curly bracket as does every menu entry. Note where this Windows entry is in the file, as it's the one you will keep. Also note all the menu entries above for Windows and EFI. These will all be deleted. Do not delete any of the Ubuntu menu entries. When you are happy about what you will be deleting close grub.cfg file.

Open Terminal (r. click Desktop). then run sudo gedit /boot/grub/grub.cfg. You are now in rw mode so be careful. Delete all entries I suggested in previous paragraph. If you like you can also change the Windows Boot Manager description between the single quotes to Windows 10, then Save. Close Terminal and Restart. You should now just see grub entries for Ubuntu, Advanced options, Windows 10 and System Set Up. If all is correct and working, backup your grub.cfg file again to grub2.cfg.

  • I just switched on my laptop to do the above, but instead of grub menu showing, the laptop booted to Ubuntu directly. The screen keeps flickering. On trying to boot-repair again as you suggested in the previous answer, it just gives the message that an error occurred during boot repair. It was working fine till yesterday. Is there anything I can do? – Voyno Jun 29 '18 at 12:59
  • Strange! Sounds like you may have deleted more than the suggested Windows entries. Hopefully you backed up your grub.cfg exactly as I suggested in my 2nd para. before you did anything to that file. If you did, let laptop boot into Ubuntu then find it and copy it back to grub.cfg, eg run the following: sudo cp /boot/grub/grub2.cfg /boot/grub/grub.cfg. Then restart. – Paul Benson Jun 29 '18 at 16:14

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

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