文書の表示以前のリビジョンバックリンク文書の先頭へ この文書は読取専用です。文書のソースを閲覧することは可能ですが、変更はできません。もし変更したい場合は管理者に連絡してください。 ====== Fedora での GRUB2 の再インストール ====== ===== UEFI ベースマシンの GRUB 2 再インストール ===== ''dnf reinstall grub2-efi shim'' コマンドを実行すると、ブート情報が更新され、不足しているファイルが復元される🤔\\ <wrap em>※ファイルが破損していない場合のみ、ファイルが復元される。</wrap>\\ \\ システムが正常に動作している場合、''dnf reinstall grub2-efi shim'' コマンドを使用して GRUB 2 を再インストールする。\\ <WRAP color_term> <WRAP color_command><html><pre> <b class=GRN>$</b> <b class=HIY>sudo</b> dnf reinstall grub2-efi shim </pre></html></WRAP> <WRAP color_result_long><html><pre> メタデータの期限切れの最終確認: 1:13:16 時間前の 2022年10月08日 12時41分21秒 に実施しました。 依存関係が解決しました。 ============================================================================================================== パッケージ アーキテクチャー バージョン リポジトリー サイズ ============================================================================================================== 再インストール: grub2-efi-ia32 x86_64 1:2.06-53.fc36 updates 1.3 M grub2-efi-x64 x86_64 1:2.06-53.fc36 updates 1.3 M shim-x64 x86_64 15.6-2 updates 469 k トランザクションの概要 ============================================================================================================== ダウンロードサイズの合計: 3.1 M インストール後のサイズ: 12 M これでよろしいですか? [y/N]: y パッケージのダウンロード: (1/3): shim-x64-15.6-2.x86_64.rpm 511 kB/s | 469 kB 00:00 (2/3): grub2-efi-ia32-2.06-53.fc36.x86_64.rpm 948 kB/s | 1.3 MB 00:01 (3/3): grub2-efi-x64-2.06-53.fc36.x86_64.rpm 920 kB/s | 1.3 MB 00:01 -------------------------------------------------------------------------------------------------------------- 合計 1.1 MB/s | 3.1 MB 00:02 トランザクションの確認を実行中 トランザクションの確認に成功しました。 トランザクションのテストを実行中 トランザクションのテストに成功しました。 トランザクションを実行中 準備 : 1/1 再インストール中 : grub2-efi-x64-1:2.06-53.fc36.x86_64 1/6 再インストール中 : shim-x64-15.6-2.x86_64 2/6 再インストール中 : grub2-efi-ia32-1:2.06-53.fc36.x86_64 3/6 整理 : shim-x64-15.6-2.x86_64 4/6 整理 : grub2-efi-x64-1:2.06-53.fc36.x86_64 5/6 整理 : grub2-efi-ia32-1:2.06-53.fc36.x86_64 6/6 検証 : grub2-efi-ia32-1:2.06-53.fc36.x86_64 1/6 検証 : grub2-efi-ia32-1:2.06-53.fc36.x86_64 2/6 検証 : grub2-efi-x64-1:2.06-53.fc36.x86_64 3/6 検証 : grub2-efi-x64-1:2.06-53.fc36.x86_64 4/6 検証 : shim-x64-15.6-2.x86_64 5/6 検証 : shim-x64-15.6-2.x86_64 6/6 再インストール済み: grub2-efi-ia32-1:2.06-53.fc36.x86_64 grub2-efi-x64-1:2.06-53.fc36.x86_64 shim-x64-15.6-2.x86_64 完了しました! </pre></html></WRAP> <WRAP color_result_long><html><pre> $ rpm -ql grub2-efi-ia32 /boot/efi/EFI/fedora/grub.cfg /boot/efi/EFI/fedora/grubia32.efi /boot/grub2/fonts /boot/grub2/fonts/unicode.pf2 /boot/grub2/grub.cfg /boot/grub2/grubenv /boot/loader/entries /etc/dnf/protected.d/grub2-efi-ia32.conf /etc/grub2-efi.cfg /etc/grub2.cfg $ rpm -ql grub2-efi-x64 /boot/efi/EFI/fedora/grub.cfg /boot/efi/EFI/fedora/grubx64.efi /boot/grub2/fonts /boot/grub2/fonts/unicode.pf2 /boot/grub2/grub.cfg /boot/grub2/grubenv /boot/loader/entries /etc/dnf/protected.d/grub2-efi-x64.conf /etc/grub2-efi.cfg /etc/grub2.cfg $ rpm -ql shim-x64 /boot/efi/EFI/BOOT/BOOTX64.EFI /boot/efi/EFI/BOOT/fbx64.efi /boot/efi/EFI/fedora/BOOTX64.CSV /boot/efi/EFI/fedora/mmx64.efi /boot/efi/EFI/fedora/shim.efi /boot/efi/EFI/fedora/shimx64.efi /etc/dnf/protected.d/shim.conf $ sudo cat /boot/efi/EFI/fedora/grub.cfg cat: /boot/efi/EFI/fedora/grub.cfg: そのようなファイルやディレクトリはありません </pre></html></WRAP> </WRAP> ===== BIOS ベースマシンの GRUB 2 再インストール ===== ''grub2-install'' コマンドを実行すると、ブート情報が更新され、不足しているファイルが復元される🤔\\ <wrap em>※ファイルが破損していない場合のみ、ファイルが復元される。</wrap>\\ \\ システムが正常に動作している場合、''grub2-install'' コマンドを使用して GRUB 2 を再インストールする。\\ <WRAP color_term> <WRAP color_command><html><pre> <b class=GRN>$</b> <b class=HIY>sudo</b> grub2-install /dev/sda </pre></html></WRAP> </WRAP> ※起動ドライブが ''sda'' の場合。\\ ===== GRUB 2 の構成リセットと再インストール (UEFI/BIOS ベースマシン) ===== この方法では、すべての GRUB 2 構成ファイルとシステム設定が完全に削除されて、すべての構成設定をデフォルト値にリセットする。\\ 構成ファイルを削除してから GRUB 2 を再インストールすると、破損したファイルや不適切な構成が原因で発生する障害が修正される🤔\\ <WRAP color_term> <WRAP color_command><html><pre> <b class=GRN>$</b> <b class=HIY>sudo</b> rm /etc/grub.d/* <b class=GRN>$</b> <b class=HIY>sudo</b> rm /etc/sysconfig/grub </pre></html></WRAP> </WRAP> UEFI ベースマシンの場合は、以下のコマンドを実行する🤔\\ <WRAP color_term> <WRAP color_command><html><pre> <b class=GRN>$</b> <b class=HIY>sudo</b> dnf reinstall grub2-efi shim grub2-tools </pre></html></WRAP> </WRAP> BIOS ベースマシンの場合は、以下のコマンドを実行する🤔\\ <WRAP color_term> <WRAP color_command><html><pre> <b class=GRN>$</b> <b class=HIY>sudo</b> dnf reinstall grub2-tools </pre></html></WRAP> </WRAP> UEFI ベースマシンで ''grub.cfg'' ファイルを再構築するには、以下のコマンドを実行する🤔\\ <WRAP color_term> <WRAP color_command><html><pre> <b class=GRN>$</b> <b class=HIY>sudo</b> grub2-mkconfig <b class=HIK>-o</b> /boot/efi/EFI/fedora/grub.cfg </pre></html></WRAP> </WRAP> BIOS ベースマシンで ''grub.cfg'' ファイルを再構築するには、以下のコマンドを実行する🤔\\ <WRAP color_term> <WRAP color_command><html><pre> <b class=GRN>$</b> <b class=HIY>sudo</b> grub2-mkconfig <b class=HIK>-o</b> /boot/grub2/grub.cfg </pre></html></WRAP> </WRAP> ====== Fedora UFEI ブートの再インストール ====== UEFI ブートメニューから Fedora が消えた場合は、以下の方法で再登録できる。\\ ===== UEFI システムに GRUB を再インストール ===== <code> $ sudo efibootmgr -c -w -L Fedora -d /dev/sda -p 2 -l \EFI\fedora\shim.efi efibootmgr: ** Warning ** : Boot0001 has same label Fedora BootCurrent: 003D Timeout: 2 seconds BootOrder: 0002,0000,0001,2001 Boot0000* Windows Boot Manager Boot0001* Fedora Boot2001* EFI USB Device Boot0002* Fedora $ reboot </code> ===== 参考文献 ===== [[https://docs.fedoraproject.org/en-US/fedora/latest/system-administrators-guide/kernel-module-driver-configuration/Working_with_the_GRUB_2_Boot_Loader/#sec-Reinstalling_GRUB_2|Reinstalling GRUB 2 - Working with the GRUB 2 Boot Loader :: Fedora Docs]]\\ [[https://access.redhat.com/documentation/ja-jp/red_hat_enterprise_linux/7/html/system_administrators_guide/sec-resetting_and_reinstalling_grub_2|26.7.3. GRUB 2 の再設定と再インストール Red Hat Enterprise Linux 7 | Red Hat Customer Portal]]\\ [[https://docs.fedoraproject.org/en-US/Fedora/22/html/Multiboot_Guide/GRUB-reinstalling.html|6.3.2. Reinstalling GRUB]]\\ [[https://www.pc-koubou.jp/magazine/1257|旧BIOSを進化させたUEFI、その基本を解説(前編:役割と概要) | パソコン工房 NEXMAG]]\\ [[https://www.pc-koubou.jp/magazine/1368|旧BIOSを進化させたUEFI、その基本を解説(後編:設定と確認) | パソコン工房 NEXMAG]]\\ linux/fedora/reinstalling_grub2.txt 最終更新: 2024/02/04 13:47by ともやん