0

I have a pretty complicated configuration. I'm trying to be synthetic :

I have 4 disks (1 ssd, 2 nvme and 1 HDD) and 4 OSs (3 Win10 and 1 ubuntu) :

  • Nvme 1 (Win10-1 + Ubuntu 20.04) /dev/nvme0n1
  • Nvme 2 (Win10-2) /dev/nvme1n1
  • HDD 1 (just data+swap) /dev/sda
  • SSD 1 (Win10-3) /dev/sdb

The computer is UEFI.

At the begining I had no problem. Grub showed my 4 boot options.

But I had to reinstall Win10-1 and then I completly lost my grub. So I was able to boot only on Win10-1 or Win10-2 via windows boot manager.

I tried to repair Grub booting on a live ubuntu, but with mitigated succes... Here the actual behaviour :


Boot 
|_______Grub
        |______*Ubuntu > boots Ubuntu
        |______*Windows Boot manager on /dev/nvme1n1
                |_______Windows Boot Manager GUI
                        |______*Win10-1 > boots Win10-1
                        |______*Win10-2
                                |_______Grub
                                        |______*Ubuntu > Grub rescue
                                        |______*Windows Boot manager on /dev/nvme1n1 > boots Win10-2

So its perfect mess to me and by the way I lost the ability to boot on Win10-3...

I don't know how to erase this messy boot config in the MBRs and roll back to this:

Boot 
|_______Grub
        |______*Ubuntu > boots Ubuntu
        |______*Windows Boot manager on /dev/nvme0n1 > boots Win10-1
        |______*Windows Boot manager on /dev/nvme1n1 > boots Win10-2
        |______*Windows Boot manager on /dev/sdb > boots Win10-3

Is there a magic tool to configure this?

Any help/advice will be apreciated.

---Edit 1--- Thanks for your answer WaterOfDark.

I already gone through this process but with no luck.

In addition, Win3 is not a big deal as I can boot it using EFI selection. I also have 3 EFI partition, on Nvme1, Nvme2 and SSD1

Maybe the issue is from those partitions? Maybe I can reset in some way the content of the EFI part and then run update-grub again?

I must admit that I'm not really at ease with the EFI stuff.

---Edit2---

I confirm Windows Fast Start up is disable

---Edit3---

Here are the result of commands : Here are the results

willy@Ubuntu:~$ sudo efibootmgr
BootCurrent: 0002
Timeout: 1 seconds
BootOrder: 0002,000A,0000,0008,0006,000B,0007
Boot0000* Windows Boot Manager
Boot0002* ubuntu
Boot0006* UEFI: SAMSUNG SSD 830 Series, Partition 2
Boot0007* UEFI: Sabrent Rocket 4.0 1TB, Partition 1
Boot0008* Windows Boot Manager
Boot000A* ubuntu
Boot000B* UEFI OS
willy@Ubuntu:~$ sudo dmidecode -t0 | grep -Ei "BIOS boot|UEFI"
        BIOS boot specification is supported
        UEFI is supported
2
  • A well known reason for trouble like this is Windows fast startup feature. If enabled, Windows doesn't shutdown fully but is hybernated. Even if disabled, an OS update may reenable it. Grub cannot handle hybernated Windows partitions. If you have to make any changes, you'll need to update your grub configuration afterwards.
    – mook765
    Dec 15, 2020 at 12:44
  • I always run boot-repair first thing. Dec 16, 2020 at 20:42

2 Answers 2

1

First of all thx everyone for pointing me out the right way, that gives me good clues. After lots of reading on the subject I have a better understanding of the subject.

Here is the detail of how I proceed :

From Ubuntu, using Gparted, I completely delete EFI partition on Nvme2 I format the one on Nvme1. (with the boot flag)

Then in a terminal : sudo gedit /etc/fstabto replace UID of the EFI partition. It changes arfter formating. The line should looks like this UUID=1A2B-3C4D /boot/efi vfat defaults 0 1, save fstab then mount EFI partition sudo mount /boot/efi and reinstall grub sudo grub-install

Now, after rebooting, UEFI entries are not messy anymore but you've got only one entry: Ubnutu. No more Windows here, so I have to recreate EFI entries for Windows

In a lot of guides I found, it says to use Windows Startup Repair tool, but:

  1. It didn't work for me (maybe because of Grub?)
  2. I don't exactly knows what it does and how....

So I did it manually :

Boot on Windows10 install media > select language > Repair your computer > Advanced Options > Troubleshoot > Command prompt

With diskpart I mount and add a letter to EFI partition

diskpart
diskpart>list vol            (to display assigned letter to partitions and volume numbers)
diskpart>sel vol 4           (volume number of the EFI partition)
diskpart>assign letter=Z:    (or other available letter)
diskpart>exit

Then I use bcdboot to create Windows entries in the EFI partition

bcdboot D:\Windows /l fr-fr /s Z: /f UEFI                (D is the letter of the partition with the first Windows system to boot, here Win10-1)
bcdboot E:\Windows /l fr-fr /s Z: /f UEFI /d /addlast    (E is the letter of the partition with the first Win10-2 system)
bcdboot F:\Windows /l fr-fr /s Z: /f UEFI /d /addlast    (F is the letter of the partition with the first Win10-3 system)

When rebooting there is now 2 choice in UEFI selection : Grub or Windows boot manager, but grub still don't know Windows. At the end, boot a last time on Ubuntu and do a sudo update-grub.

Here is the actual behaviour when booting :

Boot 
|_______Grub
        |______*Ubuntu > boots Ubuntu
        |______*Windows Boot manager on /dev/nvme0n1
                |_______Windows Boot Manager GUI
                        |______*Win10-1 > boots Win10-1
                        |______*Win10-2 > boots Win10-2
                        |______*Win10-3 > boots Win10-3                       

For more clarity we can use bcdedit to rename entries in WBM

From any Windows command prompt:

bcdedit (to list entries and not identifiers)
bcdedit /set {identifier} description "My Custom Windows"

Now on its preatty clean. But I must go through Grub then Windows Boot Manager GUI to boot on any Windows. So I keep playing !

I did format EFI partition on Nvme1 again, create a new one on Nvme2 and another on SSD1 (FAT32 partition 100Mo with 'boot' Flag from Gparted)

Install Grub on Nvme1 /boot/EFI.

From Windows10 install media, the same way as above, mount each 3 EFI partitions and add on each one the related EFI entries :

bcdboot D:\Windows /l fr-fr /s Z: /f UEFI /d /addlast    (D is system Win10-1 and Z EFI on Nvme1)
bcdboot E:\Windows /l fr-fr /s Y: /f UEFI /d /addlast    (E is system Win10-2 and Y EFI on Nvme2)
bcdboot F:\Windows /l fr-fr /s X: /f UEFI /d /addlast    (F is system Win10-3 and X EFI on SSD1)

Finaly do update-grub from Ubuntu after reboot. And now here is the behaviour :

Boot 
|_______Grub
        |______*Ubuntu > boots Ubuntu
        |______*Windows Boot manager on /dev/nvme0n1 > boots Win10-1
        |______*Windows Boot manager on /dev/nvme1n1 > boots Win10-2
        |______*Windows Boot manager on /dev/sdb > boots Win10-3

Furthermore, I am now able to boot any system from UEFI selection and if I lost Nvme1 disk I am still able to boot from other disk

Hope this novel can be useful for other people

0

I had a similar problem, I solved it by updating the grub-loader via a linux-live version. But first I would recommend to get the Win-3 OS running again. For your Win-3 I would assume you have deleted the boot flag somehow. Than the easiest way to restore it, is unplug all other "working" OS so that only the hard drive with win-3 is connected (SSD1), that use the windows recovery tool (use a windows live system if a normal boot do not start the repair tool, if only the win-3 drive is connected) to get the boot flag repaired. After that connect everything again and update grub.

After the Win-3 is working update grub from a linux-live system. A good detailed explanation how this works you can find here. Just be sure to select the right partition since you have two OS on the same hard drive.


Edit:

Okay I guess than it is something EFI spezific. I found some helpfull infromation on here, but they are in german. Using a live or installed system to check the sitatuion in more detail To readout the NVRAM

sudo apt-get install efibootmgr 
...
sudo efibootmgr -v 
Boot0002* Ubuntu    HD(1,800,32000,34911255-cfd8-43ce-a600-fb43636a9c2c)File(\EFI\trusty\shimx64.efi)

The Boot000X are just increasing numbers and the * mark it as active, so you should get a minimum of 2 entries with a star or maybe 4 if the normal disk are tested as well.

You can run sudo dmidecode -t0 | grep -Ei "BIOS boot|UEFI" to see if your UEFI support CSM (if yes it will support bios and UEFI).

Any Issue could be, that windows Check if the First entrece in the EFI-Bootloader is Windwos, if it is not it will delete this and replace with it own bootflag. Suggestion to prevent this is leave it on the first place but disable it. But I guess this will work with only 1 windosOS.

2
  • Here are the results willy@Ubuntu:~$ sudo efibootmgr BootCurrent: 0002 Timeout: 1 seconds BootOrder: 0002,000A,0000,0008,0006,000B,0007 Boot0000* Windows Boot Manager Boot0002* ubuntu Boot0006* UEFI: SAMSUNG SSD 830 Series, Partition 2 Boot0007* UEFI: Sabrent Rocket 4.0 1TB, Partition 1 Boot0008* Windows Boot Manager Boot000A* ubuntu Boot000B* UEFI OS willy@Ubuntu:~$ sudo dmidecode -t0 | grep -Ei "BIOS boot|UEFI" BIOS boot specification is supported UEFI is supported Dec 16, 2020 at 15:11
  • Thx, the Boot-flag ate looking really messy. For my Bios system i deletet all boot-flag and start over again, not sure if it will help. I am confused why Ubuntu has 2 boot-flags Dec 16, 2020 at 15:17

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .