#author("2020-09-04T15:02:25+09:00","default:nobuoki","nobuoki") #author("2020-09-09T14:44:04+09:00","default:nobuoki","nobuoki") * はじめに [#s8fb4b86] - fedora で sudo dnf -y update -- kernel 上がる -- sudo reboot - vm (vagrant + virtualbox) がブートしない -- vboxdrv.service 上がらない -- kernel module のコンパイルに失敗している → kernel 戻そう - ダウングレード? - いやいや、grub2 のデフォルトを変更して1つ前のカーネルをデフォルトにすればよくね? - ええと・・・どのファイル修正して、何のコマンド流すんだっけ??? - (ググる) → grubby!!! * grubbyでgrub2のデフォルトメニューを変える [#x4275f35] 現状を確認する #prism(bash){{{ $ uname -a Linux e130 5.8.4-200.fc32.x86_64 #1 SMP Wed Aug 26 22:28:08 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux $ sudo grubby --default-kernel /boot/vmlinuz-5.8.4-200.fc32.x86_64 }}} grub2のメニューを見る - index=1 の kernel="/boot/vmlinuz-5.7.15-200.fc32.x86_64" にすればいいね #prism(bash){{{ $ sudo grubby --info=ALL index=0 kernel="/boot/vmlinuz-5.8.4-200.fc32.x86_64" args="ro resume=/dev/mapper/fedora_localhost--live-swap rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap rhgb quiet systemd.unified_cgroup_hierarchy=0" root="/dev/mapper/fedora_localhost--live-root" initrd="/boot/initramfs-5.8.4-200.fc32.x86_64.img" title="Fedora (5.8.4-200.fc32.x86_64) 32 (Thirty Two)" id="429fc1c27543423bb074b9349983b086-5.8.4-200.fc32.x86_64" index=1 kernel="/boot/vmlinuz-5.7.15-200.fc32.x86_64" args="ro resume=/dev/mapper/fedora_localhost--live-swap rd.lvm.lv=fedora_localhost-live/root rd.lvm.lv=fedora_localhost-live/swap rhgb quiet systemd.unified_cgroup_hierarchy=0" root="/dev/mapper/fedora_localhost--live-root" initrd="/boot/initramfs-5.7.15-200.fc32.x86_64.img" title="Fedora (5.7.15-200.fc32.x86_64) 32 (Thirty Two)" id="429fc1c27543423bb074b9349983b086-5.7.15-200.fc32.x86_64" index=2 kernel="/boot/vmlinuz-5.7.11-200.fc32.x86_64" (以下略) }}} デフォルトを変更する --set-default=kernel-path make the first entry referencing the specified kernel the default --set-default-index=entry-index make the given entry index the default entry とあるので、どちらかのコマンドを入れる #prism(bash){{{ # メニューインデックス指定の場合 $ sudo grubby --set-default-index=1 The default is /boot/loader/entries/429fc1c27543423bb074b9349983b086-5.7.15-200.fc32.x86_64.conf with index 1 and kernel /boot/vmlinuz-5.7.15-200.fc32.x86_64 # カーネルイメージ指定の場合 $ sudo brubby --set-default=/boot/vmlinuz-5.7.15-200.fc32.x86_64 $ sudo grubby --set-default=/boot/vmlinuz-5.7.15-200.fc32.x86_64 (略) }}} 本当に変更されたか確認 #prism(bash){{{ $ sudo grubby --default-kernel /boot/vmlinuz-5.7.15-200.fc32.x86_64 }}} リブートし、カーネル確認 #prism(bash){{{ $ sudo reboot Connection to 192.168.10.151 closed by remote host. Connection to 192.168.10.151 closed. # 待つ・・・ $ ssh e130 Last login: Fri Sep 4 14:13:23 2020 from 192.168.10.123 # カーネルバージョン確認 $ uname -a Linux e130 5.7.15-200.fc32.x86_64 #1 SMP Tue Aug 11 16:36:14 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux }}} * 参考 [#t1cf3b02] - [[21.4. Making Persistent Changes to a GRUB 2 Menu Using the grubby Tool>https://docs.fedoraproject.org/en-US/Fedora/25/html/System_Administrators_Guide/sec-Making_Persistent_Changes_to_a_GRUB_2_Menu_Using_the_grubby_Tool.html]]