「EFI システムパーティション」の版間の差分

提供: ArchWiki
ナビゲーションに移動 検索に移動
(→‎パーティションの作成: == Check for an existing partition == を追加)
14行目: 14行目:
 
== Check for an existing partition ==
 
== Check for an existing partition ==
   
If you are installing Arch Linux on an UEFI-capable computer with an installed operating system, like [[Dual boot with Windows|Windows]] 10 for example, it is very likely that you already have an EFI system partition.
+
If you are installing Arch Linux on an UEFI-capable computer with an installed operating system, like [[Windows Arch のデュアルブート
  +
|Windows]] 10 for example, it is very likely that you already have an EFI system partition.
   
 
To find out the disk partition scheme and the system partition, use [[fdisk]] as root on the disk you want to boot from:
 
To find out the disk partition scheme and the system partition, use [[fdisk]] as root on the disk you want to boot from:

2022年1月18日 (火) 21:21時点における版

関連記事

EFI System Partition (ESP とも呼ばれます) は UEFI ファームウェアによって起動される EFI ブートローダ、アプリケーション、ドライバの格納場所として機能する OS に依存しないパーティションです。UEFI ブートには必須です。

Check for an existing partition

If you are installing Arch Linux on an UEFI-capable computer with an installed operating system, like [[Windows と Arch のデュアルブート |Windows]] 10 for example, it is very likely that you already have an EFI system partition.

To find out the disk partition scheme and the system partition, use fdisk as root on the disk you want to boot from:

# fdisk -l /dev/sdx

The command returns:

  • The disk's partition table: it indicates Disklabel type: gpt if the partition table is GPT or Disklabel type: dos if it is MBR.
  • The list of partitions on the disk: Look for the EFI system partition in the list, it is usually at least 100 MiB in size and has the type EFI System or EFI (FAT-12/16/32). To confirm this is the ESP, mount it and check whether it contains a directory named EFI, if it does this is definitely the ESP.
ヒント: To find out whether it is a FAT12, FAT16 or FAT32 file system, follow FAT#Detecting FAT type.
警告: When dual-booting, avoid reformatting the ESP, as it may contain files required to boot other operating systems.

If you found an existing EFI system partition, simply proceed to #Mount the partition. If you did not find one, you will need to create it, proceed to #Create the partition.

パーティションの作成

以下のセクションでは EFI System Partition (ESP) を作成する方法を説明しています。

ノート: UEFI ファームウェアによっては UEFI-MBR ブートができないため UEFI ブートでは出来るだけ GPT を使うことが推奨されます。

ESP の容量は 512 MiB にすることが推奨されていますが他のサイズでも問題ありません [1]

Microsoft のドキュメントには ESP の容量について説明があります: Advanced Format 4K Native (4-KB-per-sector) のドライブでは、FAT32 ファイルフォーマットの制限によって、最小容量は 256 MiB となります。FAT32 のドライブの最小パーティションサイズはセクターサイズ (4KB) x 65527 = 256 MiB と計算されます。Advanced Format 512e ドライブはセクターサイズが 512 バイトだとエミュレートされているのでこの制限を受けません。512 バイト x 65527 = 32 MB、これはパーティションの最小容量 100 MB よりも少ない値です。参照: [2]

GPT でパーティションされたディスク

GPT でパーティションされたディスクに ESP を作成する場合、以下の方法のどちらかを使って下さい:

MBR でパーティションされたディスク

fdisk を使ってパーティションタイプ EFI System のパーティションを作成し、パーティションをフォーマットしてください。

パーティションのフォーマット

ESP を作成したら、FAT32 でフォーマットします:

# mkfs.fat -F32 /dev/sdxY

上記の GNU Parted を使用した場合、既にフォーマットされているはずです。

WARNING: Not enough clusters for a 32 bit FAT! というエラーが表示される場合、mkfs.fat -s2 -F32 ... あるいは -s1 を使ってクラスタのサイズを減らして下さい。エラーを放置すると UEFI からパーティションを読み取れなくなる可能性があります。

パーティションのマウント

EFISTUB の場合、カーネルと initramfs のファイルは EFI System Partition に保存する必要があります。また、EFISTUB ブートでは /boot パーティションを別に作らないで ESP を /boot パーティションとして使うことでシンプルにすることも可能です。その場合、上記のように EFI システムパーティションを作成・フォーマットした後、/bootマウントしてください。

#バインドマウントを使うも参照。

既知の問題

RAID 上に ESP を配置

ESP を RAID1 アレイに置くことも可能ですが、データが破損する危険性があり、また、ESP を作成する際に様々な注意をする必要があります。詳しくは [3][4] を見て下さい。

ヒントとテクニック

バインドマウントを使う

ESP を /boot にマウントする代わりに、バインドマウントを使うことで ESP のディレクトリを /boot にマウントすることができます (mount(8) を参照)。これによって ESP を自由に扱えるようにしつつ pacman が直接カーネルを更新できるようにすることができます。ファイルをコピーする他の方法よりもずっとシンプルな方法になります。

ノート: バインドマウントを利用するには FAT32 に対応するカーネルとブートローダーが必要です。通常の Arch のインストールでは問題になりませんが、他のディストリビューションでは問題になることがあります (つまり /boot にシンボリックリンクを必要とするディストリビューション)。フォーラムのこの投稿 を見て下さい。

EFISTUB#カーネルと initramfs を ESP にコピーするに書かれているように、ESP のディレクトリに全てのブートファイルをコピーしますが、ESP は /boot の外にマウントします (例: /esp)。そしてディレクトリをバインドマウントします:

# mount --bind /esp/EFI/arch/ /boot

ファイルが /boot に現れるようにしたい場合、fstab を編集して永続化させます:

/etc/fstab
/esp/EFI/arch /boot none defaults,bind 0 0
警告: この方法を使って起動するには root=system_root カーネルパラメータを使う必要があります。

参照