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

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

Re: Debian 9 grub boots to command line but works

#21 Post by justinmk85 »

Head_on_a_Stick wrote: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...

root@debian:/home/justin# efibootmgr -v
BootCurrent: 0000
Timeout: 2 seconds
BootOrder: 0000,0001,0002,2001
Boot0000* debian HD(1,GPT,75974d51-c29f-4c59-b617-129a3385fc10,0x800,0x100000)/File(\EFI\DEBIAN\GRUBX64.EFI)
Boot0001* \EFI\Ubuntu\grubx64.efi HD(1,GPT,75974d51-c29f-4c59-b617-129a3385fc10,0x800,0x100000)/File(\EFI\UBUNTU\GRUBX64.EFI)
Boot2001* EFI USB Device RC
root@debian:/home/justin#

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

Re: Debian 9 grub boots to command line but works

#22 Post by justinmk85 »

maximus1978 wrote: 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.
set root=hd0,gpt2 and configfile /boot/grub/grub.cfg did bring up the main grub menu for debian.

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

Re: Debian 9 grub boots to command line but works

#23 Post by justinmk85 »

p.H wrote:
maximus1978 wrote: 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
this chainloader did bring up the grub menu https://imgur.com/a/jTNTG

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

Re: Debian 9 grub boots to command line but works

#24 Post by maximus1978 »

justinmk85 wrote:
maximus1978 wrote: 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.
set root=hd0,gpt2 and configfile /boot/grub/grub.cfg did bring up the main grub menu for debian.
I think the issue is with prefix and root.

Please try....

set prefix=(hd0,gpt2)/boot/grub
set root=hd0,gpt2

press escape key

What happens?
Does it bring up the menu?

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

Re: Debian 9 grub boots to command line but works

#25 Post by justinmk85 »

maximus1978 wrote:
justinmk85 wrote:
maximus1978 wrote: 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.
set root=hd0,gpt2 and configfile /boot/grub/grub.cfg did bring up the main grub menu for debian.
I think the issue is with prefix and root.

Please try....

set prefix=(hd0,gpt2)/boot/grub
set root=hd0,gpt2

press escape key

What happens?
Does it bring up the menu?
It didn't bring up the menu after the esc key it stayed on the command line page
https://i.imgur.com/od1QQo9.jpg

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

Re: Debian 9 grub boots to command line but works

#26 Post by maximus1978 »

The prefix variable is defaulting to...

(hd0,gpt1)/grub

hd0,gpt1 is the efi partition
There is no directory grub in that efi partition?
please try in this order

set root=hd0,gpt2
save_env root

set prefix=(hd0,gpt2)/boot/grub
save_env prefix

Please reboot and let me know the result.

If the command prompt comes back up, please type "set" and post the results.
Last edited by maximus1978 on 2017-11-21 15:01, edited 1 time in total.

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

Re: Debian 9 grub boots to command line but works

#27 Post by maximus1978 »

justinmk85 wrote:
maximus1978 wrote: 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.
set root=hd0,gpt2 and configfile /boot/grub/grub.cfg did bring up the main grub menu for debian.
Do these exact steps again to bring up the menu.
Then type c to go back to the command prompt.
type "set"

Please post the results of the set command.

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

Re: Debian 9 grub boots to command line but works

#28 Post by justinmk85 »

maximus1978 wrote:
justinmk85 wrote:
maximus1978 wrote: 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.
set root=hd0,gpt2 and configfile /boot/grub/grub.cfg did bring up the main grub menu for debian.
Do these exact steps again to bring up the menu.
Then type c to go back to the command prompt.
type "set"

Please post the results of the set command.
https://imgur.com/gallery/08eKg

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

Re: Debian 9 grub boots to command line but works

#29 Post by justinmk85 »

maximus1978 wrote:The prefix variable is defaulting to...

(hd0,gpt1)/grub

hd0,gpt1 is the efi partition
There is no directory grub in that efi partition?
please try in this order

set root=hd0,gpt2
save_env root

set prefix=(hd0,gpt2)/boot/grub
save_env prefix

Please reboot and let me know the result.

If the command prompt comes back up, please type "set" and post the results.
Command line did come back up
https://imgur.com/gallery/XHHZH
https://imgur.com/gallery/Lva4Q

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

Re: Debian 9 grub boots to command line but works

#30 Post by maximus1978 »

justinmk85 wrote:
maximus1978 wrote:The prefix variable is defaulting to...

(hd0,gpt1)/grub

hd0,gpt1 is the efi partition
There is no directory grub in that efi partition?
please try in this order

set root=hd0,gpt2
save_env root

set prefix=(hd0,gpt2)/boot/grub
save_env prefix

Please reboot and let me know the result.

If the command prompt comes back up, please type "set" and post the results.
Command line did come back up
https://imgur.com/gallery/XHHZH
https://imgur.com/gallery/Lva4Q
Please try in this order.

set root=hd0,gpt2
set prefix=(hd0,gpt2)/boot/grub

save_env root
save_env prefix

Please reboot

Let me know what happens.

if command prompt comes back, type set

post the results please

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

Re: Debian 9 grub boots to command line but works

#31 Post by justinmk85 »

maximus1978 wrote:
justinmk85 wrote:
maximus1978 wrote:The prefix variable is defaulting to...

(hd0,gpt1)/grub

hd0,gpt1 is the efi partition
There is no directory grub in that efi partition?
please try in this order

set root=hd0,gpt2
save_env root

set prefix=(hd0,gpt2)/boot/grub
save_env prefix

Please reboot and let me know the result.

If the command prompt comes back up, please type "set" and post the results.
Command line did come back up
https://imgur.com/gallery/XHHZH
https://imgur.com/gallery/Lva4Q
Please try in this order.

set root=hd0,gpt2
set prefix=(hd0,gpt2)/boot/grub

save_env root
save_env prefix

Please reboot

Let me know what happens.

if command prompt comes back, type set

post the results please
No errors but went to command line after reboot
Set https://imgur.com/gallery/v9udb

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

Re: Debian 9 grub boots to command line but works

#32 Post by maximus1978 »

Please boot into Debian system.

Post the output of...

Code: Select all

cat /etc/fstab
Post the output of......

Code: Select all

fdisk -l
Is the main hard drive "/dev/sda"?

If it is, then do this next step.

Code: Select all

[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"
if this is the result...("EFI boot on HDD")

Code: Select all

grub-install /dev/sda
update-grub
Please reboot.

Let me know the result.

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

Re: Debian 9 grub boots to command line but works

#33 Post by justinmk85 »

maximus1978 wrote:Please boot into Debian system.

Post the output of...

Code: Select all

cat /etc/fstab
Post the output of......

Code: Select all

fdisk -l
root@debian:/home/justin# cat /etc/fstab
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/mmcblk0p2 during installation
UUID=8e77bcd0-bb33-4549-a329-5abfed7e0a8c / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/mmcblk0p1 during installation
UUID=6E89-3EA0 /boot/efi vfat umask=0077 0 1
# swap was on /dev/mmcblk0p3 during installation
UUID=cc96a754-5db9-4a3d-8bf6-62512b7e5f03 none swap sw 0 0
--------------------------

root@debian:/home/justin# fdisk -l
Disk /dev/mmcblk0: 29.1 GiB, 31268536320 bytes, 61071360 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: A47A49D4-CC6A-4DD8-A859-2ABEB9825947

Device Start End Sectors Size Type
/dev/mmcblk0p1 2048 1050623 1048576 512M EFI System
/dev/mmcblk0p2 1050624 57120767 56070144 26.8G Linux filesystem
/dev/mmcblk0p3 57120768 61069311 3948544 1.9G Linux swap

Disk /dev/mmcblk0boot1: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes

Disk /dev/mmcblk0boot0: 4 MiB, 4194304 bytes, 8192 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
maximus1978 wrote:Is the main hard drive "/dev/sda"?
The main hd is mmcblk0 (toshiba cl15t laptop with emmc sd drive)

There are 2 boot partitions in the fdisk output... boot0 and boot1... just noticed that

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

Re: Debian 9 grub boots to command line but works

#34 Post by justinmk85 »

maximus1978 wrote:Is the main hard drive "/dev/sda"?

If it is, then do this next step.

Code: Select all

[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"
if this is the result...("EFI boot on HDD")

Code: Select all

grub-install /dev/sda
update-grub
Please reboot.

Let me know the result.
root@debian:/home/justin# [ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"
EFI boot on HDD
root@debian:/home/justin# grub-install /dev/mmcblk0
Installing for x86_64-efi platform.
Installation finished. No error reported.
root@debian:/home/justin# update-grub
Generating grub configuration file ...
Found background image: /usr/share/images/desktop-base/desktop-grub.png
Found linux image: /boot/vmlinuz-4.9.0-4-amd64
Found initrd image: /boot/initrd.img-4.9.0-4-amd64
Adding boot menu entry for EFI firmware configuration
done
root@debian:/home/justin#

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

Re: Debian 9 grub boots to command line but works

#35 Post by justinmk85 »

maximus1978 wrote: Please reboot.

Let me know the result.
Rebooted and the command line still came up.

Post Reply