Cannot boot into my newly upgraded Centos 8 system

Issues related to applications and software problems and general support
Post Reply
CrazyBalls90
Posts: 7
Joined: 2020/03/22 00:17:19

Cannot boot into my newly upgraded Centos 8 system

Post by CrazyBalls90 » 2020/03/22 00:50:22

I am not able to boot into my newly upgraded Centos 8 (previously, Centos 7) system. Without creating a backup, I followed the instructions in this article. I successfully completed all the steps, but I was not able to boot into Centos 8. What would show up in GRUB is the Centos 8 rescue boot option, and when I tried entering that, the system would not get stuck loading.

I went through many online sources to try to fix this problem, including reinstalling GRUB 2 and running grub2-mkconfig, to no avail. Eventually, I was able to boot into Centos 8 emergency mode, but that was because of some flaw in the GRUB config file.

I tried to figure out to fix this issue, and I tried the following:

# mount /dev/mapper/centos-root /mnt/media
# mount /dev/sdb2 /mnt/media/boot
# mount /dev/sdb1 /mnt/media/boot/efi
# mount -o bind /dev /mnt/media/dev
# mount -o bind /dev/pts /mnt/media/dev/pts
# mount -o bind /proc /mnt/media/proc
# mount -o bind /run /mnt/media/run
# mount -o bind /sys /mnt/media/sys
# chroot /mnt/media
# grub2-install /dev/sdb
grub2-install: error: /usr/lib/grub/x86_64-efi/modinfo.sh doesn't exist. Please specify --target or --directory.

When I entered the /usr/lib/grub directory, I saw that there was just one directory:

arm64-efi

Thus, I tried running the following:

# grub2-install --directory="/usr/lib/grub/arm64-efi" /dev/sdb

However, I got some sort of I/O error, but I still tried the following command in another Terminal window logged in as root (not chrooted into /mnt/media) after that:

# grub2-mkconfig -o /mnt/media/boot/efi/EFI/centos/grub.cfg
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-3.10.0-1062.el7.x86_64
Found initrd image: /boot/initramfs-3.10.0-1062.el7.x86_64.img
Found linux image: /boot/vmlinuz-0-rescue-287e0bf95c01450a87401be862174f34
Found initrd image: /boot/initramfs-0-rescue-287e0bf95c01450a87401be862174f34.img
Found Windows Boot Manager on /dev/sda1@/EFI/Microsoft/Boot/bootmgfw.efi
Found CentOS Linux release 8.1.1911 (Core) on /dev/mapper/centos-root
done

I noticed that my "/mnt/media/boot/efi/EFI" folder used to have just the "BOOT" and "centos" folders. Now, it has "BOOT", "centos" and "grub". Then, when I rebooted my machine and loaded the BIOS settings, I saw next to the name of my external hard drive where my Centos 8 was installed that the alias was changed to "grub" (used to be "centos"). When I selected that option, the system would not load up GRUB at all this time and would just return to the BIOS settings.

Any ideas on how to restore my Centos 8 system? Thanks!

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot boot into my newly upgraded Centos 8 system

Post by TrevorH » 2020/03/22 12:52:09

I am not able to boot into my newly upgraded Centos 8 (previously, Centos 7) system. Without creating a backup, I followed the instructions in this article.
Sorry but there is NO upgrade path from any previous version of CentOS to the next. You followed a bad article that should never have been published. I would suggest that you back up your data and reinstall from scratch and then restore it. We cannot and will not support upgrades from one version to the next.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

CrazyBalls90
Posts: 7
Joined: 2020/03/22 00:17:19

Re: Cannot boot into my newly upgraded Centos 8 system

Post by CrazyBalls90 » 2020/03/25 05:28:20

OK, I was able to boot into my system after running the following (not sure why it changed the outcome from last time):

# grub2-install --directory="/usr/lib/grub/arm64-efi" /dev/sdb
# grub2-mkconfig -o /mnt/media/boot/efi/EFI/centos/grub.cfg

However, after selecting the Centos 8 boot option, I am stuck in emergency mode. The reason is that I got the following error message:

[FAILED] Failed to mount /boot/efi.
See 'systemctl status boot-efi.mount' for details.

My 'systemctl status boot-efi.mount' shows the following output:

Mounting /boot/efi...
mount: /boot/efi: unknown filesystem type 'vfat'.
boot-efi.mount: Mount process exited, code=exited
boot-efi.mount: Failed with result 'exit-code'.
Failed to mount /boot/efi.

Any help is appreciated.
Last edited by CrazyBalls90 on 2020/03/26 01:02:41, edited 1 time in total.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot boot into my newly upgraded Centos 8 system

Post by TrevorH » 2020/03/25 10:16:23

mount: /boot/efi: unknown filesystem type 'vat'.
Any upgrade from 7 to 8 is still unsupported, not recommended and will most likely break in new an unexpected ways in the future. You are strongly recommended to stop now and do this properly, backup your data, install correctly from scratch and restore.

However, that looks like a typo in fstab: vat should probably be vfat.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

CrazyBalls90
Posts: 7
Joined: 2020/03/22 00:17:19

Re: Cannot boot into my newly upgraded Centos 8 system

Post by CrazyBalls90 » 2020/03/26 01:06:06

TrevorH wrote:
2020/03/25 10:16:23
Any upgrade from 7 to 8 is still unsupported, not recommended and will most likely break in new an unexpected ways in the future. You are strongly recommended to stop now and do this properly, backup your data, install correctly from scratch and restore.

However, that looks like a typo in fstab: vat should probably be vfat.
Yes, I know what the proper action is. I actually don't really care that all the data in my system is lost. I just wanted to learn how to see if it is possible to restore my system to its normal working state. You can say that I am only doing this for fun.

Sorry, about that. I meant vfat. That is what my system said. I just typed it wrong in my post. It has been corrected.

CrazyBalls90
Posts: 7
Joined: 2020/03/22 00:17:19

Re: Cannot boot into my newly upgraded Centos 8 system

Post by CrazyBalls90 » 2020/03/26 01:08:20

If you want me to, I can close this topic in case an unsuspecting visitor of this thread somehow thinks it would be a good idea to follow any of the methods that may be prescribed here, not noticing your recommendation to stop.

User avatar
TrevorH
Site Admin
Posts: 33215
Joined: 2009/09/24 10:40:56
Location: Brighton, UK

Re: Cannot boot into my newly upgraded Centos 8 system

Post by TrevorH » 2020/03/26 01:26:39

If it really said vfat then it probably isn't loading your initramfs file for the kernel you are booting and thus has no modules available to load. vfat ought to be in the initramfs.
The future appears to be RHEL or Debian. I think I'm going Debian.
Info for USB installs on http://wiki.centos.org/HowTos/InstallFromUSBkey
CentOS 5 and 6 are deadest, do not use them.
Use the FAQ Luke

CrazyBalls90
Posts: 7
Joined: 2020/03/22 00:17:19

Re: Cannot boot into my newly upgraded Centos 8 system

Post by CrazyBalls90 » 2020/03/26 04:44:49

TrevorH wrote:
2020/03/26 01:26:39
If it really said vfat then it probably isn't loading your initramfs file for the kernel you are booting and thus has no modules available to load. vfat ought to be in the initramfs.
Makes sense. Actually, I don't think I ever had a Centos 8 initramfs. I only have the Centos 7 rescue version of the initramfs for some reason when I installed the Centos 8 kernel. I don't have the right vmlinux either (have the Centos 7 rescue version). This is in /boot. Is it possible to rebuild my initramfs? I saw this article. Haven't tried it yet.

CrazyBalls90
Posts: 7
Joined: 2020/03/22 00:17:19

Re: Cannot boot into my newly upgraded Centos 8 system

Post by CrazyBalls90 » 2020/03/28 20:51:57

I was able to resolve my issue. I can now boot into my Centos 8. The key command to rebuild the initramfs and vmlinuz files was ("#" is the part before the actual command that you would enter)

# /bin/kernel-install add 4.18.0-147.5.1.el8_1.x86_64 /lib/modules/4.18.0-147.5.1.el8_1.x86_64/vmlinuz

I suppose the following would work for you, if you are wondering the same:

# /bin/kernel-install add $(uname -r) /lib/modules/$(uname -r)/vmlinuz

This effectively added the necessary boot loader entries in /boot/loader/entries as well. Also, I rebuilt my GRUB config file by running

# grub2-mkconfig -o /boot/efi/EFI/centos/grub.cfg

Thanks!

Post Reply