GRUB displays with blinking cursor and no menu entries
Linux From ScratchThis Forum is for the discussion of LFS.
LFS is a project that provides you with the steps necessary to build your own custom Linux system.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
GRUB displays with blinking cursor and no menu entries
TL;DR - I recently got my very first LFS system working (whoop whoop!) but my GRUB won't display any menu entries and only displays "GRUB" with a blinking cursor.
Firstly, I'd like to mention that I've tried using both ext2 and vfat file systems for my GRUB partition, and I've also tried both legacy and UEFI versions of GRUB. Neither of the two work, however I am able to boot into my LFS from the GRUB command line from a live USB with no file system, or partition mounting issues. Everything works as expected so I assume it has something to do with an incorrectly configured grub.cfg?
When setting up the legacy option as presented in the LFS handbook and using the vfat file system for the GRUB partition, I end up getting the "Welcome to GRUB" message but that will quickly be followed by "Unknown file system" right below it. I then tried using an ext2 file system on the GRUB partition and I wouldn't get the file system error, but instead my PC would fall into an endless loop at boot where the "GRUB loading..." message would display followed by the PC rebooting itself.
I then switched to using the UEFI mode for my GRUB as detailed in the BLFS handbook and I don't get any file system or looping reboots (regardless of whether I choose vfat or ext2 for my EFI partition) when I reboot the PC. All that is displayed is "GRUB" with a blinking cursor. When I hit enter it would then go to the next available bootloader instead (in my case the live USB.)
I've searched the internet high and low for solutions and none of them work. I've read through all the GRUB man documentation as well as documentation provided from various sites, and yet nothing solves my problem.
Like I said, I'm able to boot with absolutely no errors from the live USB GRUB command line.
I'm using a GPT partition table on an SSD and HDD and this is the setup:
set default=0
set timeout=0
insmod part_gpt
insmod ext2
set root=(hd0,gpt1)
menuentry "GNU/Linux LFS (5.13.4)" {
linux /vmlinuz-5.13.4-lfs-10.1 root=/dev/sda4 ro
}
BootCurrent: 0005
Timeout: 1 seconds
BootOrder: 0001,0005,0004,0003,0002
Boot0001* Hard DriveCould not parse device path: Invalid argument
Side note: when I install Debian 11 at /dev/sda9 it uses the same efi and swap partitions as laid out in /dev/sda2 and /dev/sda3 but somehow I'll get a working GRUB menu but only with Debian's menu entry displayed. When I run grub-install --bootloader-id=lfs --recheck /dev/sda from my LFS system my GRUB breaks again.
Hi
If your using a GPT partition with legacy grub you will need a small bios partition at the begining of the drive not sure how big 8mb maybe.
I believe 8mb may work best to use 100mb as per documentation. Seems grub is getting rather large Unless you use the patched version. And the kernel vmlinuz and initrd.img seem to be getting bigger
I believe 8mb may work best to use 100mb as per documentation
Need at least a 1mb partition flagged as bios boot/bios grub. It is to replace the 1mb that exist between the mbr and first partition on a mbr drive that doesn't exist on a gpt drive. Grub uses that 1mb to store part of the grub boot code when booting in legacy/csm mode. If you use the lilo bootloader this partition isn't needed.
Last edited by colorpurple21859; 08-30-2021 at 08:22 PM.
Why do you tell it to boot your /boot partition as the / it will never find the files needed there.. Should be 4 perhaps as it does not start the counting at 0 but 1 for the first partition in my memory serves me. And checking the entry I made for memtest on my spare machine which uses the EFI I am correct.
Code:
root@zeus-H370M:~# fdisk -l /dev/sda
Disk /dev/sda: 111.81 GiB, 120034123776 bytes, 234441648 sectors
Disk model: KINGSTON SH103S3
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: D8A96088-5191-480A-9498-EE006223808B
Device Start End Sectors Size Type
/dev/sda1 40 409639 409600 200M EFI System
/dev/sda2 409640 234441614 234031975 111.6G Linux filesystem
root@zeus-H370M:~# cat /etc/grub.d/40_custom
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry 'MemTest86' {
insmod part_gpt
insmod fat
set root='hd0,gpt1'
chainloader ($root)/EFI/memtest86/BOOTX64.efi
}
May want to change that ext2 to ext4 as well.
Edit: perhaps the hd0,gpt2 to be pointing to the /boot/efi as the place to find GRUB with its configuration files.
Why do you tell it to boot your /boot partition as the / it will never find the files needed there..
the "set root=" is normally set within the menu entry for the location of the partition that the kernel is located on, however with just one menu entry setting the "set root=" before the menu entry works just as well, and has nothing to do with the prefix setting that is set when grub-install is invoked that determines where grub looks for the grub.cfg file.
Last edited by colorpurple21859; 08-30-2021 at 11:54 PM.
the "set root=" is normally set within the menu entry for the location of the partition that the kernel is located on, however with just one menu entry setting the "set root=" before the menu entry works just as well, and has nothing to do with the prefix setting that is set when grub-install is invoked.
Well there we are, something else about GRUB I never wanted to know, Christ I dislike the program if it does not show in my postings about it.
HappyTux, I have yet to figure out how grub-install sets where it initially looks for the grub.cfg file when grub-install is ran without any flags set.
On legacy systems it is /boot/grub, however on uefi systems some distros it is /boot/grub and others it is the efi partition where as you have pointed out a grub.cfg file is used to set the prefix back to /boot/grub,
Last edited by colorpurple21859; 08-31-2021 at 12:14 AM.
HappyTux, I have yet to figure out how grub-install sets where it initially looks for the grub.cfg file when grub-install is ran without any flags set.
On legacy systems it is /boot/grub, however on uefi systems some distros it is /boot/grub and others it is the efi partition where as you have pointed out a grub.cfg file is used to set the prefix back to /boot/grub,
Tell it where your files are located with the option passed there is good example in this page showing many options to give to leave it no choice but to use your config files.
TL;DR - I recently got my very first LFS system working (whoop whoop!) but my GRUB won't display any menu entries and only displays "GRUB" with a blinking cursor.
Firstly, I'd like to mention that I've tried using both ext2 and vfat file systems for my GRUB partition, and I've also tried both legacy and UEFI versions of GRUB. d DriveCould not parse device path: Invalid argument
If you are booting a GPT disk in legacy/mbr mode, your BIOS boot partition should not carry a filesystem at all. The GRUB boot stub in the mbr finds the next stage of GRUB by its physical address, which therefore needs to remain constant. Filesystems tend to get fscked and rearranged.
If you are booting a GPT disk in legacy/mbr mode, your BIOS boot partition should not carry a filesystem at all. The GRUB boot stub in the mbr finds the next stage of GRUB by its physical address, which therefore needs to remain constant. Filesystems tend to get fscked and rearranged.
So true it is why I like the way my Pi 4 boots, if the named files are there in the EFI partition or simply normal fat partition with them on it, it proceeds to boot. Then it looks for the LABEL of the partitions and loads that for the needed next steps. Great way of doing it any disk I want for a backup it is simply a matter of making sure the labels are set proper and an rsync of two partitions and I have working bootable clone MBR or GPT does not matter, with no damn GRUB to mess it up if you forget to edit them needed files.
I believe 8mb may work best to use 100mb as per documentation
Need at least a 1mb partition flagged as bios boot/bios grub. It is to replace the 1mb that exist between the mbr and first partition on a mbr drive that doesn't exist on a gpt drive. Grub uses that 1mb to store part of the grub boot code when booting in legacy/csm mode. If you use the lilo bootloader this partition isn't needed.
look this is what you need with grub
[CODE]running rhel >= 7.6 on work servers I install linux as follows keeping it as simple as possible.
Say all you want I told you the trueth but does this help the OP. fact is everyone default to 100 mb /boot/UEFI
if it is Slackware elio same thing so grub can fit. if it is /boot/UEFI/grub.cfg
the partition 100 mb is for future reasons. How many Kernel do you want to boot.
Code:
Grub uses that 1mb to store part of the grub boot code when booting
that is the efi partition if one is booting in uefi mode, not the partition I'm talking about that is only needed when using the grub bootloader to boot a gpt disk in legacy/csm mode.
Quote:
but does this help the OP.
No it doesn't as the op is setup to boot in uefi mode. Still waiting on input from op about the output of the command set at the grub prompt.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.