35

This is what I see:

GNU GRUB version 2.02~beta2-9ubuntu1

Minimal BASH-like line editing is supported. For the first word, TAB lists possible command completions. Anywhere else TAB lists possible device or file completions.

grub> _

What should I do now?

Zanna
  • 70,465
  • 2
    The message means something wrong happened with the bootloader. Nothing else can be said or suggested unless more information is given. Ubuntu release/version? Is Ubuntu standalone or in dual boot with other OS? What happened exactly before the event, what were you doing, etc.? –  Feb 16 '17 at 12:32
  • 3 days ago i bought a new dell laptop with ubuntu 14.04...it was working fine until yesterday...when starting this new laptop first time i take the dell recovery media (factory settings reset) in image file format in download folder...so today i want to restore to its factory settings...then it started the installation process and stucks in mid and asked me to reboot the system saying that installer has crashed...then i reboot it and i get this above problem... – Khivraj Rathore Feb 16 '17 at 13:38
  • 1
    Please help me...what should i do now – Khivraj Rathore Feb 16 '17 at 13:39
  • If it's a factory installed Ubuntu then you should contact Dell support directly. –  Feb 16 '17 at 13:39
  • Ubuntu was standalone – Khivraj Rathore Feb 16 '17 at 13:40
  • I told them (dell) but they said that it is a os problem so i should ask to ubuntu – Khivraj Rathore Feb 16 '17 at 13:41
  • Now i am in confusion that ubuntu is still in my laptop or i should install the other os like ubuntu or windows after formatting this – Khivraj Rathore Feb 16 '17 at 13:43
  • It seems you're dealing with a manufacturer implemented recovery - why I don't know, your comment above makes no sense - hence my recommendation to contact Dell directly. You can of course reinstall by booting a USB flash drive made from an Ubuntu ISO. Is this what you're struggling with? You need to edit and update your question with all that information, not just leave comments. –  Feb 16 '17 at 13:46
  • Did with asked Dell support how to recover the original installation or did you told them the same nonsense as commented above? If the latter them no surprise they politely suggested you to go somewhere else –  Feb 16 '17 at 13:49
  • Try Boot-Repair, if it does not work, post link to summary report it can generate. Boot Repair -Also handles LVM, GPT, separate /boot and UEFI dual boot.: https://help.ubuntu.com/community/Boot-Repair & https://sourceforge.net/p/boot-repair/home/Home/ – oldfred Feb 16 '17 at 14:46

11 Answers11

47

I copied from eli's answer in Unix forum

Cause: boot process can't find the root partition

Solution

Please type ls This will show all partitions, and then type individual

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

... and so on, until you find like

(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 your number

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

now it would boot and please open the Terminal and put this command line

sudo update-grub ... it should boot correctly in the next time. If not, you have to go through the steps again. In other case, you might have to repair or install grub again, please look at this article.

My SW: Windows 10 and Ubuntu 16.04 dual boot

HW: HP Pavilion 15t

Cloud Cho
  • 633
  • 7
  • 11
  • 2
    This works for me, but does not work for subsequent boots (even after running sudo update-grub) – Geoffrey Negiar Mar 19 '20 at 15:33
  • 1
    @geoffn91, If not fix in the second booting, please consider Ubuntu solution at https://help.ubuntu.com/community/Boot-Repair – Cloud Cho Mar 19 '20 at 17:27
  • 6
    instead of (hd0,1)/efi/boot/grub ; I see (hd0,1)/efi/boot/ with three things : bootx64.efi, fbx64.efi, mmx64.efi --- no grub dir – pyeR_biz Oct 01 '21 at 06:43
  • 1
    @pyeR_biz, Thanks for sharing your case. Please try method at https://help.ubuntu.com/community/Boot-Repair. – Cloud Cho Oct 01 '21 at 16:20
  • I executed above command. Am getting the error states. Can't find command sudo update-grub – Devang Nov 26 '21 at 04:57
  • @Devang I guess you had different issue like incorrect OS installation. In those case, would you try method at https://help.ubuntu.com/community/Boot-Repair? – Cloud Cho Nov 26 '21 at 17:00
  • I had to run sudo grub-mkdevicemap -n before sudo update-grub to make it work for subsequent boots (a RAID disk replacement was involved). – Óscar Apr 25 '22 at 17:28
  • 1
    That solution was perfect to me but I had to execute sudo grub-install too – FerranB Sep 04 '22 at 00:04
  • I had to run reboot after normal command. – Sachith Muhandiram Mar 19 '24 at 08:19
11

You got a problem with the bootloader. You should initialize kernel. First use command ls, then adjust the following commands according to it. In the place of hd0 write your disk and in 1 write your number.

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

If you don't know what your version of the kernel is, write:

grub> linux /vmlTab
grub> initrd /inTab

FIRST try only grub> boot

Melebius
  • 11,431
  • 9
  • 52
  • 78
SanHolo
  • 167
8

Not a permanent fix, but you should be able to continue just by exiting:

grub> exit

This will continue to either the grub menu (if you have a dual boot system) where you can choose which OS you want to boot, or directly to your primary operating system. This is a common problem with dual booting a system with UEFI bootloader.

KJ_
  • 89
  • 1
  • 1
2

For Ubuntu 21.04, after a boot repair from usb, I got

grub> insmod all_video
grub> insmod linux
grub> linux /boot/vmlinuz root=/dev/sda2
grub> initrd /boot/initrd.img
grub> boot

And. . . Booted!!!

tatojo
  • 218
1

I got into this state by installing ubuntu onto an external USB SSD enclosure. The installer had modified the file in /boot/efi/EFI/ubuntu/grub.cfg to point to the new drive. When I removed the USB enclusure, the machine dropped me to the grub> prompt.

Based on the answers here: I was able to boot the old drive from the grub> prompt by running:

set prefix=(hd0,gpt1)/boot/grub
set root=(hd0,gpt1)/boot
insmod normal
normal 

You'll need to select the right prefix/root for your machine (use tab to autocomplete).

I then modified the search.fs_uuid line in /boot/efi/EFI/ubuntu/grub.cfg to point to the old drive, and it booted as it did before.

search.fs_uuid 2cbadaa8-abad-4991-b99d-bbadbad99dbe root 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg

I replaced the uuid by a uuid based on the output of:

lsblk -o NAME,SIZE,MOUNTPOINT,UUID
poleguy
  • 155
1

I did try some of the procedures suggested above to not avail.I don't believe anyone suggested a simple boot fix tool available out there already so here it is: https://help.ubuntu.com/community/Boot-Repair or just search on the Ubuntu help site for boot repair tool.

rearThing
  • 169
  • 7
0

When trying to install ubuntu 20.04.2.0 on hp pavilion I got the same. Used ESC + F9 to launch BIOS boot menu, I found both windows and Ubuntu. Both worked fine.

0

I ran into this issue today, I have Linux installed alongside windows and I wanted to remove ubuntu and I directly deleted the partition from windows from disk management on windows 10 without actually deleting the grub menu. As a result whenever I rebooted the system I would see that black screen with that the grub terminal.This basicall happens when the system couldn’t find a OS to boot from so it would go into that grub terminal. so what you need to do is modify your boot order.

  • boot your system by entering the command “reboot”.
  • keep pressing F2 inorder to go into bios, This key varies based on the make of your device in my case I was using a Lenovo ideapad so it would work.
  • Once you have the bios menu using the arrow keys go to “boot” section then you need to change the boot order under “EFI” by pressing f5,f6 keys in my case I deleted the ubuntu partition so I moved the windows to top.

enter image description here

  • after you change the boot order press f10 to save and exit and your system will boot into your desired OS (windows in my case).

Originally posted here: https://qr.ae/pGDLeh

Mahesh Jamdade
  • 843
  • 6
  • 6
0

Diskgenius screenshot of sda

Regarding "and so on, until you find like (hd0,1)/boot/grub or (hd0,1)/grub". The situation can be different as you can see in the figure.

ber999
  • 27
  • 1
    As it’s currently written, your answer is unclear. Please [edit] to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center. – Community Dec 07 '23 at 06:26
-1

FYI, for anyone stumbling upon this post now - I got stuck in grub >, and grub > ls wasn't producing anything.

grub > boot produced:

error: you need to load kernel first

Unplugging the USB mouse and restarting fixed it.

ThunderBird
  • 1,955
-2
grub> ls

Get the data members

grub> ls (hd0,gpt2)/
grub> ls (hd0,gpt2)/boot
grub> set root=(hd0,gpt2)
linux /boot/vmlinuz-4.15.0-20
Zanna
  • 70,465
Athul
  • 11
  • 6
    In case the questioner is not as familiar with command line operations as you are, perhaps you could add a few words of explanation as to what these commands do and why you suggest doing them. – Organic Marble Jul 30 '19 at 13:44