パーティションのGPTディスクにGRUB2をインストールする

パーティションのGPTディスクにGRUB2をインストールする

私はMacBook Air 2013を使用しており、Gentooをインストールしようとしています。私はこれを数回やってきましたが、この問題を解決するためにEFI-stubカーネルイメージを直接使用するなど、常に異なる「解決方法」を使用してきました。

私が達成したいのは、Macbookの元のディスクレイアウトを台無しにしないようにパーティションにGRUBをインストールすることです。

これは私のパーティションテーブルです。

    GPT fdisk (gdisk) version 0.8.8

Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present

Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 236978176 sectors, 113.0 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 9DF6BE23-87E0-4602-B71F-7DAD445D5614
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 236978142
Partitions will be aligned on 8-sector boundaries
Total free space is 6 sectors (3.0 KiB)

Number  Start (sector)    End (sector)  Size       Code  Name
   1              40          409639   200.0 MiB   EF00  EFI System Partition
   2          409640       176582599   84.0 GiB    AF00  Customer
   3       176582600       177852135   619.9 MiB   AB00  Recovery HD
   4       177852136       178114279   128.0 MiB   EF00  EFI System
   5       178114280       236978142   28.1 GiB    8300  Linux filesystem

これ初めてパーティションは私のMacの元のESP(Refindをインストールする)であり、そのままにしたいと思います。 GRUBを入れてみました。4位パーティション(例:脂肪組織) ただし、そこにインストールしようとすると、次のような結果が表示されます。

# > grub2-install /dev/sda4    
/usr/sbin/grub2-bios-setup: warning: File system 'fat' doesnt' support embedding.
/usr/sbin/grub2-bios-setup: warning: Embedding is not possible. GRUB can only be installed in this setup by using blocklists. However, blocklists are UNRELIABLE and their use is discouraged..
/usr/sbin/grub2-bios-setup: error: will not proceed with blocklists.

私も試しました。

grub2-install --force /dev/sda4

しかし、これはうまくいきません。この問題をどのように解決できますか?ありがとうございます!

ベストアンサー1

私はEFI-stubカーネルを作成してこの問題を解決し、そのカーネルから起動するときにgrubをインストールしました。ここでは、私がインストールしたディレクトリで、grub2-install --target=$arch-efi --efi-directory=$esp私のCPUアーキテクチャです(私の場合はです。このプロセスに従って)、grubがインストールされ、生成されます。$esp/boot$archx86_64$espgrubx64.efi

最後のステップは設定を作成することです。

grub2-mkconfig -o $esp

全部準備完了!

結論として:

  1. EFI-STUBカーネルの作成と起動
  2. 通常どおり grub をインストールします。grub2-install --target=$arch-efi --efi-directory=$esp
  3. grubの設定ファイルを作成します。 grub2-mkconfig -o $esp
  4. 完璧!

おすすめ記事