You are not logged in.

#1 2023-03-17 17:32:15

timiimit
Member
Registered: 2023-03-17
Posts: 4

[SOLVED] Grub menu is empty

What happened and what I tried
I had a working system. I think I didn't use a separate boot partition, at least I didn't have any partition mounted at /boot. I have a dual boot with arch and windows if that's relevant.

I was trying to get something to work and to do so I found that I was supposed to add a kernel parameter to grub. So I edited

/etc/default/grub

and ran

grub-mkconfig -o /boot/grub/grub.cfg

I was expecting to boot with a new parameter, but instead linux failed to boot. I undid the change in /etc/default/grub and ran grub-mkconfig again but arch still failed to boot.

I tried to completely setup grub again. I used arch-choot to access my normal root partition and used

grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB

while having EFI partition mounted at /boot and ran grub-mkconfig again. There are no errors, grub-mkconfig only mentions that os-prober won't be used which is fine. I also noticed that the UEFI boot entry "grub_uefi" which I always used to boot into linux is now missing. I found that name in EFI partition /EFI/grub_uefi.
I checked the generated /boot/grub/grub.cfg and found a line containing a seach command with UUID of my root arch partition as argument.

Current state:
UEFI boot entries:
- Windows Boot Manager
- GRUB
... other stuff...

in GRUB there is only one entry to go to UEFI settings.

I'm not sure how to continue with troubleshooting this. When I installed grub originally about 1 year ago, I didn't really understand what made it work and have avoided doing anything with grub since, specifically because I was afraid of something like this happening.

Last edited by timiimit (2023-03-20 10:49:37)

Offline

#2 2023-03-17 18:00:42

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [SOLVED] Grub menu is empty

Are the kernel and initramfs on the ESP?

Offline

#3 2023-03-17 21:08:40

1729absr
Member
Registered: 2021-05-16
Posts: 1

Re: [SOLVED] Grub menu is empty

Can you clarify the inconstancy in the following statements :

timiimit wrote:

I think I didn't use a separate boot partition, at least I didn't have any partition mounted at /boot....... I tried to completely setup grub again. I used arch-choot to access my.... while having EFI partition mounted at /boot and ran grub-mkconfig again.

Which EFI partition are you talking about? Did you create a new EFI partition or is it the EFI partition of the other operating system you have?

Because if you installed GRUB on another EFI partition you need to add the new partition UUID in /etc/fstab.

Although I do not understand why GRUB stopped working in the first place, for that would need more details on how you installed GRUB.

Offline

#4 2023-03-17 22:15:58

timiimit
Member
Registered: 2023-03-17
Posts: 4

Re: [SOLVED] Grub menu is empty

Scimmia wrote:

Are the kernel and initramfs on the ESP?

assuming ESP is EFI system partition, the answer is i dont know. i assume those are the .img files? i had them before on my root partition in /boot but they are not in ESP.

ESP contains only EFI and grub directories.
my arch root partition contains those directories plus amd-ucode.img, initramfs-linux.img, initramfs-fallback.img, intel-ucode.img and vmlinuz-linux at /boot

Last edited by timiimit (2023-03-17 22:37:29)

Offline

#5 2023-03-17 22:22:09

timiimit
Member
Registered: 2023-03-17
Posts: 4

Re: [SOLVED] Grub menu is empty

1729absr wrote:

Can you clarify the inconstancy in the following statements :

timiimit wrote:

I think I didn't use a separate boot partition, at least I didn't have any partition mounted at /boot....... I tried to completely setup grub again. I used arch-choot to access my.... while having EFI partition mounted at /boot and ran grub-mkconfig again.

Which EFI partition are you talking about? Did you create a new EFI partition or is it the EFI partition of the other operating system you have?

Because if you installed GRUB on another EFI partition you need to add the new partition UUID in /etc/fstab.

Although I do not understand why GRUB stopped working in the first place, for that would need more details on how you installed GRUB.

i always had an EFI partition, but that partition was never mounted when i was using linux. I didn't create a new one, i'm not sure how or what created that partition. i never had any partition mounted at /boot, so there was no entry for that in /etc/fstab. But now i was trying to set it up so that that would happen, because i have no clue how i managed to install it previously such that i didn't have a separate partition.

Offline

#6 2023-03-17 23:26:51

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,466

Re: [SOLVED] Grub menu is empty

timiimit wrote:
Scimmia wrote:

Are the kernel and initramfs on the ESP?

assuming ESP is EFI system partition, the answer is i dont know. i assume those are the .img files? i had them before on my root partition in /boot but they are not in ESP.

ESP contains only EFI and grub directories.
my arch root partition contains those directories plus amd-ucode.img, initramfs-linux.img, initramfs-fallback.img, intel-ucode.img and vmlinuz-linux at /boot

So when you mounted the ESP to /boot, you hid all of those and grub-mkconfig had no way of finding them. You need to decide if you want it at /boot or not. If you don't, mount it somewhere else and redo the bootloader installation and configuration. If you do, you need to reinstall the microcode and kernels so they get put there.

Last edited by Scimmia (2023-03-17 23:35:42)

Offline

#7 2023-03-19 07:48:49

timiimit
Member
Registered: 2023-03-17
Posts: 4

Re: [SOLVED] Grub menu is empty

Thanks, i managed to fix it.

When i installed grub on ESP and updated config on my root partition, I got it to boot.

I just have one more question because I'm interested in how grub actually works. Does grub search for grub.cfg on all partitions each time it starts? I fail to see any other way in which installed grub (on ESP) is "connected" with my root partition. I admit that i likely have grub installed on both locations, but i'm not sure which one is used.

Offline

#8 2023-03-19 19:41:27

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [SOLVED] Grub menu is empty

Grub searches in whatever location /boot/grub is on by default when it was initially installed. You can pass a parameter

--boot-directory=DIR

during grub-install to manipulate that location appropriately.

Offline

Board footer

Powered by FluxBB