Ubuntu、Debian、GRUBがすでにインストールされているUEFIハードドライブにArch Linuxを追加しようとしています

Ubuntu、Debian、GRUBがすでにインストールされているUEFIハードドライブにArch Linuxを追加しようとしています

Arch 64 ビット ISO を USB サムドライブにダウンロードし、そこから起動しました。ターゲット システムは、Athlon CPU、8GB RAM、UEFI 対応 1 TB ハード ドライブを搭載した Gigabyte ボードです。

組み込みの「Installation_Guide」スクリプトに従い、可能な限り忠実に従いました。一部は少し曖昧です。

この記事も確認しましたが、この記事もインストール ガイドも、マルチブートを試みた場合の対処方法については詳しく説明していません。 https://www.tecmint.com/arch-linux-インストールと構成ガイド/

最初のパーティション sda1 はすでに「ブート パーティション」として使用されており (おそらく)、Ubuntu は sda2、Debian は sda3、swap は sda4 にあるため、fdisk で sda5 を作成し、ext4 としてフォーマットしました。指示に従って Arch と vi をインストールしました。既存の swap パーティションを使用しました。なぜ使用しないのでしょうか? 一度に実行できる OS は 1 つだけです。

すべての言語、ロケール、タイムゾーンの構成を確認しました。localhost とホスト名を設定しました。

fstab を作成しましたが、そこには 3 つのエントリがあります。1 つは EFI パーティション用、1 つはスワップ用、もう 1 つはメイン OS 用です。chroot 環境で GRUB をインストールしました。

とにかく、再起動後、以前と同じブート選択が表示されます...Ubuntu (いくつかのオプション) と Debian。Arch USB から再度起動し、sda5 に移動して、すべてがまだそこにあることを確認できました。

重要なステップが 1 つ抜けているような気がしますが、それが何なのかわかりません。ご指導いただければ幸いです。

5 年前の関連記事では、grub-probe の使用が推奨されています (まだ試していません)。また、grub には多くのドキュメントがあることも示されています。確かにそうです。非常にたくさんあります。多すぎるかもしれません。

https://stackoverflow.com/questions/38139756/how-to-triple-boot-debian-arch-linux-ubuntu

Ubuntu にログインして、/proc/partitions を調べます。/dev/sda からの結果のみが表示されます。

larry@Old-Gigabyte:~$ cat /proc/partitions 
major minor  #blocks  name

   8        0  976762584 sda
   8        1     524288 sda1
   8        2  167912448 sda2
   8        3  163086336 sda3
   8        4   16384000 sda4
   8        5   52428800 sda5
larry@Old-Gigabyte:~$ 

fdisk /dev/sda は次のように表示します:

Disk /dev/sda: 931.5 GiB, 1000204886016 bytes, 1953525168 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
Disklabel type: gpt
Disk identifier: 680F4B2C-CEB6-4011-A765-471C99ED79AF

Device         Start       End   Sectors   Size Type
/dev/sda1       2048   1050623   1048576   512M EFI System
/dev/sda2    1050624 336875519 335824896 160.1G Linux filesystem
/dev/sda3  336875520 663048191 326172672 155.5G Linux filesystem
/dev/sda4  663048192 695816191  32768000  15.6G Linux swap
/dev/sda5  695816192 800673791 104857600    50G Linux filesystem

/etc/fstab は次のとおりです:

    larry@Old-Gigabyte:~$ cat /mnt/arch/etc/fstab 
# /dev/sda5
UUID=ea07243f-d202-4061-bd97-aa166676e0de   /           ext4        rw,relatime 0 1

# /dev/sda1
UUID=21A8-3956          /efi        vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=ascii,shortname=mixed,utf8,errors=remount-ro   0 2

# /dev/sda4
UUID=35a1d790-7070-4056-8536-799099738d6b   none        swap        defaults    0 0

larry@Old-Gigabyte:~$ 

efi パーティションからの一部情報:

root@Old-Gigabyte:/mnt/efi/EFI/ubuntu# cd ../..
root@Old-Gigabyte:/mnt/efi# ls -lR
.:
total 4
drwx------ 4 root root 4096 Sep  5  2019 EFI

./EFI:
total 8
drwx------ 2 root root 4096 Sep  5  2019 BOOT
drwx------ 2 root root 4096 Mar  5  2020 ubuntu

./EFI/BOOT:
total 3748
-rwx------ 1 root root 1341560 Mar 18 20:24 BOOTX64.EFI
-rwx------ 1 root root 1222800 Mar 18 20:24 fbx64.efi
-rwx------ 1 root root 1269496 Sep  5  2019 mmx64.efi

./EFI/ubuntu:
total 3672
-rwx------ 1 root root     108 Mar 18 20:24 BOOTX64.CSV
-rwx------ 1 root root     126 Mar 18 20:24 grub.cfg
-rwx------ 1 root root 1130368 Mar 18 20:24 grubx64.efi
-rwx------ 1 root root 1277024 Mar 18 20:24 mmx64.efi
-rwx------ 1 root root 1341560 Mar 18 20:24 shimx64.efi
root@Old-Gigabyte:/mnt/efi# 

root@Old-Gigabyte:/mnt/efi# cat EFI/ubuntu/BOOTX64.CSV 
shimx64.efi,ubuntu,,This is the boot entry for ubuntu
root@Old-Gigabyte:/mnt/efi# 

root@Old-Gigabyte:/mnt/efi# cat EFI/ubuntu/grub.cfg 
search.fs_uuid 0fb648e7-69b8-4701-be8f-3a01a1c820da root hd0,gpt2 
set prefix=($root)'/boot/grub'
configfile $prefix/grub.cfg
root@Old-Gigabyte:/mnt/efi# 

実際の G​​RUB メニュー エントリは Ubuntu パーティション (最初にインストールしたもの) にあるように見えるので、ここに何かがあるようです。このファイルの内容は生成されたようで、上部に次の内容が表示されます。

root@Old-Gigabyte:/boot/grub# cat grub.cfg
#
# DO NOT EDIT THIS FILE
#
# It is automatically generated by grub-mkconfig using templates
# from /etc/grub.d and settings from /etc/default/grub
#

grub-mkconfig を見てみます...

さて、興味深いのは、Ubuntu パーティションの grub.cfg が正しいように見えることです。何らかのデイジーチェーンが起こっているのでしょうか?

/boot/grub/grub.cfg を更新するためにこれを実行しました:

root@Old-Gigabyte:/boot/grub# grub-mkconfig -o ./grub.cfg
Sourcing file `/etc/default/grub'
Generating grub configuration file ...
Found linux image: /boot/vmlinuz-5.4.0-72-generic
Found initrd image: /boot/initrd.img-5.4.0-72-generic
Found linux image: /boot/vmlinuz-5.4.0-71-generic
Found initrd image: /boot/initrd.img-5.4.0-71-generic
Found Debian GNU/Linux 10 (buster) on /dev/sda3
Found Arch Linux on /dev/sda5
Adding boot menu entry for EFI firmware configuration
done
root@Old-Gigabyte:/boot/grub# 

最善の結果を期待して、再起動中です。

何か手がかりがあれば教えてください。

ダウンロード

関連情報