CentOSThis forum is for the discussion of CentOS Linux. Note: This forum does not have any official participation.
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.
Possibly, as long as the kernel/initrd files they point to are still present on the system.
And if none of them work, one of them can surely be edited to match whatever currently exists in the /boot directory. After all, at one point, probably prior to an update, they did work with your system.
Keep in mind, though, that these files were autogenerated, and as such are bound to contain tons of superfluous fluff, even though a working grub.cfg only needs to contain less than ten lines of text per kernel image.
Even with a nonfunctional grub.cfg, you should get and error and be dumped at the "grub" prompt. If that didn't happen, there's something wrong earlier in the UEFI process.
The command efibootmgr -v will show you which file(s) the UEFI process is looking for.
Quote:
Originally Posted by BeeRich
You say one can be generated to match whatever is in /boot. Not sure what you mean by that.
Edited, not generated.
grub.cfg is a text file telling grub what to look for. It will contain an "initrd" reference and a "linux" reference pointing to an initrd and a kernel respectively. The references will be relative to the partition mounted as /boot (meaning a reference to /linux-kernel-1.2.34 is a pointer to a file that will appear as /boot/linux-kernel-1.2.34 on a running system).
Even with a nonfunctional grub.cfg, you should get and error and be dumped at the "grub" prompt. If that didn't happen, there's something wrong earlier in the UEFI process.
The command efibootmgr -v will show you which file(s) the UEFI process is looking for.
Edited, not generated.
grub.cfg is a text file telling grub what to look for. It will contain an "initrd" reference and a "linux" reference pointing to an initrd and a kernel respectively. The references will be relative to the partition mounted as /boot (meaning a reference to /linux-kernel-1.2.34 is a pointer to a file that will appear as /boot/linux-kernel-1.2.34 on a running system).
It jumped directly to the USB rescue menu. I don't think I've ever seen the grub menu.
efibootmgr -v:
EFI variables are not supported on this system
I found a way to pipe to my workstation. Here is the current grub.cfg:
Code:
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub2-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#
### BEGIN /etc/grub.d/00_header ###
set pager=1
if [ -s $prefix/grubenv ]; then
load_env
fi
if [ "${next_entry}" ] ; then
set default="${next_entry}"
set next_entry=
save_env next_entry
set boot_once=true
else
set default="${saved_entry}"
fi
if [ x"${feature_menuentry_id}" = xy ]; then
menuentry_id_option="--id"
else
menuentry_id_option=""
fi
export menuentry_id_option
if [ "${prev_saved_entry}" ]; then
set saved_entry="${prev_saved_entry}"
save_env saved_entry
set prev_saved_entry=
save_env prev_saved_entry
set boot_once=true
fi
function savedefault {
if [ -z "${boot_once}" ]; then
saved_entry="${chosen}"
save_env saved_entry
fi
}
function load_video {
if [ x$feature_all_video_module = xy ]; then
insmod all_video
else
insmod efi_gop
insmod efi_uga
insmod ieee1275_fb
insmod vbe
insmod vga
insmod video_bochs
insmod video_cirrus
fi
}
terminal_output console
if [ x$feature_timeout_style = xy ] ; then
set timeout_style=menu
set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
set timeout=5
fi
### END /etc/grub.d/00_header ###
### BEGIN /etc/grub.d/00_tuned ###
set tuned_params=""
set tuned_initrd=""
### END /etc/grub.d/00_tuned ###
### BEGIN /etc/grub.d/01_users ###
if [ -f ${prefix}/user.cfg ]; then
source ${prefix}/user.cfg
if [ -n "${GRUB2_PASSWORD}" ]; then
set superusers="root"
export superusers
password_pbkdf2 root ${GRUB2_PASSWORD}
fi
fi
### END /etc/grub.d/01_users ###
### BEGIN /etc/grub.d/10_linux ###
menuentry 'CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-862.el7.x86_64-advanced-bde0e85d-4653-451c-a6a5-8222fc3825ee' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod xfs
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 04fde641-f537-49b4-a617-451e4325c92c
else
search --no-floppy --fs-uuid --set=root 04fde641-f537-49b4-a617-451e4325c92c
fi
linuxefi /vmlinuz-3.10.0-957.27.2.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8
initrdefi /initramfs-3.10.0-957.27.2.el7.x86_64.img
}
menuentry 'CentOS Linux (3.10.0-957.21.3.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-862.el7.x86_64-advanced-bde0e85d-4653-451c-a6a5-8222fc3825ee' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod xfs
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 04fde641-f537-49b4-a617-451e4325c92c
else
search --no-floppy --fs-uuid --set=root 04fde641-f537-49b4-a617-451e4325c92c
fi
linuxefi /vmlinuz-3.10.0-957.21.3.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8
initrdefi /initramfs-3.10.0-957.21.3.el7.x86_64.img
}
menuentry 'CentOS Linux (3.10.0-957.21.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-862.el7.x86_64-advanced-bde0e85d-4653-451c-a6a5-8222fc3825ee' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod xfs
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 04fde641-f537-49b4-a617-451e4325c92c
else
search --no-floppy --fs-uuid --set=root 04fde641-f537-49b4-a617-451e4325c92c
fi
linuxefi /vmlinuz-3.10.0-957.21.2.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8
initrdefi /initramfs-3.10.0-957.21.2.el7.x86_64.img
}
menuentry 'CentOS Linux (3.10.0-957.12.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-862.el7.x86_64-advanced-bde0e85d-4653-451c-a6a5-8222fc3825ee' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod xfs
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 04fde641-f537-49b4-a617-451e4325c92c
else
search --no-floppy --fs-uuid --set=root 04fde641-f537-49b4-a617-451e4325c92c
fi
linuxefi /vmlinuz-3.10.0-957.12.2.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8
initrdefi /initramfs-3.10.0-957.12.2.el7.x86_64.img
}
menuentry 'CentOS Linux (3.10.0-957.10.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-862.el7.x86_64-advanced-bde0e85d-4653-451c-a6a5-8222fc3825ee' {
load_video
set gfxpayload=keep
insmod gzio
insmod part_gpt
insmod xfs
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 04fde641-f537-49b4-a617-451e4325c92c
else
search --no-floppy --fs-uuid --set=root 04fde641-f537-49b4-a617-451e4325c92c
fi
linuxefi /vmlinuz-3.10.0-957.10.1.el7.x86_64 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet LANG=en_US.UTF-8
initrdefi /initramfs-3.10.0-957.10.1.el7.x86_64.img
}
menuentry 'CentOS Linux (0-rescue-9153e7856d4d46ebaa8964a718ba2ce2) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-9153e7856d4d46ebaa8964a718ba2ce2-advanced-bde0e85d-4653-451c-a6a5-8222fc3825ee' {
load_video
insmod gzio
insmod part_gpt
insmod xfs
set root='hd0,gpt2'
if [ x$feature_platform_search_hint = xy ]; then
search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2 04fde641-f537-49b4-a617-451e4325c92c
else
search --no-floppy --fs-uuid --set=root 04fde641-f537-49b4-a617-451e4325c92c
fi
linuxefi /vmlinuz-0-rescue-9153e7856d4d46ebaa8964a718ba2ce2 root=/dev/mapper/centos-root ro crashkernel=auto rd.lvm.lv=centos/root rd.lvm.lv=centos/swap rhgb quiet
initrdefi /initramfs-0-rescue-9153e7856d4d46ebaa8964a718ba2ce2.img
}
### END /etc/grub.d/10_linux ###
### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###
### BEGIN /etc/grub.d/20_ppc_terminfo ###
### END /etc/grub.d/20_ppc_terminfo ###
### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###
### BEGIN /etc/grub.d/40_custom ###
# 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.
### END /etc/grub.d/40_custom ###
### BEGIN /etc/grub.d/41_custom ###
if [ -f ${config_directory}/custom.cfg ]; then
source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f $prefix/custom.cfg ]; then
source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###
It jumped directly to the USB rescue menu. I don't think I've ever seen the grub menu.
Then grub isn't even being loaded. There's a problem with the UEFI configuration.
Quote:
Originally Posted by BeeRich
efibootmgr -v:
EFI variables are not supported on this system
OK, then I guess you'll have to do all the relevant work from inside the BIOS setup utility.
Quote:
Originally Posted by BeeRich
I found a way to pipe to my workstation. Here is the current grub.cfg:
See the "menuentry" sections? Each represents a grub boot entry, which will appear in the grub menu once you've successfully convinced the UEFI subsystem to load grub.
For instance, the last "menuentry" is 'CentOS Linux (0-rescue-9153e7856d4d46ebaa8964a718ba2ce2) 7 (Core)', and it contains these settings:
If the files /boot/vmlinuz-0-rescue-9153e7856d4d46ebaa8964a718ba2ce2 and /boot/initramfs-0-rescue-9153e7856d4d46ebaa8964a718ba2ce2.img exist on your system, this menu entry will work.
Then grub isn't even being loaded. There's a problem with the UEFI configuration.
OK, then I guess you'll have to do all the relevant work from inside the BIOS setup utility.
See the "menuentry" sections? Each represents a grub boot entry, which will appear in the grub menu once you've successfully convinced the UEFI subsystem to load grub.
For instance, the last "menuentry" is 'CentOS Linux (0-rescue-9153e7856d4d46ebaa8964a718ba2ce2) 7 (Core)', and it contains these settings:
If the files /boot/vmlinuz-0-rescue-9153e7856d4d46ebaa8964a718ba2ce2 and /boot/initramfs-0-rescue-9153e7856d4d46ebaa8964a718ba2ce2.img exist on your system, this menu entry will work.
OK, I have seen that. So in the UEFI, what am I looking for? The only boot choice I have is Launch Storage OpRoM Policy, currently set to Legacy only, with two other options, Do not launch and UEFI only.
OK, I get to the boot screen where I can choose which drive as boot device. NOT the grub menu. When I choose the drive where CentOS is installed, it goes to the rescue OS on the USB. Let me post the error from grub installation.
Now I have the option of centos on the bottom of possible boot options. So I chose centos and I have some kind of grub editor.
grub>
That's the grub prompt, which appears whenever grub is unable to present you with a list of bootable operating systems.
You now need to tell grub:
where the boot partition is
which modules/extensions need to be enabled to parse the boot partition and load the kernel/initrd
the name of the initrd file
the name of the kernel file
Some grub commands are similar to common Unix commands. For instance, ls will list available drives and partitions. The (slightly odd) naming convention is "(hd<n>,<partition_type><pnum>)", where <n> is a drive number starting from 0, <partition_type> can be "msdos" or "gpt", and <pnum> is the partition number (starting from 1).
If the numbering matches that of the Linux kernel, you should see at least (hd0) (the drive itself), (hd0,gpt1), (hd0,gpt2), and (hd0,gpt3).
You may have to insert modules in order to parse partition tables, filesystems and files. According to your grub.cfg, you should do the following:
Code:
insmod gzio
insmod part_gpt
insmod xfs
You can actually list the contents of a file system from the grub prompt. ls (hd0,gpt2)/ should display the contents of what is usually the /boot directory. Note the trailing slash; without it grub will show you details about the partition instead, such as the file system it contains.
If you do get a list of files from /boot, make note of the available kernel and initrd files and then set this partition as the "root" for grub with set root=(hd0,gpt2).
In every entry in your grub.cfg, two EFI-related modules were loaded. I'm not too familiar with grub and UEFI booting, but it can't hurt to load these two modules with insmod efi_gop and insmod efi_uga.
Assuming your grub.cfg contains valid entries, you can load it by setting the "prefix" parameter to point to the grub subdirectory under /boot (set prefix=(hd0,gpt2)/grub), load the "normal" module (insmod normal) and activate the menu with normal. If this works, great; boot your system and reinstall grub.
If none of the menu entries work, you can still boot by specifying the initrd file with initrd <filename>, specifying the kernel image and parameters to use with linux <filename><kernel_parameters>, and finally starting the boot process with boot.
BTW, again according to the grub.cfg you poster earlier, your kernel parameters are as follows:
Either the grub.cfg file isn't in the right location, doesn't exist, grub modules not loaded to read the boot and/or efi parition or the grub boot loader is looking for the grub.cfg in the wrong location.
Quote:
I found a way to pipe to my workstation. Here is the current grub.cfg:
where is this file located? It needs to be in either grub2 on your boot partition, and/or on the efi partition in EFI/centos.
Last edited by colorpurple21859; 09-26-2019 at 05:39 PM.
Either the grub.cfg file isn't in the right location, doesn't exist, grub modules not loaded to read the boot and/or efi parition or the grub boot loader is looking for the grub.cfg in the wrong location.
where is this file located? It needs to be in either grub2 on your boot partition, and/or on the efi partition in EFI/centos.
/boot/efi/EFI/centos/grub.cfg
This file was made today at 4pm. That last package grub2-efi-x64-modules got me through. It was originally not mentioned.
copy the grub.cfg to /boot/grub2, if that doesn't help at the "grub >" type set and post the output of the lines that starts with
cmd_path
config_directory
config_file
prefix
Last edited by colorpurple21859; 09-26-2019 at 07:02 PM.
copy the grub.cfg to /boot/grub2, if that doesn't help at the "grub >" type set and post the output of the lines that starts with
cmd_path
config_directory
config_file
prefix
Holy Moses, we're up! I had a look before I did the cp and there was no grub.cfg inside that directory.
Hey that's fantastic. I owe you guys a pint. Thank you so much.
I moved some drives around and that gave me zero boot options. So now the drives are back to the original ports when they were working (I noted everything down). I now have the original boot disk up. Options in the bios boot menu choices are centos and AHCI P1 (SSD 1).
What's interesting is that there's one drive up, and two boot options. I don't have the USB involved at this point.
The latter choice asks to insert a bootable volume. The first choice (centos) mounts in emergency mode for some reason, after the grub CentOS7 options come up. . This is the first time I've seen this.
It's asking me to ctrl-D to try to boot into default mode, but I get the error: Authorization not available. Check of polkit service is running or see debug message for more information.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.