First, disable Secure Boot. It sounds like you may have tried this already, but that's not quite 100% clear from your question.
Second, as user207507 suggests, Boot Repair may be able to fix the problem. This isn't guaranteed, though, and in rare cases it can even render Ubuntu unbootable. (Making a backup of your EFI System Partition can provide you with a way back in case you have this problem.)
Third, you might try my rEFInd boot manager. You can try the USB flash drive or CD-R image (both available on the downloads page) without installing rEFInd to your hard disk. If you can boot both Ubuntu and Windows that way, try installing the Debian package in Ubuntu.
If these suggestions don't work, then please post back with the URL that Boot Repair generates. That will give us more detailed information about your system that will be helpful in diagnosing the problem.
Largely cribbed from the ZFS installation instructions at https://github.com/zfsonlinux/zfs/wiki/Ubuntu-16.04-Root-on-ZFS, here are the steps I used to get my system working again.
boot-repair did not work.
Step 1: Prepare The Install Environment
1.1 Boot the Ubuntu Live CD, select Try Ubuntu Without Installing, and open a terminal (press Ctrl-Alt-T).
1.2 Optional: Install the OpenSSH server in the Live CD environment:
If you have a second system, using SSH to access the target system can be convenient.
$ sudo apt-get --yes install openssh-server
Set a password on the “ubuntu” (Live CD user) account:
$ passwd
Hint: You can find your IP address with ip addr show scope global. Then, from your main machine, connect with ssh ubuntu@IP.
1.3 Become root:
# sudo -i
1.4 Install ZFS in the Live CD environment:
# apt-add-repository universe
# apt update
(ignore errors about moving an old database out of the way)
# apt install --yes debootstrap gdisk zfs-initramfs
Step 2: Discover available ZFS pools
2.1 Check if ZFS pools are already imported
# zpool list
# zfs list
2.2 If it says "no datasets available" then skip to Step 3. If either of those commands brings up a list of pools, we need to export the zfs pool so we can mount it in a different directory so we can chroot to it
# zpool export rpool
Step 3: Chroot into ZFS pool
3.1 Import pool to non-default location. The -N flag (don’t automatically mount) is necessary because otherwise the rpool root, and the rpool/root/UBUNTU pool, will both try to mount on /mnt
# zpool import -N -R /mnt rpool
3.2 Mount the root system
# zfs mount rpool/ROOT/ubuntu
3.3 Mount the remaining file systems
# zfs mount -a
3.4 Bind the virtual filesystems from the LiveCD environment to the new system and chroot into it:
# mount --rbind /dev /mnt/dev
# mount --rbind /proc /mnt/proc
# mount --rbind /sys /mnt/sys
# chroot /mnt /bin/bash --login
Note: This is using --rbind, not —bind.
Step 4: Re-initialise EFI partitions on all root pool components
4.1 Check the wildcard gets the correct root pool partitions:
# for i in /dev/disk/by-id/*ata*part3; do echo $i; done
4.2 Add an entry for /boot/efi for each disk to /etc/fstab for failover purposes in future:
# for i in /dev/disk/by-id/*ata*part3; \
do mkdosfs -F 32 -n EFI ${i}; \
echo PARTUUID=$(blkid -s PARTUUID -o value \
${i}) /boot/efi vfat defaults 0 1 >> /etc/fstab; done
4.3 Mount the first disk
# mount /dev/disk/by-id/scsi-SATA_disk1-part3 /boot/efi
4.4 Install grub
# grub-install --target=x86_64-efi --efi-directory=/boot/efi \
--bootloader-id=ubuntu --recheck —no-floppy
4.5 Unmount the first partition
# umount /boot/efi
4.6 Mount the second disk
# mount /dev/disk/by-id/scsi-SATA_disk2-part3 /boot/efi
4.7 Install grub
# grub-install --target=x86_64-efi --efi-directory=/boot/efi \
--bootloader-id=ubuntu-2 --recheck —no-floppy
4.8 Repeat steps 4.5 to 4.7 for each additional disk
4.9 For added insurance, do an MBR installation to each disk too
# grub-install /dev/disk/by-id/scsi-SATA_disk1
# grub-install /dev/disk/by-id/scsi-SATA_disk2
Step 5: Reboot
5.1 Quit from the chroot
# exit
5.2 Reboot
# reboot
Best Answer
It's not possible to do this with GRUB; however, it is possible with my rEFInd boot manager:
/boot/efi/EFI/refind/refind.conf
: Uncomment thescanfor
line and ensure thathdbios
is among the options.The result should be, in the rEFInd screen, options to boot Ubuntu and a gray diamond-shaped option that boots Windows. (If you have multiple disks, there may be multiple diamond boot options, one for each disk. If you've got multiple disks and just one such option and it doesn't work, uncomment the
uefi_deep_legacy_scan
option inrefind.conf
.)If you want to test this process before installing anything on your hard disk, you can do so by using the USB flash drive image of rEFInd (available on its downloads page). You'll have to edit
EFI/refind/refind.conf
on the USB drive as just described -- but of course the mount point will be whatever it is, not/boot/efi
.One more caveat: rEFInd can boot a BIOS-mode boot loader on most EFI-based computers, but not on all of them. A few early EFIs used an EFI layered atop a conventional BIOS, rather than an EFI with a CSM. rEFInd won't be able to redirect to a BIOS-mode boot loader on those early EFIs. (The same is true on systems that lack either an underlying BIOS or a CSM, but you clearly don't have such a system if you're able to boot Windows in BIOS mode.)
There are three other options you might want to consider: