[Solved] Stuck at GRUB command line

New to Debian (Or Linux in general)? Ask your questions here!
Message
Author
DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

[Solved] Stuck at GRUB command line

#1 Post by DebianNewbie »

I'm stuck at GRUB command line - GNU GRUB version 2.06-3~deb11u2.

Several days ago I installed Ubuntu 22.04 on my hp2000 (AMD processor). Prior to that I installed Debian (Lxqt), then thought I needed Ubuntu. However, I'm realizing I was mistaken and Debian will work just fine. Anyway, no my computer is getting stuck at the "GNU GRUB version 2.06-3~deb11u2" screen. I've spent quite a few hours over the last several days trying to resolve this, but as a newbie I'm feeling a bit overwhelmed with all the information and "help" articles. Any advice would be much appreciated.
Last edited by DebianNewbie on 2022-11-29 10:35, edited 1 time in total.

User avatar
sunrat
Administrator
Administrator
Posts: 5084
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 53 times
Been thanked: 186 times

Re: Stuck at GRUB command line

#2 Post by sunrat »

@DebianNewbie I moved this post to a new topic for you. To create a new topic, go to the appropriate subforum and click on the "New Topic" box.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

Re: Stuck at GRUB command line

#3 Post by DebianNewbie »

@sunrat Many thanks!

p.H
Posts: 2862
Joined: 2017-09-17 07:12
Has thanked: 4 times
Been thanked: 99 times

Re: Stuck at GRUB command line

#4 Post by p.H »

Please describe precisely what you did.
When you installed Ubuntu, did you use all the disk space and overwrite Debian ?
Then did you reinstall Debian ?
How do you boot ? Do you let the BIOS/UEFI firmware boot with the default option or do you select Debian in the boot menu ?

DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

Re: Stuck at GRUB command line

#5 Post by DebianNewbie »

ImageAfter hitting enter, it takes me to the black "GNU GRUB..." screen.
Also, I don't know if it makes a difference, but on the 2nd (most recent) install of Debian, I had trouble with a network card firmware "unable to load firmware rtl_nic/rtl8105e-1.fw (-2)" So, reinstalled debian using non free firmware and was able to get it to complete the install of Debian.
Last edited by DebianNewbie on 2022-11-21 00:30, edited 1 time in total.

p.H
Posts: 2862
Joined: 2017-09-17 07:12
Has thanked: 4 times
Been thanked: 99 times

Re: Stuck at GRUB command line

#6 Post by p.H »

If you tried to post a picture, it did not work. Anyway, a picture does not reply all my questions.

DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

Re: Stuck at GRUB command line

#7 Post by DebianNewbie »

@p.H I don't understand why my whole reply does not display. When I click the edit icon, it shows much more text than what is visible right now. :-/
My whole reply contains much more information. Also, I don't know how to add an image. I googled "how to insert image debian forum" and found viewtopic.php?t=123831 which suggests using an online photo sharing site. So loaded an image to https://imgur.com/a/hUpavbL and apparently I didn't link it to my post properly. :-/
Sorry for the confusion and thank you for your patience.

User avatar
sunrat
Administrator
Administrator
Posts: 5084
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 53 times
Been thanked: 186 times

Re: Stuck at GRUB command line

#8 Post by sunrat »

I'd guess your error was starting the post with an IMG tag but it doesn't show because it's text, not image. After the closing IMG tag of your attempted actual image post is what shows. Here is your post with the initial IMG tag removed.
@p.H I installed Ubuntu (using all the disk space). I assume that by doing so Debian was overwritten. However even after installing Ubuntu, Debian still appeared in the list of boot options in the Bios.
Yes, then I reinstalled Debian.
I don't let BIOS/UEFI firmware boot, instead, I press F9 (during initial power on) which loads Boot Manager. (Ubuntu is selected by default, so I arrow down to debian and hit enter). Image After hitting enter, it takes me to the black "GNU GRUB..." screen.
Also, I don't know if it makes a difference, but on the 2nd (most recent) install of Debian, I had trouble with a network card firmware "unable to load firmware rtl_nic/rtl8105e-1.fw (-2)" So, reinstalled debian using non free firmware and was able to get it to complete the install of Debian.
Your image is not showing in the post because the link is to the image web page rather than the image itself. Image just shows the Boot Manager which you already said is how you are booting so image not needed in this case.
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

Re: Stuck at GRUB command line

#9 Post by DebianNewbie »

@sunrat Thank you for helping clarify. :)

p.H
Posts: 2862
Joined: 2017-09-17 07:12
Has thanked: 4 times
Been thanked: 99 times

Re: Stuck at GRUB command line

#10 Post by p.H »

DebianNewbie wrote: 2022-11-20 11:41 I installed Ubuntu (using all the disk space). I assume that by doing so Debian was overwritten. However even after installing Ubuntu, Debian still appeared in the list of boot options in the Bios.
UEFI boot entries are stored in the motherboard non-volatile memory (NVRAM), not on disk, so they remain even after the OS is deleted.
DebianNewbie wrote: 2022-11-20 11:41 then I reinstalled Debian.
I press F9 (during initial power on) which loads Boot Manager. (Ubuntu is selected by default, so I arrow down to debian and hit enter). After hitting enter, it takes me to the black "GNU GRUB..." screen.
It means that GRUB cannot find the system /boot/grub directory for whatever reason.
You can try to find it.
Type "ls" to show the partitions (hdX,gptY). One of them should be the system one.
For each, type

Code: Select all

ls (hdX,gptY)/
(with trailing "/") and look for "boot/". When you find it, type

Code: Select all

set root=hdX,gptY
set prefix=($root)/boot/grub
configfile $prefix/grub.cfg
and the GRUB menu should appear.

DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

Re: Stuck at GRUB command line

#11 Post by DebianNewbie »

@p.H Many thanks! Seems like we're getting warmer! Here's a link to what my grub research revealed: https://imgur.com/a/l7KbBM7 (I also uploaded an attachment file of same image)
So next step is for me to:
set root=hd0,gpt1
set prefix=($root)/boot/grub
configfile $prefix/grub.cfg
?
Attachments
IMG_0877.jpeg
IMG_0877.jpeg (494.15 KiB) Viewed 330 times

p.H
Posts: 2862
Joined: 2017-09-17 07:12
Has thanked: 4 times
Been thanked: 99 times

Re: Stuck at GRUB command line

#12 Post by p.H »

No, (hd0,gpt1) is the EFI partition. Its root does not contain a boot/ directory. Try (hd0,gpt2) instead.

Code: Select all

ls (hd0,gpt2)/boot/grub
should show grub.cfg x86_64-efi/ ,,,

DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

Re: Stuck at GRUB command line

#13 Post by DebianNewbie »

@p.H Yes! That's exactly what it shows.
Attachments
IMG_0974.jpeg

p.H
Posts: 2862
Joined: 2017-09-17 07:12
Has thanked: 4 times
Been thanked: 99 times

Re: Stuck at GRUB command line

#14 Post by p.H »

Then proceed.

DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

Re: Stuck at GRUB command line

#15 Post by DebianNewbie »

@p.H Okay, so I ran the commands (without any errors thrown):

set root=hd0,gpt2
set prefix=($root)/boot/grub
configfile $prefix/grub.cfg

But I'm still hanging at the grub screen. :-/

Just to clarify: after executing the commands it loaded a blue Debian screen with 3 options (see attached image). The first option (to load Debian) was selected, so I hit enter and logged in. Then shut down/restarted to verify that it would load the OS properly. Unfortunately, it didn't.
Attachments
IMG_0975.jpeg

p.H
Posts: 2862
Joined: 2017-09-17 07:12
Has thanked: 4 times
Been thanked: 99 times

Re: Stuck at GRUB command line

#16 Post by p.H »

Of course not. The suggested commands at the grub prompt are not persistent. Their only purpose is to be able to start the system and fix the issue.
Suggestion :
- install the package boot-info-script
- run bootinfoscript
- post the generated report (as text inside <code> tags)

DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

Re: Stuck at GRUB command line

#17 Post by DebianNewbie »

@p.H Okay, I was able to install the boot-info script, but even after googling for a bit and searching the Debian forum, I've not found a good tutorial on how to run bootinfoscript. :-/

User avatar
sunrat
Administrator
Administrator
Posts: 5084
Joined: 2006-08-29 09:12
Location: Melbourne, Australia
Has thanked: 53 times
Been thanked: 186 times

Re: Stuck at GRUB command line

#18 Post by sunrat »

DebianNewbie wrote: 2022-11-25 12:31 @p.H Okay, I was able to install the boot-info script, but even after googling for a bit and searching the Debian forum, I've not found a good tutorial on how to run bootinfoscript. :-/
https://github.com/arvidjaar/bootinfoscript
“ computer users can be divided into 2 categories:
Those who have lost data
...and those who have not lost data YET ”
Remember to BACKUP!

p.H
Posts: 2862
Joined: 2017-09-17 07:12
Has thanked: 4 times
Been thanked: 99 times

Re: Stuck at GRUB command line

#19 Post by p.H »

Just run "bootinfoscript" as root. It generates a REPORT file in the current directory (note : current directory may change with su - or sudo -i).

DebianNewbie
Posts: 21
Joined: 2022-11-18 14:28
Has thanked: 16 times

Re: Stuck at GRUB command line

#20 Post by DebianNewbie »

@p.H Yes, I came across the instructions to run "bootinfoscript" as root, but some time ago, I read that it's not good to use root, but rather to give the user root privileges. Just to avoid being compromised by an attack. However, this morning, I went ahead and opened terminal and switched to root and ran bootinfoscript and got the same error I did yesterday (logged in as my normal user) - "bash bootinfoscript command not found". Also, to install boot-info-script I used the package from here: https://packages.debian.org/buster/admi ... nfo-script then used synaptic package manager (which required the addition of 2 other packages). I basically went with the defaults. 🤷‍♂️
Last edited by DebianNewbie on 2022-11-26 13:43, edited 1 time in total.

Post Reply