TEXT   100
How to fix fedora rescue grub BUG
Guest on 5th February 2023 02:49:57 AM


  1. rescue kernel:
  2.  
  3. to remove/refresh it:
  4.  
  5. # -- not reading from stdin
  6. RESKERN=`echo  /boot/vmlinuz-0-rescue-*`
  7. grubby --remove-kernel=$RESKERN
  8. rm /boot/*rescu*
  9.  
  10. grub2-mkconfig -o /boot/grub2/grub.cfg
  11.  
  12.  
  13. # make sure You can install the right version for Your rescue kernel:
  14. dnf update kernel
  15. # which will create a rescue kernel in this version
  16.  
  17. # BUG-fix
  18. # =======
  19. RESKERN=`echo  /boot/vmlinuz-0-rescue-*`
  20. TITLE=`grubby --info=$RESKERN | grep title|sed 's/title=//g'`
  21. # e.g.: title="Fedora (0-rescue-af83f4e90dfa42568ef69bc637593542) 30 (Thirty)"
  22. grubby --remove-kernel=$RESKERN
  23. grubby --add-kernel=$RESKERN  --title="$TITLE"
  24. # check
  25. grubby --info=ALL
  26. # update bootloader
  27. grub2-mkconfig -o /boot/grub2/grub.cfg
  28.  
  29.  
  30. # never a rescue kernel again ....
  31. dnf erase dracut-config-rescue
  32.  
  33.  
  34.  
  35. -- INFO --
  36. grubby --info=ALL
  37. -- WRONG
  38. kernel="/vmlinuz-0-rescue-af83f4e90dfa42568ef69bc637593542"
  39. ...
  40. initrd="/initramfs-0-rescue-af83f4e90dfa42568ef69bc637593542.img"
  41.  
  42. -- CORRECT after BUG-fix
  43. kernel="/boot/vmlinuz-0-rescue-af83f4e90dfa42568ef69bc637593542"
  44. ...
  45. initrd="/boot/initramfs-0-rescue-af83f4e90dfa42568ef69bc637593542.img"
  46.  
  47.  
  48. -- UTILS --
  49. grubby --default-kernel
  50. grubby --default-index
  51. grubby --set-default /boot/vmlinuz-5.1.15-300.fc30.x86_64
  52.  
  53.  
  54.  
  55.  
  56. -- UTILS 2 ---
  57. # ----
  58. # GRUB_ENABLE_BLSCFG=true ... in /etc/default/grub
  59. #    if set to true then:
  60. #    modify kernel arguments by
  61. grub2-editenv - set kernelopts="root=/dev/mapper/VGROOT-LVROOT ro resume=/dev/mapper/VGROOT-LVSWAP rd.lvm.lv=VGROOT/LVROOT rd.lvm.lv=VGROOT/LVSWAP nomodeset biosdevname=0 net.ifnames=0 "
  62. # check
  63. grub2-editenv - list | grep kernelopts

Raw Paste

Login or Register to edit or fork this paste. It's free.