UEFI を使用して Windows 10 と Linux をインストールする際の問題

UEFI を使用して Windows 10 と Linux をインストールする際の問題

新しい SSD (480 GB) に Windows 10 と Linux (Ubuntu 21 または Debian 11) をインストールしたいのですが、いくつか問題があります。まず Windows 10 をインストールしたところ、sda1 (100 MB -> EFI システム)、sda2 (16 MB -> Microsoft 予約済み)、sda3 (194.7 GB -> Microsoft 基本データ)、sda4 (518 MB -> Windows 回復環境) というパーティションが作成されました。その後、Ubuntu 21 をインストールしましたが、インストール時に Windows インストールが認識されませんでした。

起動すると Windows に切り替わり、BIOS で Ubuntu を選択すると、/boot/vmlinuz に関するエラーが発生します。

今、私はライブ Ubuntu から起動しました。これが fdisk の情報です:

kubuntu@kubuntu:~$ sudo fdisk -l

Disk /dev/loop0: 2,03 GiB, 2181812224 bytes, 4261352 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes


Disk /dev/sda: 447,13 GiB, 480103981056 bytes, 937703088 sectors
Disk model: KINGSTON SA400S3
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: gpt
Disk identifier: C3887667-AC2B-42B3-9E9E-39558477EDA8

Device         Start       End   Sectors   Size Type
/dev/sda1       2048    206847    204800   100M EFI System
/dev/sda2     206848    239615     32768    16M Microsoft reserved
/dev/sda3     239616 408535333 408295718 194,7G Microsoft basic data
/dev/sda4  408537088 409597951   1060864   518M Windows recovery environment
/dev/sda5  409597952 761942015 352344064   168G Linux filesystem
/dev/sda6  761942016 927956991 166014976  79,2G Linux filesystem
/dev/sda7  927956992 937701375   9744384   4,6G Linux swap
The backup GPT table is corrupt, but the primary appears OK, so that will be used.

grub を回復したいときは、次のようにします。

sudo mount /dev/sda5 /mnt
sudo mount /dev/sda1 /mnt/boot/efi
for i in /dev /dev/pts /proc /sys /run; do sudo mount -B $i /mnt$i; done
sudo chroot /mnt
grub-install /dev/sda

答えは次のとおりです。

Installing for i386-pc platform. grub2-install: warning: this GPT
partition label contains no BIOS Boot Partition; embedding won't be
possible. grub2-install: 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..
grub2-install: error: will not proceed with blocklists.

BIOS 設定 (Asus Maximus VII Hero) からいくつかの方法を試しました。インストール USB の認識に問題があったため、DVD を使用する必要がありました。

答え1

一般的に、Windows を認識するために GRUB は必要ありません。ファームウェアのブート メニューから「Windows ブート マネージャー」を直接選択できます。2 つのブートローダーは UEFI で共存できます。(GRUB を経由せずに Windows を起動すると、BitLocker にも利点があります。)

Installing for i386-pc platform. grub2-install: warning: this GPT

これは、UEFI バージョンではなく、BIOS バージョンの grub2 をインストールしようとしていることを示しています。UEFI を明示的に指定し、ファイルシステム パスを手動で指定してみてください。

grub-install --target=x86_64-efi --efi-directory=/mnt/boot/efi --boot-directory=/mnt/boot

(UEFI の場合、ブートローダはディスクではなくマウントされたファイルシステムにインストールされるため、「/dev/sda2」を指定する必要はありません。)

ライブ Kubuntu システムに間違った「grub2」パッケージがインストールされている可能性があります。Debian と Ubuntu では、さまざまな GRUB「ターゲット システム」ファイル ( i386-pcBIOS 用、x86_64-efiUEFI 用) が、すべてのファイルが一度に利用できるのではなく、別々のパッケージに分割されています。必要な場合は、以下を試してください。

apt install grub-efi-amd64{,-bin,-signed}

注意: Kubuntu ライブ システムを BIOS モードで起動した場合、新しくインストールされた grub2 を指す UEFI NVRAM エントリを作成できません。/sys/firmware/efi/efivars存在するかどうかを確認してください。存在しない場合は、再起動して、マザーボードのブート メニューで「UEFI:」オプションを慎重に選択してください。

--removable(それでも問題が解決しない場合は、grub2 を 2 回インストールし、 2 回目の試行にオプションを追加することで、問題を回避できる場合があります。)

関連情報