GRUB starts in command line after reboot

389

Solution 1

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 summary:

in the 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

... or, in case of "UEFI", it look something like:

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

Now you have to set the boot parameters accordingly - just type the following (with the correct numbers for your case) and after each line press return:

set prefix=(hd0,1)/grub

... or (if grub is in a sub-directory):

set prefix=(hd0,1)/boot/grub

Then continue with

set root=(hd0,1)
insmod linux
insmod normal
normal

Now it should boot:

boot



Go to the commandline (e.g. start a "terminal") now, 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:
Please look at the "Boot-Repair"-tool from this article: https://help.ubuntu.com/community/Boot-Repair (I had positive experiences with it, when previous steps wouldn't survive the reboot)

Solution 2

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

Solution 3

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

Solution 4

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

Solution 5

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
Share:
389

Related videos on Youtube

Juan Carlos Asuncion
Author by

Juan Carlos Asuncion

Updated on September 18, 2022

Comments

  • Juan Carlos Asuncion
    Juan Carlos Asuncion over 1 year

    I know it's just a piece of code but i can't find any reference(beginner) My question is how do i get the id of cde = form.save(commit=False) or how do i get the id from the form before i save it?

    • Daniel Roseman
      Daniel Roseman over 8 years
      How can there be an ID before you've saved it?
    • xyres
      xyres over 8 years
      ID's are only assigned to objects saved in database. So, to get an object's ID, you will have to save it first.
    • Brandon Taylor
      Brandon Taylor over 8 years
      As others have stated, you don't. What are you trying to do?
    • Juan Carlos Asuncion
      Juan Carlos Asuncion over 8 years
      I'm trying to save class B from models that has a default value whenever a data is inserted in forms (or saved in Class A from what you guys said). class b's foreign key is referenced to class A's id. i'm a beginner sorry for the questions
    • Juan Carlos Asuncion
      Juan Carlos Asuncion over 8 years
      thank you for the answers, i'll try to use the signals, i really can't understand it but i'll try
    • 111---
      111--- over 7 years
      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.
    • Shashank Vyas
      Shashank Vyas over 7 years
      What is the output of cat /etc/default/grub?
    • James Moore
      James Moore over 4 years
      Sometimes you can just type the word "exit" and hit return, and it will continue correctly.
  • Juan Carlos Asuncion
    Juan Carlos Asuncion over 8 years
    I'll try to use signals, It's really hard to understand for me T.T ty though
  • RasmusKL
    RasmusKL over 7 years
    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.
  • MacMartin
    MacMartin over 7 years
    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?
  • Admin
    Admin over 7 years
    can you show lsblk -f and cat /etc/fstab maybe you oversee something.
  • Boris Däppen
    Boris Däppen almost 7 years
  • user2205916
    user2205916 almost 6 years
    This did not work for me. ls gives: (hd0) (hd0,gpt2) (hd0,gpt1) etc. then I tried, ls (hdo), ls (hdo)/ and got error: no server is specified. I tried: ls (hdo,gpt2)/ and got error: disk hdo,gpt2' not found`.
  • MacMartin
    MacMartin almost 6 years
    @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"
  • Arkenan
    Arkenan about 5 years
    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.
  • ZedTuX
    ZedTuX over 4 years
    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.
  • terdon
    terdon over 4 years
    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.
  • Douglas Gaskell
    Douglas Gaskell about 4 years
    The irony here is that boot-repair is what put it into this state to begin with...
  • J-Cake
    J-Cake about 4 years
    This works for me, except the changes aren't persistent. once i restart the system, I get the boot loader CLI right back again.
  • MacMartin
    MacMartin about 4 years
    Did you execute sudo update-grub after logging into the system the first time? @JacobSchneider
  • J-Cake
    J-Cake about 4 years
    I did. I ended up managing to fix this issue by repeating the same thing several times, oddly, it was after the third or fourth attempt that it stayed.
  • Adambean
    Adambean almost 4 years
    I found that just before doing sudo update-grub I needed to do sudo grub-mkconfig, otherwise update-grub was installing a non-working configuration.
  • Alexander Mills
    Alexander Mills almost 4 years
    nice, I got "boot arguments must include a root parameter" tho
  • kabadisha
    kabadisha almost 4 years
    You are a lifesaver. I hit this issue after sudo apt upgrade crapped out on me over ssh. No display, no ping response. Nada. Had to power cycle and then hit this. Back up and running now thanks to you!
  • Jules Colle
    Jules Colle over 3 years
    @JacobSchneider after hours of struggling I installed the Boot repair tool mentioned by eli. That tool fixed all my problems automatically.
  • J-Cake
    J-Cake over 3 years
    That is fantastic to know, I deal with this a lot, so this is awesome
  • Thulashitharan D
    Thulashitharan D over 3 years
    Did as u said but i can no longer dual boot it directly takes me into ubuntu what to do?
  • Damilola Olowookere
    Damilola Olowookere over 3 years
    Please note you may need to set the root partition again when running the linux command, so that you won't get a kernel panic (usually complaining about some root parameter). So the complete linux command looks like this: grub> linux /vmlinuz root=/dev/sda1. More info at @perlinwarp answer below
  • Harry
    Harry over 3 years
    I dont find anything /vmlinuz-4.4.0-38-generic. I had installed ubuntu 20.04. which directory i should run these commands in?
  • josias
    josias almost 3 years
    @eli just like Jacob Schneider, your steps work, but they are not being persited. So after rebooting, the I see the grub terminal again. I did run update-grub immediately after login (running PopOS), and I tried the same procedure several times which did not work for me. Any ideas how I can solve my case? (Win10 & PopOS dual boot on GPT and EFI)
  • MacMartin
    MacMartin almost 3 years
  • Kejsi Struga
    Kejsi Struga over 2 years
    Oh man, this was a life saver. I had reset the BIOS using modprob command and got the grub shell after rebooting. For me the root partition was (hd0,3)!!
  • testing_22
    testing_22 over 2 years
    sudo update-grub not found, I had to follow this answer
  • testing_22
    testing_22 over 2 years
    @Harry try ls boot/ to see if you find it there. If so use boot/vmlinuz.... instead
  • Drakinite
    Drakinite over 2 years
    If anyone else is having an issue where the changes do not persist, try Boot-Repair, enable Advanced Options, and disable Secure Boot; then proceed.
  • testing_22
    testing_22 over 2 years
    Your solution saved me again, omg this should be highlighted to the world 😭
  • bomben
    bomben over 2 years
    This also works, if you are in grub>. The working prefix for me was (hd0,2)/boot/grub. Unfortunately, this is not persistant after a reboot.
  • bomben
    bomben over 2 years
    I was able to solve this by using boot-repair. The program resulted with an information that my system has to boot from /EFI/ubuntu/shimx64.efi. This is not consistent with me trying to boot from /boot/grub, I think. So, it would be interesting if someone could solve how this could have worked withour boot-repair. Would I have been able to set shimx64.efi somewhere? Actually, I tried to set prefix=(hd0,2)/EFI/ubuntu but this did not load a kernel and thus did not boot.
  • Denis
    Denis over 2 years
    I tried a lot of advices, which didn't work. The solution was really simple, just disable fast boot. Linux root partition was on a second drive that did not have enough time to initialize. Perhaps this comment will help someone to pay attention to this answer.
  • Penghe Geng
    Penghe Geng about 2 years
    Fixed my grub boo with the newer Rescatux on the same site.