47

I installed Linux Mint on my laptop along with a pre-installed Windows 10. When I turn on the computer, the normal GRUB menu appears most of the time:

GRUB menu

But after booting either Linux or Windows then rebooting, I GRUB starts in command line mode, as seen in the following screenshot:

GRUB command line

There is probably a command that I can type to boot from that prompt, but I don't know it. What works is to reboot using Ctrl+Alt+Del, then pressing F12 repeatedly until the normal GRUB menu appears. Using this technique, it always loads the menu. Rebooting without pressing F12 always reboots in command line mode.

I think that the BIOS has EFI enabled, and I installed the GRUB bootloader in /dev/sda.

Why is this happening and how can I ensure that GRUB always loads the menu?

Edit

As suggested in the comments, I tried purging the grub-efi package and reinstalling it. This did not fix the problem, but now when it starts in command prompt mode, GRUB shows the following message:

error: no such device: 6fxxxxx-xxxx-xxxx-xxxx-xxxxxee.
Entering rescue mode...
grub rescue>

enter image description here

I checked with the blkid command and that is the identifier of my linux partition. Maybe this additional bit of information can help figure out what is going on?

  • IMHO Windows 10 has an update that sabotages (albeit possibly through incompetence) this kind of setup. You will need to get into your Linux, through the sequence of commands you mentioned or a live CD and fix the grub-efi package. Try purging and reinstalling grub-efi. – 111--- Dec 12 '16 at 22:12
  • What is the output of cat /etc/default/grub? – Shashank Vyas Dec 17 '16 at 10:53
  • 4
    Sometimes you can just type the word "exit" and hit return, and it will continue correctly. – James Moore Oct 5 '19 at 15:45

16 Answers 16

58

The boot process can't find the root partition (the part of the disk, that contains the information for starting up the system), so you have to specify its location yourself.

I think you have to look at something like this article: how-rescue-non-booting-grub-2-linux

short: in this grub rescue> command line type

ls

... to list all available devices, then you have to go through each, type something like (depends what is shown by the ls command):

ls (hd0,1)/
ls (hd0,2)/ 

... and so on, until you find

(hd0,1)/boot/grub   OR (hd0,1)/grub

In case of efi

(hd0,1)/efi/boot/grub OR (hd0,1)/efi/grub

... now set the boot parameters accordingly, just type this with the correct numbers and after each line press return

set prefix=(hd0,1)/grub
set root=(hd0,1)
insmod linux
insmod normal
normal

now it should boot. Start a commandline now (a terminal) and execute

sudo update-grub

... this should correct the missing information and it should boot next time.

If not, you have to go through the steps again an might have to repair or install grub again (look at this article: https://help.ubuntu.com/community/Boot-Repair)

| improve this answer | |
  • 3
    I will try this, but this answer does not explain why sometimes grub is able to find the partition, but if I press F12 before it loads, it is then able to find the partition. – Antoine Aubry Dec 17 '16 at 18:45
  • Maybe a bios update/upgrade, do you find something on the ASUS site? Or is it something with uefi/legacy boot (bios configuration) - I don't know, does something have to be tweaked in GRUB for working with uefi? – eli Dec 18 '16 at 15:59
  • 1
    @user2205916 ls gave you (hd0) ... this is a 'zero' as in '01234', and you wrote you tried ld (hdo)/ with an 'o' as in '..LMNOPQRS..' - you have to use the number 0 "zero" – eli Jul 11 '18 at 8:01
  • 1
    The irony here is that boot-repair is what put it into this state to begin with... – Douglas Gaskell Feb 24 at 19:27
  • 1
    This works for me, except the changes aren't persistent. once i restart the system, I get the boot loader CLI right back again. – Jacob Schneider Feb 26 at 1:33
9

This is some funny thing happening to many PC dual booting with Windows 10. Happened to me and friends recently. Please note that I don't know why, I can only speculate this depends on some Windows 10 updates. As someone said, indeed this is due to the boot process not finding the root partition for some reason, so GRUB asks you to tell him where it is via CLI.

this is what I got

Anyway thanks for asking this question, I found it trying to fix my problem and I created this account just to answer this. The fix is super easy :

  • go to BIOS/UEFI
  • check the boot partitions: are there ok or too many? do you recognize all of them? Remove the ones that are not needed.
  • reset the boot order to default
  • restart, you should see the usual GRUB menu
| improve this answer | |
  • 2
    This was exactly my case when installing Manjaro. After rebooting it would always go to the grub shell, which was a hassle. The problem was that in the UEFI boot options, the order for the hard rive was: 1. Live CD (not connected anymore). 2. Windows Boot Manager (the one that actually went to the grub shell). 3. Manjaro (which is actually Manjaro's grub). After putting Manjaro first in the UEFI boot order, the computer starts up and goes to grub as it's supposed to. – Arkenan Feb 9 '19 at 18:16
  • 1
    Changing the boot order worked for me: I had Windows 10 installed on Dell laptop, then installed Ubuntu 16.04 on an external SSD hard drive but somehow managed to end up with grub coming up on boot. I changed the boot order to Windows first and now it boots straight to Windows - I'm happy to F12 to boot to Ubuntu for now. – WillC Jul 11 '19 at 0:03
4

You can boot your linux system through Super Grub2 disk, Download the iso from here and create a bootable USB

After successfully booting kali linux , reinstall grub-efi as follows :

grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=debian --recheck --debug /dev/sda
update-grub
| improve this answer | |
  • Thank you, that solved my issue. I used boot-repair which created a new partition and installed Grub, but it was giving me the grub console. Doing the given command solved my issue. – ZedTuX Jan 11 at 6:02
3

Your Windows may be installed in UEFI boot mode and Mint in BIOS boot mode. The two modes are not compatible and you can only dual boot from UEFI/BIOS menu and may have to turn on or off UEFI or BIOS boot settings. Grub can only dual boot other installs in same boot mode as you booted grub. You can use Boot-Repair to convert a BIOS.

| improve this answer | |
3

I ran into the same issue. And I found that sometimes when booting in windows 10 the boot order is changed. I have two SSDs in my laptop. One has ubuntu and grub and the other has windows installed. The boot order is sometimes changed when windows 10 updates and puts the windows SSD first, causing the system to always boot into windows. Recently it randomly changed it and I started seeing the system boot into the grub prompt. Once I changed the boot order in BIOS, the grub menu loaded normally.

| improve this answer | |
3

Try these commands

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 partition that contains your Linux Mint boot image you will run the following steps:

You should initialize kernel

grub> set root=(hd0,1)
grub> linux /vmlinuz-4.4.0-38-generic 
grub> initrd /initrd.img-4.4.0-38-generic
grub> boot

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

Once booted into your Linux Mint 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
| improve this answer | |
2

If you happen to boot into GRUB menu:

1. Start your system

1.1 Figure out which partition is the system one via mounting available partitions and looking for executable kernel file:

grub> ls # shows list of disks and partitions available
(hd0,gpt1), (hd0,gpt2) # you might have other things listed here
grub> set root=(hd0,gpt1)
ls /boot # if theres a file called vmlinuz<version> or initrd<version>, bingo!

If there's no vmlinuz file, call unset root and try with another one set root=(hd0,gpt2)

1.2 Load a linux kernel:

grub> linux /boot/vmlinuz-<version> # use TAB to autocomplete version. if theres multiple versions, use whatever

1.3 Load a linux initrd file:

grub> initrd /boot/initrd.img-<version> # same deal, use TAB to autocomplete version

1.4 Boot up your system:

grub> boot

2. Reinstall grub

2.1 Make sure `grub-install` is there:

sudo apt-get install grub-install

2.2 Reinstall grub for the mounted disk:

sudo grub-install /dev/sdX

sdX means a device mounted in step 1. If not sure, issue lsblk and look for the device which has / mountpoint:

$ lsblk
NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 223.6G  0 disk              <-- in my case, sdX = sda
├─sda1   8:1    0   100M  0 part /boot/efi
├─sda2   8:2    0 130.9G  0 part /mnt/windows
├─sda3   8:3    0    28G  0 part /            <-- because this is under sda
├─sda4   8:4    0   7.9G  0 part [SWAP]
├─sda5   8:5    0   128M  0 part
└─sda6   8:6    0  56.6G  0 part /home

2.3 Reboot

systemctl reboot

At this point, GRUB bootloader should work as you intend so.

References/similar issues:

| improve this answer | |
  • nice, I got "boot arguments must include a root parameter" tho – Alexander Mills Jun 7 at 1:20
1

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.

| improve this answer | |
1

I suddenly found that after some updates Windows has set the Fast boot option to enabled. And that caused my ubuntu boot problem)) Fast boot option can be found somewhere in your BIOS/boot settings

| improve this answer | |
0

After installing Linux Mint 19.1 the system would only boot to the grub rescue> prompt and displayed an error just above it indicating it could not find hd0. Thanks to this thread I accessed the BIOS and under "Storage/Storage Options" I changed the SATA emulation from AHCI RAID to Native Mode IDE and now the system boots up to the proper menu which allows me to choose my Linux Distribution and continue booting successfully.

| improve this answer | |
  • I don't understand why this is being downvoted and is even collecting delete votes. This solution isn't mentioned anywhere else and seems to be a perfectly valid one. – terdon Jan 12 at 13:48
0

After spending a while on this page, here is what worked for me:

Check each of the partitions until you find one with vmlinuz and initrd on. This could be in the same partition as root or (not in my case).

There will be one partition (root) you find with bin/ and boot/ etc in. If you "ls" in the boot folder and it's empty, you will have to look for vmlinuz somewhere on another partition.

(hd0,msdos1) corrisponds to /dev/sda1.
(hd1,msdos4) corrisponds to /dev/sdb4

set root = (hd0,msdos6)
linux (hd0,msdos1)/vmlinuz root=(hd0,msdos6)
initrd (hd0,msdos1)/initrd 

Note:

  • After typing vmlinuz you can press tab for autocomplete.
  • Replace (hd0,msdos1) with where vmlinuz and initrd are
  • Replate (hd0,msdos6) with the typical root parition, you should find bin/ boot/ home/ etc/ in here.

Pressing enter should lead you back into Ubuntu. If it does not, you got your partitions wrong.

sudo update-grub
sudo grub-install /dev/sda

Note: - The lack of numbers after /dev/sda

TL;DR - Read this: How to Rescue a Non-booting GRUB 2 on Linux

| improve this answer | |
0

If entering 'exit' on the GRUB command prompt brings you to the GRUB menu, it could be an issue with the boot priority sequence in your BIOS utility.

For me the fix was to reorder the boot sequence - I entered my BIOS utility on startup and reordered the 'UEFI Hard Disk Drive Priorities' so that the Ubuntu partition was first in line.

My understanding is that entering 'exit' on the GRUB menu will quit GRUB and cause the BIOS to try and start the next available bootloader.

| improve this answer | |
-1

Reinstall Linux on same partition, take care of foll. things this time:

  1. Start Live and then install
  2. Once installation is over, DO NOT Reboot
  3. Close the dialog box, and open Terminal Ctrl + Alt + T
  4. Type following command- sudo update-grub

Check for Line *"Found Windows Boot Manager ..."*

  1. Reboot if successfully done
| improve this answer | |
-2

I copied my kubuntu 19.10 partition from hd to SSD to make the system work faster and didn't want to reinstall everything over again. I want to keep the original partition as a backup since I want to experiment with davinci resolve. So I changed UUID using Gparted. Then I got the Grub 2.02 "Mininal BASH-like line editing..." error. All I did was to booted into setup and changed the boot order to get it fixed. Now I see Kubuntu 19.10 on sda11, windows on sda1 and kubuntu 19.10 on sdb2. I hope it'll help someone.

| improve this answer | |
-2

Change the boot medium to linux for Ubuntu 18

| improve this answer | |
  • Can you elaborate on this answer? Note the extensive explanation and precise steps in other answers (for example). Thank you! – Jeff Schaller May 29 at 18:46
-3

I hope this helps to give you a better understanding of how to look. I made this very simple for you and other linux beginners. Please just pay it forward with kindness. These people are brilliant here, but they need to remember they were once beginners

Take notice to how y our system boots. As well all know this could be a different issue that others maybe discover. So some history, I go thru linux distros like i do socks. I wear a lot of different socks btw. I have a.full installation, no dual boot, that's the mppont of thisn lat top. But heres the kicker. I normally have no issues saving my data (home/user), but this time grub said it wouldn't install. I lost may data, and learned I am.capable of profanity I never knew I had... anyways Gurb acted like it wasnt installing, but it did. Then... someone dropped my laptop during an update....inirsmfs restored what I need it too, but here what followed

Power button-> Grub 2.02:

If you first boot and you get a red menu in regards to secure booting blah blah.. its vague. But it let's you click "okay" (vague as in the windows has a 3 -word title, and before clicking okay I think there may be 6 words (Haha complain if I'm wrong on the count, sorry). Bottom line,.you boot into grub.

My case, check gurn to verify You can enter cmpath=hd0 (in my case). Then prefix=(hd0,.gpt2)... Ending in insmod normal Normal

And.booted

So I though about it and checked out my boot/efi/EFI directory ls.-al

d. parrot d. Ubuntu

I rebooted to see what the damn BIOS SAID AND LOW AND BEHOLD:

(hd0,gpt2)boot/grub parrot... ubuntu as boot priotiy

So I tried this....

Went into bios, and now demonize me or not I'm actually helping. Indont claim to be an expert but I along with everyone deserves respect not ignorance and comments from people who couldn't resolve this. Issues happen due to EFI-NOW this isnspeculative. Please fee free to comment on that statement.

Fom Grub type exit -> enter BIOs Go to boot. NOTICE THE BOOT OPETIONS : -PARROT -youll likely see hd0, gpt2)/grub/boot Urgh in my case insane ubuntu, so you can mock me for that Haha Go to boot disable quiet boot if disabled, no problem

Now disable secure boot if applicable and if applicants select custome

If you can find it well it's the end of the WORLD!!!

Haha but seriously check out your boot priority... you'll likely see Parrot Hd0,gpt2 Haha and I saw Ubuntu.

Now disable the obvious---> FOR ME UBUNTU

SAVE AND RESTART... THEN JUST BE HAPPY

PAY IT FORWARD WITH KINDNESS. THESE GINUSES SOMETIMES FORGET THAT PEOPLE DONT DESERVE TO BE DOWN RIGHT BULLIES TO.

FYI: my name isnt what is says. Its Eric Supple

| improve this answer | |

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