GRUB starts in command line after reboot
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.
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
Related videos on Youtube
Juan Carlos Asuncion
Updated on September 18, 2022Comments
-
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 over 8 yearsHow can there be an ID before you've saved it?
-
xyres over 8 yearsID'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 over 8 yearsAs others have stated, you don't. What are you trying to do?
-
Juan Carlos Asuncion over 8 yearsI'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 over 8 yearsthank you for the answers, i'll try to use the signals, i really can't understand it but i'll try
-
111--- over 7 yearsIMHO 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 reinstallinggrub-efi
. -
Shashank Vyas over 7 yearsWhat is the output of
cat /etc/default/grub
? -
James Moore over 4 yearsSometimes you can just type the word "exit" and hit return, and it will continue correctly.
-
-
Juan Carlos Asuncion over 8 yearsI'll try to use signals, It's really hard to understand for me T.T ty though
-
RasmusKL over 7 yearsI 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 over 7 yearsMaybe 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 over 7 yearscan you show
lsblk -f
andcat /etc/fstab
maybe you oversee something. -
Boris Däppen almost 7 yearsworked for me perfectly: linuxpitstop.com/repair-grub-boot-loader-on-ubuntu-linux
-
user2205916 almost 6 yearsThis did not work for me.
ls
gives:(hd0) (hd0,gpt2) (hd0,gpt1)
etc. then I tried,ls (hdo)
,ls (hdo)/
and goterror: no server is specified
. I tried:ls (hdo,gpt2)/
and goterror: disk
hdo,gpt2' not found`. -
MacMartin almost 6 years@user2205916
ls
gave you(hd0) ...
this is a 'zero' as in '01234', and you wrote you triedld (hdo)/
with an 'o' as in '..LMNOPQRS..' - you have to use the number0
"zero" -
Arkenan about 5 yearsThis 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 over 4 yearsThank 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 over 4 yearsI 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 about 4 yearsThe irony here is that boot-repair is what put it into this state to begin with...
-
J-Cake about 4 yearsThis works for me, except the changes aren't persistent. once i restart the system, I get the boot loader CLI right back again.
-
MacMartin about 4 yearsDid you execute
sudo update-grub
after logging into the system the first time? @JacobSchneider -
J-Cake about 4 yearsI 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 almost 4 yearsI found that just before doing
sudo update-grub
I needed to dosudo grub-mkconfig
, otherwiseupdate-grub
was installing a non-working configuration. -
Alexander Mills almost 4 yearsnice, I got "boot arguments must include a root parameter" tho
-
kabadisha almost 4 yearsYou 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 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 over 3 yearsThat is fantastic to know, I deal with this a lot, so this is awesome
-
Thulashitharan D over 3 yearsDid as u said but i can no longer dual boot it directly takes me into ubuntu what to do?
-
Damilola Olowookere over 3 yearsPlease note you may need to set the
root
partition again when running thelinux
command, so that you won't get a kernel panic (usually complaining about someroot
parameter). So the completelinux
command looks like this:grub> linux /vmlinuz root=/dev/sda1
. More info at @perlinwarp answer below -
Harry over 3 yearsI dont find anything /vmlinuz-4.4.0-38-generic. I had installed ubuntu 20.04. which directory i should run these commands in?
-
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 almost 3 yearsdid you try out help.ubuntu.com/community/Boot-Repair ?
-
Kejsi Struga over 2 yearsOh 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 over 2 years
sudo update-grub
not found, I had to follow this answer -
testing_22 over 2 years@Harry try
ls boot/
to see if you find it there. If so useboot/vmlinuz....
instead -
Drakinite over 2 yearsIf 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 over 2 yearsYour solution saved me again, omg this should be highlighted to the world 😭
-
bomben over 2 yearsThis 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 over 2 yearsI 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 withourboot-repair
. Would I have been able to setshimx64.efi
somewhere? Actually, I tried to setprefix=(hd0,2)/EFI/ubuntu
but this did not load a kernel and thus did not boot. -
Denis over 2 yearsI 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 about 2 yearsFixed my grub boo with the newer Rescatux on the same site.