EFI システムパーティション

From Gentoo Wiki
Jump to:navigation Jump to:search
This page is a translated version of the page EFI System Partition and the translation is 73% complete.
Resources

EFI システムパーティション (EFI system partition, ESP) FAT 形式のパーティションで、インストールされているオペレーティングシステムのためのプライマリ EFI ブートローダを含んでいます。

カーネル

Advanced partition selection(CONFIG_PARTITION_ADVANCED)と、EFI GUID Partition support(CONFIG_EFI_PARTITION)が有効になっていなければなりません:

カーネル GPT サポートを有効にする
-*- Enable the block layer --->
   Partition Types --->
      [*] Advanced partition selection
      [*] EFI GUID Partition support

FAT EFI パーティションをマウントするために、ISO8859-1 コードページも有効になっていなければなりません:

カーネル ISO8859-1 コードページと VFAT のサポートを有効化する
-*- File Systems --->
   DOS/FAT/EXFAT/NT Filesystems  --->
      <*> VFAT (Windows-95) fs support
      (437) Default codepage for FAT
      (iso8859-1) Default iocharset for FAT
   Native Language support --->
      [*] NLS ISO 8859-1  (Latin 1; Western European Languages)

特徴

作成方法については、ハンドブックを参照してください。

partedsys-block/parted)はEFIパーティションをboot, espフラグとともに表示します:

root #parted /dev/sda print
Model: ATA SAMSUNG SSD SM84 (scsi)
Disk /dev/sda: 256GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags: 
 
Number  Start   End     Size    File system  Name                          Flags
 1      1049kB  99.6MB  98.6MB  fat32        EFI System Partition          boot, esp

gdisksys-apps/gptfdisk)はEFIパーティションをEF00コードとともに表示します:

root #gdisk -l /dev/sda
GPT fdisk (gdisk) version 1.0.1
 
Partition table scan:
  MBR: protective
  BSD: not present
  APM: not present
  GPT: present
 
Found valid GPT with protective MBR; using GPT.
Disk /dev/sda: 500118192 sectors, 238.5 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 1B59C2C8-8795-4625-9718-4D636B005AC1
Partition table holds up to 128 entries
First usable sector is 34, last usable sector is 500118158
Partitions will be aligned on 2048-sector boundaries
Total free space is 2669 sectors (1.3 MiB)
 
Number  Start (sector)    End (sector)  Size       Code  Name
   1            2048          194559   94.0 MiB    EF00  EFI System Partition

ファイルシステムは mkfs.fat コマンドを使用して作成することができます:

root #mkfs.fat -F 32 /dev/sda1

サイズの考慮

Gentoo ハンドブックは ESP のために 1 GiB を割り当てることを推奨していますが、これは EFI スタブカーネルまたは Windows などの、どんなブートローダペイロードにとっても十分過ぎる量です。

マウントポイント

Mounting the ESP to /boot/efi/, as was traditionally done, is not recommended. A nested setup complicates implementation of best-practice autofs-style mounts, as establishing the inner autofs will trigger the outer one. Mounting these partitions via autofs (and by extension keeping them unmounted whenever possible) is recommended due to the data integrity and security characteristics of VFAT file systems being effectively nonexistent.

Where bootloader support is available use /boot for the XBOOTLDR partition and /efi for the ESP. If it is not possible to do so, a monolithic ESP should be mounted at /boot; autofs-style mounts should still be used.

メモ
systemd, when partitions are configured according to the Discoverable Partitions Specification, can automatically mount the ESP used for the current boot to /boot or /efi unless a different partition is mounted there [possibly via /etc/fstab] or the mount point directory is not empty. If both ESP and XBOOTLDR exist, the /efi mount point is used.

For systemd (if not using the GPT auto generator):

ファイル /etc/fstabsystemd のための ESP のマウントポイントの設定
UUID=56FE-81E0        /efi       vfat    defaults,noatime,uid=0,gid=0,umask=0077,x-systemd.automount,x-systemd.idle-timeout=600 0 2

For OpenRC, use AutoFS to mount on-demand:

root #emerge --ask net-fs/autofs

Setup a Direct AutoFS Mount for the ESP.

ファイル /etc/autofs/auto.masterConfiguring autofs to read the 'boot' file
/- /etc/autofs/auto.boot --timeout=600,sync,nodev

Tell AutoFS to watch for access to the paths /boot and /efi and mount them with options from device.

ファイル /etc/autofs/auto.bootConfiguring the ESP mountpoint
/boot    -fstype=vfat,uid=0,gid=0,umask=0077     UUID=AB12-CD34
/efi     -fstype=vfat,uid=0,gid=0,umask=0077     UUID=EF00-000A

AutoFS needs to be running to watch mountpoints:

root #rc-update add autofs default

To use the automounter before rebooting, start it manually:

root #/etc/init.d/autofs start

There is no need to add these partitions to /etc/fstab.

標準レイアウト

ESPの標準的なレイアウトです。ベンダやディストーションは、それらが使用するファイルなどをベンダ固有ディレクトリに保存していると見なされます。

user $tree -L 3 /efi
 /efi
 └── EFI
     ├── BOOT
     │   └── BOOTX64.EFI
     ├── Linux
     │   └── gentoo-x.y.z-dist.efi
     └── Microsoft
         ├── Boot
         └── Recovery

ここでは、Microsoft サブツリー (そして Boot サブツリー[1]) は、以前の Windows10 で作成されました。Boot サブツリーはフォールバックディレクトリです。もし UEFI がどのベンダ固有ディレクトリも見つけることができなかった場合、このフォールバックディレクトリから起動されます。適切にベンダ固有サブツリーが設定されたマルチブート環境では、Boot サブツリーは削除することができます。

UEFI ブートアイテム

UEFI 搭載のコンピュータは通常起動メニューと、起動アイテムを作成、並び替えそして削除するための設定ツールを備えています。ESP の内容はこれらのツールから見えます。起動アイテムを作成することは、与えられた選択肢からメディアを選び、そして ESP を見てアイテム (例えばbzImage-4.9.76-r1-gentoo.efi) を選択するようなことです。

代わりに、UEFI 起動アイテムを作成するために、efibootmgr を使用することもできます。

関連項目

参照