After install cannot boot

Hello to all,

I had installed Alma LInux but cannot boot into the new kernel, it say device error. I have ubuntu installed on the same hard disk, How to remove the ubuntu completely?

Please help me on this.

You’ll need to supply more information. Where in the boot sequence does it give the error? What EXACTLY is/are the error message(s).
Once you have Alma booting, then you will be able to reinitialise the Ubuntu system. for the moment I’d not bother about it and concentrate on sorting out the booting issue.

I do agree with Martin; solve issue first, clean up later.

All the filesystems that contain only Ubuntu content are “trivial”; just remove their partitions from partition table(s). (Obviously, you need to know.)

If you have set Alma to mount those filesystem, say in /etc/fstab, then you have to clean those references too.

EFI probably has Ubuntu boot entry in NVRAM. You remove it in EFI. The entry points to Ubuntu’s boot loader in ESP (EFI System Partition). Luckily, each vendor should have separate subdirectory in ESP, so cleaning there is quite easy.

The boot sequence is in the first stage of when i press the enter key, it directly prompt me the error and then it disappear.

The latest update here:
When i try to boot into Alma Linux, it drop to bootloader grub command prompt waiting for me to load the kernel.

I don’t know how to fix it. Please help. Thanks.

Sounds like grub.conf or BLS entries have been wiped/corrupted.

Boot with installer. It should offer a “rescue” mode that mounts filesystems from disk and allows you to chroot a shell session in. Then regenerate boot menu (with grub2-mkconfig).

I tried boot with rescue mode.
so I issue this command grub2-install /dev/sda but it prompt error /usr/lib/grub/x86_64-efi/modinfo.sh doesn’t exist.

How to solve this problem?

Please help.

Anyone please help me on this matter.

Odd. When I go to /usr/lib/grub on my running Alma box I cannot see a x86_64-efi directory, only i386-pc and modinfo.sh is in there. I think you need to heed Jlehtone’s advice and look closely at any NVRAM. My machine here is quite old, simple and domestic so I don’t have problems with it trying to be to clever! In my last job I do recall problems with IBM/Lenovo kit not booting in the way you expect.

I have EFI-based installation (CentOS Linux 8 migrated to AlmaLinux) and package grub2-pc-modules, which provides content of /usr/lib/grub/i386-pc/ is installed.

According to dnf provides /usr/lib/grub/\*there is package

grub2-efi-x64-modules-1:2.02-106.el8.alma.noarch : Modules used to build custom grub.efi images
Repo        : baseos
Matched from:
Filename    : /usr/lib/grub/x86_64-efi
...

But, as said, that is not installed. Neither is

grub2-efi-aa64-modules-1:2.02-106.el8.alma.noarch : Modules used to build custom grub.efi images
Repo        : baseos
Matched from:
Filename    : /usr/lib/grub/arm64-efi
...

If you can get to grub prompt, then you already do have grub installed. No need to redo that.

Grub config can be recreated with grub2-mkconfig. Where should it go? Legacy and EFI have different locations.

ls -ltr /boot/grub2/
ls -ltr /boot/efi/EFI/almalinux/

Existing entries (for kernels) one should see with:
ls -ltr /boot/loader/entries/

When i enter command, grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg, i got this error:

device-mapper:reload ioctl on osprober-linux-sdb1- device or resource busy

I try to o research and found the solution but unsuccesful.
lsblk -p
dmsetup ls
dmsetup remove_all
After enter those command, still the same issue.

Should i try Centos-9 stream?

I really piss off by this issue. Please help me on this.

Please help me on this. A billion thanks for this.

What is the /dev/sdb1 ?

Hello jlehtone,
The /dev/sdb1 and /dev/sdb2 is the usb stick. I found this using command of lsblk -f.

I try remove the usb stick and enter the command grub2-mkconfig -o /boot/efi/EFI/almalinux/grub.cfg but the problem is it cannot found the linux image/kernel. It can only find the window boot in another hard disk.

What should i do now? Please help. A billion thanks for your help.

Please help. Thanks.

Can you show the lsblk?

@nicholaswkc On a whim I did websearch with “osprober-linux-sdb1- device” and got:

While it is for Ubuntu, it shows that the message is more a warning than an error and in the last message there is instruction for disabling the os-proper that is probably ok in Alma too.

Look into /boot/loader/entries and /boot/efi/EFI/almalinux. The former should have a file for each installed kernel and the latter have grub.cfg and grubenv.

I wonder how the LUKS affects: I’ve never used it.

I tried install Fedora 35, it can boot in first time with GRUB boot loader but cannot boot into it after second time. It does not show any entry in F12 boot options nor show any bootloader. Does it related with the ubuntu entry in the F12 options. I had completely wiped out the hard disk using GParted.

I don’t want to mess up with my Window Hard disk.

That is baffling.

The F12 shows both the entries stored in EFI (motherboard NVRAM) and autodetected bootloaders/sectors.

Each entry in EFI just lists a bootloader in some EFI System Partition (ESP). For example, the Ubuntu entry probably points to *.efi file in partition that you have already removed.
For example, on one system, the efibootmgr -v shows:

BootCurrent: 0001
Timeout: 1 seconds
BootOrder: 0000,0001,0002
Boot0000* Windows Boot Manager	HD(1,GPT,79..74,0x800,0x64000)/File(\EFI\MICROSOFT\BOOT\BOOTMGFW.EFI)WINDOWS.........x...B.C.D.O.B.J.E.C.T.=.{.9.d.e.a.8.6.2.c.-.5.c.d.d.-.4.e.7.0.-.a.c.c.1.-.f.3.2.b.3.4.4.d.4.7.9.5.}....................
Boot0001* AlmaLinux	HD(1,GPT,79..74,0x800,0x64000)/File(\EFI\ALMALINUX\SHIMX64.EFI)
Boot0002  CentOS	HD(1,GPT,79..74,0x800,0x64000)/File(\EFI\CENTOS\SHIM.EFI)..BO

The autodetection probably looks for File(\EFI\BOOT\BOOTX64.EFI) from every ESP, USB, DVD, and the legacy mode support lists just disks as each of them has “sector 0”.

EFI should have option to remove (bogus) entries.

If Windows does use EFI mode, then it is better to disable the legacy support (unless done already).

I once had a system, where I did install CentOS first, in EFI mode. Then tried Windows 7, but it did not accept the GPT. I was baffled until I figured out that the Windows USB (from MS) did not have EFI boot loader. Well, it had, but the case of filenames there were “wrong”, even though FAT32 should be case-insensitive. A copy of USB with different case did offer EFI. Could have been motherboards EFI implementation’s fault.

In your case the question is why doesn’t the (Alma/Fedora) installer add files to \EFI\ALMALINUX (of any ESP, which there should be two: on sda and nvme0n1) and an entry to EFI?