Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian 9 grub boots to command line but works SOLVED

Ask for help with issues regarding the Installations of the Debian O/S.
Message
Author
justinmk85
Posts: 23
Joined: 2017-11-18 18:40

Debian 9 grub boots to command line but works SOLVED

#1 Post by justinmk85 »

I installed debian 9 on my laptop using the live usb method. It is the only OS on the laptop. When it boots up the first screen I see is the grub command line. It's the same screen you get when pressing C at the main grub menu. If I type the exit command there, it will go to the main grub menu and boot into debian with no issues. I've tried reinstalling and it didn't help.
After searching around for info on this issue I've learned that the grub partition is set up as EFI and it is the first partition. Debian is the second partition and swap is the 3rd.
I've tried using resatux via live usb to repair grub and it didn't do anything.
Does anyone have a similar issue or know a solution to this problem? Thanks
Last edited by justinmk85 on 2017-11-23 12:33, edited 1 time in total.

maximus1978
Posts: 93
Joined: 2015-03-19 12:49

Re: Debian 9 grub boots to command line but works

#2 Post by maximus1978 »

From the grub command line...

type "ls" and post the result
type "set" and post the result

justinmk85
Posts: 23
Joined: 2017-11-18 18:40

Re: Debian 9 grub boots to command line but works

#3 Post by justinmk85 »

Thanks for replying. Below is what I got:

ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

set
image is at this link:
https://imgur.com/j6RsaQV

Image

justinmk85
Posts: 23
Joined: 2017-11-18 18:40

Re: Debian 9 grub boots to command line but works

#4 Post by justinmk85 »

The first line got cut off in the image, here it is

cmdpath=(hd0,gpt1)/EFI/UBUNTU

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Debian 9 grub boots to command line but works

#5 Post by Head_on_a_Stick »

deadbang

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian 9 grub boots to command line but works

#6 Post by p.H »

It seems that you have two GRUB installed.
The first one displaying the command line seems to be from Ubuntu (previous installation ? Dual boot ?).
The second one displaying the menu is from Debian.

Please install boot-info-script and post the report created by the command bootinfoscript.

justinmk85
Posts: 23
Joined: 2017-11-18 18:40

Re: Debian 9 grub boots to command line but works

#7 Post by justinmk85 »

Yes I had mint installed before I went to debian.

Would I use apt install to install that?

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian 9 grub boots to command line but works

#8 Post by p.H »

Yes.

maximus1978
Posts: 93
Joined: 2015-03-19 12:49

Re: Debian 9 grub boots to command line but works

#9 Post by maximus1978 »

justinmk85 wrote:Thanks for replying. Below is what I got:

ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

set
image is at this link:
https://imgur.com/j6RsaQV

Image
in the grub command prompt type the following

set root=hd0
chainloader +1
boot

Please post what happens.

justinmk85
Posts: 23
Joined: 2017-11-18 18:40

Re: Debian 9 grub boots to command line but works

#10 Post by justinmk85 »

Ok I will try both of these suggestions later tonight and post.

justinmk85
Posts: 23
Joined: 2017-11-18 18:40

Re: Debian 9 grub boots to command line but works

#11 Post by justinmk85 »

This is what happened when I tried the chainloader command https://imgur.com/a/PmiiK

boot info script:
Boot Info Script 0.61 [1 April 2012]


============================= Boot Info Summary: ===============================


============================ Drive/Partition Info: =============================

no valid partition table found
"blkid" output: ________________________________________________________________

Device UUID TYPE LABEL

/dev/mmcblk0
/dev/mmcblk0p1 6E89-3EA0 vfat
/dev/mmcblk0p2 8e77bcd0-bb33-4549-a329-5abfed7e0a8c ext4
/dev/mmcblk0p3 cc96a754-5db9-4a3d-8bf6-62512b7e5f03 swap
/dev/mmcblk1
/dev/mmcblk1p1 0101-07DC vfat NO_NAME

================================ Mount points: =================================

Device Mount_Point Type Options

/dev/mmcblk0p1 /boot/efi vfat (rw,relatime,fmask=0077,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)
/dev/mmcblk0p2 / ext4 (rw,relatime,errors=remount-ro,data=ordered)
/dev/mmcblk1p1 /media/justin/NO_NAME vfat (rw,nosuid,nodev,relatime,uid=1000,gid=1000,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,showexec,utf8,flush,errors=remount-ro,uhelper=udisks2)

maximus1978
Posts: 93
Joined: 2015-03-19 12:49

Re: Debian 9 grub boots to command line but works

#12 Post by maximus1978 »

justinmk85 wrote:Thanks for replying. Below is what I got:

ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

set
image is at this link:
https://imgur.com/j6RsaQV

Image
please try this...

set root=hd0,gpt1
ls /
post result please

set root=hd0,gpt2
ls /
post result please

set root=hd0,gpt3
ls /
post result please

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian 9 grub boots to command line but works

#13 Post by p.H »

maximus1978 wrote:set root=hd0
chainloader +1
boot
This is EFI boot, not BIOS boot. You must chainload an EFI executable file, not a boot sector.

Code: Select all

chainloader /EFI/debian/grubx64.efi
boot
justinmk85 wrote:boot info script:
Is that all ? Many parts are missing. Did you run the command as root ?

User avatar
Head_on_a_Stick
Posts: 14114
Joined: 2014-06-01 17:46
Location: London, England
Has thanked: 81 times
Been thanked: 132 times

Re: Debian 9 grub boots to command line but works

#14 Post by Head_on_a_Stick »

The output of

Code: Select all

# efibootmgr -v
would probably tell us most of what we need to know, I have no idea if that silly wall-of-output "boot info script" includes such a detail but I would prefer to not have to wade through that...
deadbang

maximus1978
Posts: 93
Joined: 2015-03-19 12:49

Re: Debian 9 grub boots to command line but works

#15 Post by maximus1978 »

maximus1978 wrote:
justinmk85 wrote:Thanks for replying. Below is what I got:

ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

set
image is at this link:
https://imgur.com/j6RsaQV

Image
please try this...

set root=hd0,gpt1
ls /
post result please

set root=hd0,gpt2
ls /
post result please

set root=hd0,gpt3
ls /
post result please
grub is not finding the /boot/grub/grub.cfg

root=hd0,gpt1

? Is this the EFI partition?

try

set root=hd0,gpt2

(assuming that this is the Debian partition)

configfile /boot/grub/grub.cfg

Does this bring up your menu?

It would help if you post the "ls /" commands.
Last edited by maximus1978 on 2017-11-20 06:59, edited 1 time in total.

maximus1978
Posts: 93
Joined: 2015-03-19 12:49

Re: Debian 9 grub boots to command line but works

#16 Post by maximus1978 »

p.H wrote:
maximus1978 wrote:set root=hd0
chainloader +1
boot
This is EFI boot, not BIOS boot. You must chainload an EFI executable file, not a boot sector.

Code: Select all

chainloader /EFI/debian/grubx64.efi
boot
justinmk85 wrote:boot info script:
Is that all ? Many parts are missing. Did you run the command as root ?
just verifying :)

p.H
Global Moderator
Global Moderator
Posts: 3049
Joined: 2017-09-17 07:12
Has thanked: 5 times
Been thanked: 132 times

Re: Debian 9 grub boots to command line but works

#17 Post by p.H »

Head_on_a_Stick wrote:I have no idea if that silly wall-of-output "boot info script" includes such a detail
Yes, bootinfoscript is supposed to include the output of efibootmgr -v.
maximus1978 wrote:grub is not finding the /boot/grub/grub.cfg
Indeed this is a possible cause for GRUB spawning the normal prompt (NOT the rescue prompt) instead of displaying the menu. However /boot/grub seems to be on the EFI partition itself (unlike in Debian), so I wonder why grub.cfg is not found. If the whole /boot/grub was not found then GRUB would spawn the rescue prompt.
maximus1978 wrote:root=hd0,gpt1? Is this the EFI partition?
Yes it is. See the value of $cmdpath in the output of "set".
maximus1978 wrote:try

Code: Select all

set root=hd0,gpt2
(assuming that this is the Debian partition)

Code: Select all

configfile /boot/grub/grub.cfg
Does this bring up your menu?
It will probably, but what's the use ? Just typing "exit" to quit the first GRUB from Ubuntu/Mint causes the UEFI firmware to load the next GRUB from Debian.
maximus1978 wrote:just verifying
Verify what ?
No need to verify that GRUB is in EFI mode. We already know from the value of $platform in the output of set.
If you wanted to verify if the MBR contained a GRUB BIOS boot loader, you cannot chainload it from GRUB EFI.

justinmk85
Posts: 23
Joined: 2017-11-18 18:40

Re: Debian 9 grub boots to command line but works

#18 Post by justinmk85 »

I did run bootinfoscript as root.

I will post the ls / of each later today.

I will try the set root and config file also.

justinmk85
Posts: 23
Joined: 2017-11-18 18:40

Re: Debian 9 grub boots to command line but works

#19 Post by justinmk85 »

I don't know what these partitions are (see boot info script output).

/dev/mmcblk1
/dev/mmcblk1p1 0101-07DC vfat NO_NAME

Edit... these are probably an sd card I have inserted never mind

justinmk85
Posts: 23
Joined: 2017-11-18 18:40

Re: Debian 9 grub boots to command line but works

#20 Post by justinmk85 »

maximus1978 wrote:
justinmk85 wrote:Thanks for replying. Below is what I got:

ls
(hd0) (hd0,gpt3) (hd0,gpt2) (hd0,gpt1)

set
image is at this link:
https://imgur.com/j6RsaQV

Image
please try this...

set root=hd0,gpt1
ls /
post result please

set root=hd0,gpt2
ls /
post result please

set root=hd0,gpt3
ls /
post result please

Result is here https://imgur.com/a/2cjnB

Post Reply