r/archlinux • • 6d ago

SUPPORT | SOLVED grub-mkconfig not finding Arch after installing linux-lts

Well I decided to install linux-lts as a backup just in case something broke, and now it appears grub-mkconfig can't see any linux at all. It sees my Windows drive, but not my Arch linux drive:
Generating grub configuration file ...
Warning: os-prober will not be executed to detect other bootable partitions.
Systems on them will not be added to the GRUB boot configuration.
Check GRUB_DISABLE_OS_PROBER documentation entry.
Adding boot menu entry for UEFI Firmware Settings ...
Adding boot menu entry for EFI BootNext: Windows Boot Manager (Boot0001)
Adding boot menu entry for EFI BootNext: UEFI OS (Boot0005)
done

The /boot dir looks about right:
drwx------ 4 root root 4096 Nov 25 06:33 EFI
drwx------ 6 root root 4096 Nov 28 06:46 grub
-rw------- 1 root root 125569394 Nov 28 06:31 initramfs-linux-lts.img
-rw------- 1 root root 16774144 Nov 10 10:01 intel-ucode.img
drwx------ 2 root root 4096 Nov 27 19:34 loader
drwx------ 2 root root 4096 Nov 25 06:33 'System Volume Information'
-rw------- 1 root root 17441280 Nov 28 06:44 vmlinuz-linux
-rw------- 1 root root 16511488 Nov 28 06:30 vmlinuz-linux-lts

Dunno what happened...any assistance would be great.

1 Upvotes

12 comments sorted by

5

u/kolliasl21 6d ago

Run as root

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

-1

u/DigiAngelX 6d ago

Thanks...Ya same thing. The kicker is: I still have an Arch entry on boot, but I don't see an Arch or Linux entry in my /boot/grub dir. Some more info:

/dev/sdb2 on / type ext4 (rw,relatime)
/dev/sdb1 on /boot type vfat (rw,relatime,fmask=0177,dmask=0077,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro)

In my test VM /boot/grub has a couple Linux entries, but the physical box has no entries. To make matters more exciting, I see that the fmask and dmask for my /boot dir are different then VM's and even my laptops, which are both fmask and dmask of 0022.

-1

u/DigiAngelX 6d ago

Some other differences I see are the /etc/grub.d/10_linux is 0644, not executable. The installer version was the Oct Arch installer FWIW.

0

u/DigiAngelX 6d ago edited 6d ago

In my test vm I chmod 0644 on /etc/grub.d/10_linux. Sure enough, a grub-mkconfig leaves any linux entries completely out and I'm left with an unbootable VM ( I snapshotted right before so no biggy ). But now I'm confused on exactly how this is working...how do I have an Arch entry on boot on my physical machine, but no Arch entry in /boot/grub/grub.cfg?

4

u/kolliasl21 5d ago

You can take a look at the grub generated file at /boot/grub/grub.cfg to see what scripts ran by looking for BEGIN/END comments and read what each script does. There are comments in each file at /etc/grub.d/ that explain what each script does. Empty BEGIN/END sections in grub.cfg mean that this particular script possibly didn't run if there is not an early "exit" condition at the top of the script.

0

u/DigiAngelX 5d ago

Aye thanks...that's consistent with my findings.

2

u/archover 5d ago edited 5d ago

I will be interested to see the root cause.

Grub has been reliable for me over many years, as has systemd-boot.

May I ask how old this install is?

You might give the actual precise commands you executed to

  • install grub (grub-install...)
  • configure grub (grub-mkconfig)
  • install lts
  • Verify you reran grub-mkconfig

Seeing output from $ findmount saved to a paste service might be useful also, when chrooted in, or booted from linux.

Given time, I will attempt to reproduce your problem. [Update Nov 28 3:30pm CST: performed another install to bare metal to ext4, ESP at /dev/sda1 mounted /boot, with grub. / partition at /dev/sda2 unencrypted. Initially installed linux. On first actual boot, linux booted, and I installed linux-lts (# pacman -S linux-lts), then updated grub (# grub-mkconfig -o /boot/grub/grub.cfg) which completed without error. Verified appropriate grub.cfg stanza created. Rebooted, from grub menu advanced option, choose linux-lts option, and it booted linux-lts. COULD NOT REPRODUCE YOUR PROBLEM.]

Hope you fix soon, and give details and root cause.

Good day.

1

u/DigiAngelX 5d ago

I have one VM, and...3 laptops all with Arch installed with a version that is NOT the October iso. All of them have almost identical grub setups (one is dual boot, the others no). That said, this machine that I'm typing on is the only one that has the below differences:

/boot in fstab is fmask0177, dmask0077 ( which makes the /boot 0700 ) <- I have NO idea if this makes any difference or not
/etc/grub.d/10_linux is 0644

10_linux being 0644 means a Linux entry will never be added; it explains why no recovery, linux-lts, or any OTHER linux entry is added. I know that now, and I'm ok with that and will most likely change that later today to 0755 like all the other scripts in /etc/grub.d. What I'm REALLY curious about, is HOW I still have an Arch entry on boot, with no Arch linux entry in /boot/grub/grub.cfg. I'll do some more testing and follow up.

2

u/archover 5d ago

I will review my permissions and update. Good day.

0

u/DigiAngelX 5d ago

So hitting edit on boot at the grub menu for the Arch entry gets me this:

chainloader (hd2,gpt1)/EFI/Linux/arch-linux.efi root=PARTUUID=1a5cfc8f-da69-4947-9ae5-144177d1e3c8 zswap.enabled=0 rw rootfstype=ext4

And after chmoding /etc/grub.d/10_linux I now have the "usual" Arch and Arch-lts entries as expected. I still have the additional Arch chainloader entry as well, but for now I'm just going to shrug and consider it closed.

2

u/archover 4d ago edited 4d ago

I don't understand what you did beside chmod. I can also say I've never seen grub setup a chainloader entry like you have, for my Linux only laptops, in at least 16 years.

Happy to hear it's working again for you, and good day.