"Error: Invalid signature" when configuring dual boot Ubuntu 14.04 and Windows 10

After installing the Windows 10 upgrade on my laptop, it ruined the grub boot manager, and I could only boot in windows 10. I fixed the boot manager using a live cd with the boot-repair tool, but it only recognized the Ubuntu partition, and not the Windows one.

So I edited the /etc/grub.d/40_custom file and added the following contents:

menuentry "Windows 10" {
    set root='(hd0,3)'
    chainloader +1
}

After running sudo update-grub2, I got an entry in the boot menu, but the partition does not load. It gives the following error:

Error: Invalid signature.

enter image description here

Does anybody know how one can overcome this error?

My most recent boot-repair dump is here: http://paste.ubuntu.com/11965327/, and the partition I want to boot is this one:

sda4: __________________________________________________________________________

    File system:       ntfs
    Boot sector type:  Windows 8/2012: NTFS
    Boot sector info:  No errors found in the Boot Parameter Block.
    Operating System:  
    Boot files:        /bootmgr /Windows/System32/winload.exe

There are some peculiarities about your installation:

  • Your computer has two Windows Recovery Environment partitions, /dev/sda1 and /dev/sda5. My guess is one is from your previous Windows installation and the other is for the new installation, but I can't be positive of that. I doubt if this duplication is causing you any problems per se; I mention it simply because it's a sign of a history of changes to the machine, and such changes may be both the cause of problems and make it difficult to figure out what's wrong.
  • Your EFI System Partition (ESP) is /dev/sda4. This is perfectly legal, but is unusual; the ESP is normally /dev/sda1 or /dev/sda2. The ESP holds EFI-mode boot loaders and related files. My hunch is that the ESP was created late in the machine's history -- perhaps it was Ubuntu-only at one point and then you installed Windows, which created the ESP in this unusual location.
  • The Boot Info Script output doesn't identify any EFI boot loaders on the ESP. My suspicion is that they do exist, but the script has omitted these entries. (I've seen this happen from time to time.) OTOH, if those files are missing, then it means that Windows has failed to install its boot loader. The same may be true of Ubuntu, too; but see below....
  • Your disk uses the GUID Partition Table (GPT), which means that Windows will install to and boot from this disk only in EFI mode; but there's evidence of a BIOS-mode installation of GRUB, the standard Ubuntu boot loader. Such a mish-mash means that you'd not be able to boot Windows from a BIOS-mode GRUB on this computer. It could be you've also got an EFI-mode GRUB and had been booting that way; or maybe you had been switching between OSes by using the computer's built-in boot manager (typically accessed by hitting Esc, Enter, or a function key at start time).

At this point, your best bet is to install an EFI-mode boot loader for Linux. There are two ways to do this that are relatively safe and easy. Both work best if you first enter your firmware and completely disable any option to boot using BIOS, CSM, or legacy mode. (Those are three terms for the same thing.) Sometimes these options are phrased the other way -- you must enable EFI or UEFI support. With that done, do one of two things:

  • Method 1: Boot your Ubuntu install disk, ensure you've booted in EFI mode by looking for the /sys/firmware/efi directory (if it's present, you've booted in EFI mode), install the boot-repair package, and run it. This should repair your installation by installing an EFI version of GRUB. This usually works, but occasionally it doesn't. I realize you've already run Boot Repair, but my suspicion is that you ran it in BIOS mode, which of course means it would install the BIOS-mode GRUB, which will be useless for booting Windows.
  • Method 2: If you haven't done so already, disable Secure Boot in your firmware. You can then download and prepare a boot medium from the CD-R or USB flash drive version of my rEFInd boot manager. Boot to it; it should show you a menu with at least one option for each of Windows and Ubuntu. Test these to be sure you can boot both OSes, then boot Ubuntu. At this point, you can install the rEFInd Debian package or PPA. (Alternatively, you could install the EFI version of GRUB.) You may be able to re-enable Secure Boot at this point, but you may need to jump through some extra hoops to get it to work.

There should be no need to re-install Ubuntu, and probably not to re-install Windows. BIOS-mode and EFI-mode installations of Ubuntu are identical except for the boot loader (and related partitions -- but you've got the partitions to handle both modes).


From the output of your boot-repair command, it looks like you have an UEFI system…

However, Ubuntu is installed in non-UEFI mode, and Windows is installed in UEFI mode so only one of the two is going to work at a time without changing the boot parameters…

The best you can do is: re-install Windows 10 in non-UEFI mode or reinstall Ubuntu in UEFI mode depending on which you use most.


As an alternative to have dual boot setup, you can try setting up Grub2Win, which is an implementation of GRUB installed from Windows and has UEFI support. Note that Grub2Win does not integrate with existing GRUB installation, it creates its own.

Once installed it would detect your UEFI boot option for Windows.

It may detect your Linux partition automatically, if it doesn't you can add the menu entry manually to C:\grub2\grub.cfg, you can grab menuentry from your existing grub.cfg in Linux (usually located at /boot/grub/grub.cfg), looks similar to this:

menuentry 'Ubuntu' --class ubuntu --class gnu-linux --class gnu --class os --class icon-linux {
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt6'
    search --no-floppy --fs-uuid --set=root ###################
    linux   /boot/vmlinuz-5.4.0-48-generic root=UUID=################### ro  quiet splash $vt_handoff
    initrd  /boot/initrd.img-5.4.0-48-generic
}

Note that instead of ###### above, you should use your Linux partition UUID, and should use the real boot image names installed in your /boot directory.

This enabled me to have Windows 10 + Ubuntu 20.04 dual boot setup successfully.