Fedora kernels missing from grub - only windows shows up

asked 2017-11-20 03:01:29 -0500

DFresh gravatar image

updated 2017-11-21 00:31:44 -0500

Was running FC26 and performed the graphical upgrade to FC27. Had issue with that where it booted to emergency mode and logs showed the message Failed to switch root: Specified switch root path ‘/sysroot’ does not seem to be an OS tree. os-release file is missing . User comment at https://fedoramagazine.org/upgrading-... said to perform the below steps which got me running again.

mount -o remount,rw /sysroot
rm -f /sysroot/etc/os-release
cp /usr/lib/os-release /sysroot/etc
exit

I performed a dnf update today which included some kernel upgrades along with some FC26 removals. Now when I boot all I get is my Win10 OS in grub. Any help on how I can get the FC27 options restored?

Update: Got my system booted via a live image. Below is info on partitions. Should I just try reinstalling grub2?

[liveuser@localhost-live ~]$ blkid
/dev/sda2: LABEL="Win2TB" UUID="3038DFCD38DF9068" TYPE="ntfs" PARTLABEL="Basic data partition" PARTUUID="fb82701a-572d-4084-b8c3-69f6e3e1040d"
/dev/sdb1: LABEL="System Reserved" UUID="5A8801F88801D403" TYPE="ntfs" PARTUUID="4778ece8-01"
/dev/sdb2: UUID="32920A40920A08D5" TYPE="ntfs" PARTUUID="4778ece8-02"
/dev/sdb3: UUID="c3847125-2128-4ffb-bd97-1f06770493f2" TYPE="ext4" PARTUUID="4778ece8-03"
/dev/sdb5: UUID="VQxiQC-mqcf-Hdys-S2a1-1qFS-tkod-yXQ5b8" TYPE="LVM2_member" PARTUUID="4778ece8-05"
/dev/sdc1: LABEL="4TBSG" UUID="b6d90480-57ed-40c6-973b-d1acbe42f9f2" TYPE="ext4" PARTUUID="c3ac383e-297a-44f2-8663-539e249f05f8"
/dev/mapper/fedora_ryzen7-swap: UUID="16b5176a-f32c-4dd1-8ea1-9388998c0e87" TYPE="swap"
/dev/mapper/fedora_ryzen7-home: UUID="0340b087-db17-4131-9c5b-7084ed1a02ff" TYPE="ext4"
/dev/mapper/fedora_ryzen7-root: UUID="dc924481-b215-4194-89df-c616e9865a8b" TYPE="ext4"
/dev/sdd2: SEC_TYPE="msdos" LABEL="ANACONDA" UUID="FF9B-8FE5" TYPE="vfat" PARTUUID="2563bf1a-02"
/dev/sdd3: UUID="095b3e54-6722-3663-9355-20c7d4e06c4b" LABEL="ANACONDA" TYPE="hfsplus" PARTUUID="2563bf1a-03"
/dev/loop0: TYPE="squashfs"
/dev/loop1: LABEL="Anaconda" UUID="ecca4143-2913-455c-852d-d66c32f4f25e" TYPE="ext4"
/dev/mapper/live-rw: LABEL="Anaconda" UUID="ecca4143-2913-455c-852d-d66c32f4f25e" TYPE="ext4"
/dev/mapper/live-base: LABEL="Anaconda" UUID="ecca4143-2913-455c-852d-d66c32f4f25e" TYPE="ext4"

Also managed to mount my boot drive and below is what I have in grub.cfg:

#
# 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/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 '' (4.13.13-300.fc27.x86_64) ' --class fedora --class gnu-linux --class gnu --class os --unrestricted ...
(more)
edit retag flag offensive close merge delete

Comments

Ok, so I managed to get my system booted by getting it into dracut mode and running the commands below to verify my root partition. That was the key to getting the right values to enter into grub.

lvm vgscan
lvm lvscan

After getting those values below is what I entered into grub.

insmod xfs
insmod lvm
set root=(lvm/fedora_ryzen7-root)
linux (hd0,msdos3)/vmlinuz-4.13.13-300.fc27.x86_64 root=/dev/fedora_ryzen7/root rhgb selinux=0
initrd (hd0,msdos3)/initramfs-4.13.13-300.fc27.x86_64.img
boot
DFresh gravatar imageDFresh ( 2017-11-23 00:48:34 -0500 )edit

Once I got booted into my normal system I ran the command to create the grub.cfg. However, after rebooting I'm still only getting Win10 in my list of grub options. I'm about to give up and just wipe all my fedora partitions and reinstall as I'm at a loss now.

sudo grub2-mkconfig -o /boot/efi/EFI/fedora/grub.cfg
DFresh gravatar imageDFresh ( 2017-11-23 00:49:20 -0500 )edit