1

I installed the newest Debian version on my laptop, alongside Windows(by shrinking 15 GB of my SSD memory and making a partition for Debian with it). The problem was that it never actually asked to to choose whether to run Windows or Debian, having run Windows all the time, without what I think is called GRUB menu choice.

Since it's been few hours of reading for me, I thought I finally found the solution to this, by visiting this site: https://itsfoss.com/no-grub-windows-linux/. Unfortunately just after typing in those commands into Windows cmd:

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

I realized that it's not Ubuntu I installed but Debian...

Now I am really out of options, neither Debian nor Windows will boot, the only thing I see is what I think is GRUB command prompt.

enter image description here

What should I do now?

1

Issue at Hand

You are unable to boot your system, you are stuck on a grub> shell.

You have a dual boot system with Windows and Debian on a single disk.

Disclaimer

You mention running a command to add a Debian entry to your BCD entry involving UEFI. When you installed Debian do you remember installing your Debian system using UEFI?

If you did not setup UEFI it may be faster to reinstall your system following the procedures outlined here and here.

Recovering from GRUB

First off we will need to fix your GRUB entries to be able to boot. I have found this stack exchange post which covers recovering from grub rescue. Following with user DocSalvager, you will need to find the Debian partition containing your /boot

grub> ls
[ Here should be a list of devices and partitions, e.g. (hd0,1) (hd0,2) (etc) ]

You want to look for your Debian partition it could be something like:

grub> ls (hd0,4)/boot

Repeat this for all listed partitions until you find a result that includes something like initrd.img-... vmlinuz-... or even /grub. Once you find a the partition that contains your Debian boot image you will run the following steps:

grub> set root=(hd0,[partition number you found])/boot
grub> insmod linux
grub> linux (hd0,[partition number you found])/boot/vmlinuz-[image name]
grub> initrd ((hd0,[partition number you found])/boot/initrd.img-[image name]
grub> boot

Here you should boot into a Debian system, you may need to further repair your system by:

$ cd /boot
$ mv mod/* grub
$ reboot

I will also include this link you can follow those steps to also repair your boot.

Alternative Steps

Here is some steps to take from the Debian Wiki.

Once booted into a Debian system run these:

[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"
should return "EFI boot on HDD".

mount /dev/sd[Debian boot Partition, e.g. sda4] /boot/efi
apt-get install --reinstall grub-efi
grub-install /dev/sdX \\ X being the disk with your operating systems
update-grub
file /boot/efi/EFI/debian/grubx64.efi \\ Verify that the file exists
efibootmgr --verbose | grep debian \\ Verify nvram entry was created

Now you should be able to reboot and see a grub menu!

Adding a Windows Entry to GRUB 2 Menu

Once booted into your Debian install and not a rescue disk or anything if you see that you are missing Windows from GRUB you will need to follow these steps:

sudo os-prober \\ If you see your Windows Partition then you can run the next step
sudo grub2-mkconfig
sudo update-grub

If os-prober cannot find your Windows partition you will need to mount the Windows file system. Following along with these steps install ntfs-3g and then mount Windows.

mount -t ntfs-3g -o ro /dev/sd[Windows Partition] /media/windows
sudo os-prober
sudo grub2-mkconfig
sudo update-grub

You should see an entry for Windows be added. You can also manually create an entry using your preferred text editor at /etc/grub.d/40_custom.

menuentry "Windows" {
   set root='(hd0,1)' \\ Remember that this should be your Windows boot partition.
   chainloader +1
} 

Conclusion

You will need to repair your boot process in grub. There are several methods that I have outlined and linked to. If this is a fresh install it could be better to install Debian again following the advice on the Wiki.

I will be including a another link regarding booting with GRUB as well as another forum post about a similar issue.

Please comment if you have any questions or issues with this answer. I highly suggest you read through each link I have provided thoroughly before attempting the commands. I appreciate feedback to correct any misconceptions and to improve my posts. I can update my answer as needed.

Best of Luck!

0

Oh the pain this has caused me in the past with my Debian dual-boot.....

First thing's first...Have you disabled Secure Boot in BIOS (UEFI)?: https://askubuntu.com/questions/891248/ubuntu-16-04-how-can-i-disable-secure-boot

Second thing to check, if you boot directly into BIOS (UEFI most likely), you can still access your bootable partition by selecting it from the boot manager. There should be something similar to this: https://help.ubuntu.com/community/UEFI

That guide should point you in the right direction for your install. 9 times out of 10 it's due to the fact that you didn't disable Secure Boot first. Once that is done, just reinstall your distro and it should boot right up.

BTW...Ubuntu is based on Debian. Aside from some slightly different skins and custom installation GUIs, the underlying process should be the same.

  • Somehow I managed to disable the Grub Command prompt by opening the GNU Grub menu with such commands: //set prefix=(hd0,9)/boot/grub //set root=(hd0,9) //insmod linux //insmod normal //normal Then by choosing to run Windows I reverted the changes I made to the {bootmgr} path. I also tried to reinstall GRUB by using Advanced options>Rescue Mode(or something similar) while running Debian installation from my usb flash disk, unfortunately it also didn't change anything. I think I'm stuck with no GNU GRUB for eternity... – Bartosz Świtalski Oct 10 '18 at 14:35
  • I think you're almost there! I had the exact same issues, but it all came down to the Secure Boot setting (in my case I needed to set a password for an admin account on my motherboard to disable it). Are you 100% sure you disabled Secure Boot? There are a few grub rescue utilities we can try if you're positive Secure Boot is disabled. – bgregs Oct 10 '18 at 14:42
  • I am 100% sure. First I couldn't even boot Debian via usb without disabling Secure Boot in BIOS, and I kept it disabled. – Bartosz Świtalski Oct 10 '18 at 14:52
  • Alright. Let's give the boot-repair tool a shot. This link should provide you with step by step instructions for getting this loaded to a usb. If it's a grub issue, this usually straightens it out pretty quickly: help.ubuntu.com/community/Boot-Repair – bgregs Oct 10 '18 at 15:01
  • Okay, I ran the Boot-repair tool, but currently it encounters problems with downloading repository information, asking me to check my internet connection but that is all good.After all it states "Please enable a repository containing the [grub-efi-amd64-signed] packages in the software sources of Debian GNU/Linux 9(sda9). Then try again." I have an idea, but I'll come back to it in 2 hrs, since I have a meeting to attend. – Bartosz Świtalski Oct 10 '18 at 15:32
0

The same issue occurred on my dell laptop with windows 10 and Linux mint 19. So what happened was I was working windows and suddenly the hdd was missing from the disk list. Window was working fine since it was on ssd drive. After being confused for a while I wanted to make sure if the hdd was functioning so I run a diagnostic from the bios after it was done I restarted the machine and got my grub listing back.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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