0

I have made many experiments,found interesting fact:

step1: install debian-buster

No EFI partition setup during installation in this step.

step2: install windows 10

At this time,grub menu lost,boot into win10 by default.

steps3: reinstall debian-buster

Result:both debian and win10 shown in grub menu ,all works fine.

step1: install debian-buster

No EFI partition setup during installation in this step.

step2: install windows 10

At this time,grub lost,you can boot into win10 by default.Boot pc to enter into bios setting,to select P0:ST10000vx startup menu can boot into debian (it is sure that different name in your pc).

steps3:

debian@debian:~$ sudo rm /boot/grub/grub.cfg
debian@debian:~$ sudo mount /dev/sda6  /mnt 
debian@debian:~$ sudo mkdir -p /mnt/boot/efi
debian@debian:~$ sudo mount /dev/sda2  /mnt/boot/efi
debian@debian:~$ sudo mount --bind /dev /mnt/dev
debian@debian:~$ sudo mount --bind /proc /mnt/proc
debian@debian:~$ sudo mount --bind /sys /mnt/sys
debian@debian:~$ sudo chroot /mnt  
root@debian:/# grub-install --target=x86_64-efi
Installing for x86_64-efi platform.
grub-install: warning: EFI variables are not supported on this system..
Installation finished. No error reported.
root@debian:/# update-grub
root@debian:/# exit

Reboot pc, the grub menu repaired, but no windows boot manager in grub menu,win10 lost!

I can enter win10 this way:

reboot and press del key into bios setting
select windows boot manager
enter

Why grub-install during debian reinstallation can detect win10 os and add it into grub menu,instead grub-install run in terminal can't detect win10?
How can add win10 startup in my grub menu and boot it successfully? Please make real experiment on your pc instead of on virtual machine,then show the bash command to fix grub,talk is cheap.

showkey
  • 323
  • 1
    You have Windows in UEFI boot mode with gpt partitioning. So need Buster in UEFI mode also. Difficult to use one system in UEFI and one in BIOS, but it is possible, not recommended. How you boot install media UEFI or BIOS is how it installs. You can convert install to UEFI by installing UEFI version of grub. Bot in UEFI mode for UEFI repairs & in advanced mode install the UEFI version of grub. https://help.ubuntu.com/community/Boot-Repair Or manually mount ESP and install grub. http://askubuntu.com/questions/53578/can-i-install-in-uefi-mode-with-the-alternate-installer/57380#57380 – oldfred Apr 24 '21 at 02:37
  • 1
    UEFI & BIOS are not compatible. Once you start booting in one mode from your UEFI one time boot menu, you cannot switch. Or grub can only boot other installs in same boot mode. So your BIOS boot of Debian cannot boot an UEFI boot of Windows. Never install grub to a partition like you did to /dev/sda6. If that was NTFS, you could totally break Windows. And systems do not boot from partitions (ok UEFI does use an ESP, but BIOS does not use partitions). And all those warnings should have told you, that there was a better way. – oldfred Apr 24 '21 at 13:51
  • Why not use grub-install --target=x86_64-efi? – Hermann Apr 24 '21 at 13:54
  • So many discussion and so-called solution on webpage such as How to recover GRUB after installing Windows,installing debian-buster first and after that installing windows10 will destroy grub,i have never repair it with ways described on the webpage. – showkey Apr 24 '21 at 13:57
  • It is easy to create a dual boot os,the proper installation order is win10-->debian10,if your installation order is debian10 --> win10, such the same issue as mine occurs! – showkey Apr 24 '21 at 14:22
  • 2
    Again, you have to boot and install Debian in UEFI mode and you can't boot an UEFI Windows from GRUB in BIOS mode. Switching your BIOS setting to boot from "UEFI only" and reinstalling Debian is probably the simplest option. – Freddy Apr 24 '21 at 14:38
  • FYI, you can tell if you have booted the debian installer in EFI mode because it uses grub rather than isolinux, which is used when you boot it in bios mode. If you hit escape at the boot menu, isolinux will give you a boot: prompt, but grub will give you a grub> prompt. – psusi Apr 24 '21 at 16:28
  • Press c give the grub> prompt. – showkey Apr 24 '21 at 23:32
  • https://unix.stackexchange.com/questions/636502/grub-rescue-error –  Apr 25 '21 at 04:33

1 Answers1

0

Partialy and indirectly solved issue.

step1: install debian-buster

With uefi way to install and add one more partiton--EFI partition for the incoming win10,at least to create three partitions : / root partition,swap partition,EFI partition.The EFI partition is a must.

step2: install windows 10
step3: enter debian via bios setting to execute the below commands
sudo update-grub
sudo grub-install  /dev/sda

If no EFI partition created during step1,then the above two commands can't work at the strp3!
Primitive issue still unsolved.

showkey
  • 323