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

 

 

 

Trouble with grub - not sure what caused it

If none of the specific sub-forums seem right for your thread, ask here.
Post Reply
Message
Author
750-ml
Posts: 5
Joined: 2022-11-21 13:12
Has thanked: 2 times

Trouble with grub - not sure what caused it

#1 Post by 750-ml »

This is my first post on this forum - apologies in advance for any newbie faux pas

Here's my system:
  • Dell Latitude e6410 laptop
  • Dual boot: Win 7 & Debian 10
fdisk -l yields:
Device Boot Start End Sectors Size Id Type
/dev/sda1 * 2048 206847 204800 100M 7 HPFS/NTFS/exFAT
/dev/sda2 206848 251139759 250932912 119.7G 7 HPFS/NTFS/exFAT
/dev/sda3 251140094 312580095 61440002 29.3G 5 Extended
/dev/sda5 251140096 304476159 53336064 25.4G 83 Linux
/dev/sda6 304478208 312580095 8101888 3.9G 82 Linux swap / Solaris

Here's what I experience:
First, I should say that this laptop is not my "daily driver"; I use Debian to explore ardiuno projects & learn about linux , RPi etc. & basically expand my horizons (many years ago I worked with a unix-based software healthcare informatics company but was never a unix guru). I use Win 7 to interface with my laser engraving hardware. For years when I powered on the laptop I would see the expected text menu allowing me to select between starting Debian or Win 7. Most of the time the laptop is simply turned off.

Now, when I turn on the laptop I briefly see a the top left of the screen "Welcome to Grub", but within 1/2 a second the screen is filled with random horizontal lines that seem to scroll and no legible print. I know that in the background the menu items still exist because I can use the [Down] arrow to move to the bottom of the list where the Windows 7 selection is located and Win 7 will boot. Alternatively, if I leave the menu selection at the default (top) selection, Debian boots after the timeout.

I have been reading/searching to see if others have encountered this, but haven't come across any exactly similar experience. I've also been reading https://wiki.debian.org/GrubEFIReinstall. The trouble is that when I check

[ -d /sys/firmware/efi ] && echo "EFI boot on HDD" || echo "Legacy boot on HDD"

the response is "Legacy boot on HDD" and the article does not lead to any solutions if that is the case.

Furthermore, I seem to have come to understand that original grub (grub 1?) used a file called "menu.lst" but with grub 2 that file is deprecated in favor of "grub.cfg". There is no instance of a "menu.lst" file that I can find on my system, but there is a "grub.cfg" file.

Thanks for any help / direction to restore the bootloader w/o requiring a reinstall of Debian.

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

Re: Trouble with grub - not sure what caused it

#2 Post by p.H »

750-ml wrote: 2022-11-21 14:28 I've also been reading https://wiki.debian.org/GrubEFIReinstall
Irrelevant. Your installation is obviously not set up for EFI boot (no EFI system partition), although this model supports it IIRC.
750-ml wrote: 2022-11-21 14:28 the screen is filled with random horizontal lines that seem to scroll and no legible print.
Maybe a graphic driver issue. You can try to disable graphic mode.
Edit /etc/default/grub and uncomment

Code: Select all

GRUB_TERMINAL=console
Run update-grub and reboot.

Alternatively, you can try to force the resolution instead of letting GRUB select it automatically.
Edit /etc/default/grub and uncomment and modify

Code: Select all

GRUB_GFXMODE=640x480
Run update-grub and reboot.

750-ml
Posts: 5
Joined: 2022-11-21 13:12
Has thanked: 2 times

Re: Trouble with grub - not sure what caused it

#3 Post by 750-ml »

Irrelevant. Your installation is obviously not set up for EFI boot (no EFI system partition)
While this true, there is no "GrubBIOSReinstall" page, nor is there a link on the page pointing to where one with legacy boot might go. I did go into BIOS and confirmed that EFI is an option, but I'm a bit hesitant to alter BIOS without explicit instructions.
Maybe a graphic driver issue. You can try to disable graphic mode.
Certainly this came to my mind as well--though it has to be said that the laptop exhibits no other graphics issues in neither Debian nor Win 7. I did execute your instruction to comment out [GRUB_TERMINAL=console], update-grub & reboot and the text-based menu appears properly. Thank you.

I noticed while in the /etc/default/grub file that there is a setting called GRUB_CMDLINE_LINUX_DEFAULT="quiet" . When the grub bootloader worked as intended (/works as intended: the graphical boot menu has worked once or twice since the problem started) the momentary text-based "Welcome to Grub!" message does not appear. Not sure if that setting in the grub file correlates to the hiding of the welcome message, but from my MSDOS days (yeah...I know) I could construe that it might.

Question: in your opinion, since I have nothing of value currently stored with my Debian OS (and I can obviously save off anything I might find of value later) if I wiped the sector where Debian 10 lives and do a fresh install of Debian 11 would it correct the current issue?

Again, thanks for your help.
R

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

Re: Trouble with grub - not sure what caused it

#4 Post by p.H »

750-ml wrote: 2022-11-22 13:13 I did go into BIOS and confirmed that EFI is an option, but I'm a bit hesitant to alter BIOS without explicit instructions.
If you want to switch to EFI boot you need to
- create a partition with "EFI system partition" type and FAT format
- mount it on /boot/efi
- install grub packages for EFI boot (grub-efi-amd64)
- select install in the removable media path
750-ml wrote: 2022-11-22 13:13 the text-based menu appears properly
Did you try GRUB_GFXMODE ?
750-ml wrote: 2022-11-22 13:13 I noticed while in the /etc/default/grub file that there is a setting called GRUB_CMDLINE_LINUX_DEFAULT="quiet" .
Irrelevant. This is for the kernel, not GRUB.
750-ml wrote: 2022-11-22 13:13 the graphical boot menu has worked once or twice since the problem started
Do you mean the problem does not happen at every boot ?
750-ml wrote: 2022-11-22 13:13 if I wiped the sector where Debian 10 lives and do a fresh install of Debian 11 would it correct the current issue?
Wiping Debian is overkill. If GRUB is corrupted (but I doubt it),

Code: Select all

grub-install /dev/sda
update-grub
should be enough and fix it.

750-ml
Posts: 5
Joined: 2022-11-21 13:12
Has thanked: 2 times

Re: Trouble with grub - not sure what caused it

#5 Post by 750-ml »

grub-install /dev/sda
update-grub
made no change to the problem. After "grub-install /dev/sda", I commented out "GRUB_TERMINAL=console", performed "update-grub", then rebooted; the problem remains.
Do you mean the problem does not happen at every boot ?
That is correct. IIRC, the boot menu appeared correctly 2 or 3 times in the perhaps dozen+ times I've turned on the laptop during the last week before I enabled "GRUB_TERMINAL=console".

I enabled "GRUB_GFXMODE 640X480", performed "update-grub", rebooted - and the graphical menu appeared correctly in the 640X480 resolution. I'll now simply adjusted to one of the other resolutions native to the laptop.

Again, thanks for the time you've spent helping me resolve my minor issue.

750-ml
Posts: 5
Joined: 2022-11-21 13:12
Has thanked: 2 times

Re: Trouble with grub - not sure what caused it

#6 Post by 750-ml »

I've altered the screen resolutions to several different settings based on some options in "Display settings". I noticed that when I selected a setting that grub does not like I get the 'screen is filled with random horizontal lines that seem to scroll and no legible print' result. Maybe that's a clue. Anyway...

I've set screen resolution for the grub bootloader via "GRUB_GFXMODE 1024X768" and the menu system appears correctly. This is where I'll leave it.

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

Re: Trouble with grub - not sure what caused it

#7 Post by p.H »

Tip: at the GRUB menu, press "c" to enter the GRUB shell and type "videoinfo" to list available resolutions.

750-ml
Posts: 5
Joined: 2022-11-21 13:12
Has thanked: 2 times

Re: Trouble with grub - not sure what caused it

#8 Post by 750-ml »

press "c" to enter the GRUB shell and type "videoinfo"
Thanks for that! Just to try: I found thru doing what you suggested that (supposedly) 1600X900 is/was an acceptable resolution--and the next finer resolution listed after 1024X768--so I tested it. It was a no-go, so I reverted to 1024X768 which is perfectly fine. At this point it's academic; the bootloader works in graphics mode as expected.

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

Re: Trouble with grub - not sure what caused it

#9 Post by p.H »

750-ml wrote: 2022-11-23 18:01 (supposedly) 1600X900 is/was an acceptable resolution
Does the screen really support such resolution (in the Linux desktop for example) ?

Post Reply