脚注

脚注

暗号化されたUEFI-Booting Archインストールを設定しました1。起動時にフレーズの入力を求められないのはなぜですか?

注: 名前を変更する場合暗号通貨例えば ​​`/etc/crypttab`暗号化された起動起動時にパスワードを入力する必要がありますが、何でも入力すると簡単にログインできます。

LSBLK

NAME            MAJ:MIN RM   SIZE RO TYPE  MOUNTPOINT
sda               8:0    0 119.2G  0 disk  
├─sda1            8:1    0   100M  0 part  /boot/efi
├─sda2            8:2    0   250M  0 part  /boot
└─sda3            8:3    0 118.9G  0 part  
  └─crypto      254:0    0 118.9G  0 crypt 
    ├─Arch-swap 254:1    0   512M  0 lvm   [SWAP]
    └─Arch-root 254:2    0 118.4G  0 lvm   /

dmesg | grep -i "エラー\|警告\|失敗"

[    1.052685] acpi PNP0A08:00: _OSC failed (AE_SUPPORT); disabling ASPM
[    2.340204] RAS: Correctable Errors collector initialized.
[    9.002142] ACPI Warning: SystemIO range 0x0000000000000428-0x000000000000042F conflicts with OpRegion 0x0000000000000400-0x000000000000047F (\_SB.PCI0.LPC.PMIO) (20181213/utaddress-213)
[    9.004065] ACPI Warning: SystemIO range 0x0000000000000540-0x000000000000054F conflicts with OpRegion 0x0000000000000500-0x000000000000057F (\_SB.PCI0.LPC.LPIO) (20181213/utaddress-213)
[    9.004107] ACPI Warning: SystemIO range 0x0000000000000530-0x000000000000053F conflicts with OpRegion 0x0000000000000500-0x000000000000057F (\_SB.PCI0.LPC.LPIO) (20181213/utaddress-213)
[    9.004185] ACPI Warning: SystemIO range 0x0000000000000500-0x000000000000052F conflicts with OpRegion 0x0000000000000500-0x000000000000057F (\_SB.PCI0.LPC.LPIO) (20181213/utaddress-213)
[    9.455380] platform regulatory.0: Direct firmware load for regulatory.db failed with error -2
[    9.455385] cfg80211: failed to load regulatory.db
[  175.019957] random: 5 urandom warning(s) missed due to ratelimiting

df-h

Filesystem             Size  Used Avail Use% Mounted on
dev                    1.9G     0  1.9G   0% /dev
run                    1.9G  756K  1.9G   1% /run
/dev/mapper/Arch-root  117G  1.8G  109G   2% /
tmpfs                  1.9G     0  1.9G   0% /dev/shm
tmpfs                  1.9G     0  1.9G   0% /sys/fs/cgroup
tmpfs                  1.9G     0  1.9G   0% /tmp
/dev/sda2              243M   76M  155M  33% /boot
/dev/sda1               99M  125K   99M   1% /boot/efi
tmpfs                  383M     0  383M   0% /run/user/0

cryptsetup luksDump /dev/sda3

LUKS header information
Version:        2
Epoch:          4
Metadata area:  16384 [bytes]
Keyslots area:  16744448 [bytes]
UUID:           16459d28-76a6-40c4-b96d-090cf2f411fc
Label:          (no label)
Subsystem:      (no subsystem)
Flags:          (no flags)

Data segments:
  0: crypt
    offset: 16777216 [bytes]
    length: (whole device)
    cipher: aes-xts-plain64
    sector: 512 [bytes]

Keyslots:
  0: luks2
    Key:        512 bits
    Priority:   normal
    Cipher:     aes-xts-plain64
    Cipher key: 512 bits
    PBKDF:      argon2i
    Time cost:  4
    Memory:     608808
    Threads:    4
    Salt:       10 23 09 25 cd 08 38 47 e4 56 27 2f e9 ab d6 96 
                61 ed 32 9a 6a f7 36 a6 12 d3 1e 8b 02 4b cf f3 
    AF stripes: 4000
    AF hash:    sha512
    Area offset:32768 [bytes]
    Area length:258048 [bytes]
    Digest ID:  0
  1: luks2
    Key:        512 bits
    Priority:   normal
    Cipher:     aes-xts-plain64
    Cipher key: 512 bits
    PBKDF:      argon2i
    Time cost:  4
    Memory:     605120
    Threads:    4
    Salt:       2e df 79 1d 5b c8 2d d6 89 c3 d0 7c a7 47 a7 e1 
                d4 63 4e 42 38 51 0d 12 4d a8 cd dd 09 d0 cb 1b 
    AF stripes: 4000
    AF hash:    sha256
    Area offset:290816 [bytes]
    Area length:258048 [bytes]
    Digest ID:  0
Tokens:
Digests:
  0: pbkdf2
    Hash:       sha512
    Iterations: 125307
    Salt:       11 8b 07 aa 78 49 32 4e bf a7 8b b0 8a 29 89 d6 
                ff 5d 90 3f a4 68 ee f6 c5 71 7a 44 10 7e 0d 1f 
    Digest:     d4 42 ae 00 6c 03 d1 ab b9 37 62 4a ce be 93 dd 20 d4 71 6e 03 7b 92 40 b4 8d ff 54 3c 97 72 21 
                3b 86 fe 5e ec 18 79 2f 1f 3c 19 d8 20 94 44 a1 06 b7 44 30 a5 75 4d 5b f8 a1 cc 03 c6 a9 98 0f 

/etc/default/grub

# GRUB boot loader configuration

GRUB_DEFAULT=0
GRUB_TIMEOUT=5
GRUB_DISTRIBUTOR="Arch"
GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:crypto resume=/dev/mapper/Arch-swap"

# Preload both GPT and MBR modules so that they are not missed
GRUB_PRELOAD_MODULES="part_gpt part_msdos"

# Uncomment to enable booting from LUKS encrypted devices
GRUB_ENABLE_CRYPTODISK=y

# Uncomment to enable Hidden Menu, and optionally hide the timeout count
#GRUB_HIDDEN_TIMEOUT=5
#GRUB_HIDDEN_TIMEOUT_QUIET=true

# Uncomment to use basic console
GRUB_TERMINAL_INPUT=console

# Uncomment to disable graphical terminal
#GRUB_TERMINAL_OUTPUT=console

# The resolution used on graphical terminal
# note that you can use only modes which your graphic card supports via VBE
# you can see them in real GRUB with the command `vbeinfo'
GRUB_GFXMODE=auto

# Uncomment to allow the kernel use the same resolution used by grub
GRUB_GFXPAYLOAD_LINUX=keep

# Uncomment if you want GRUB to pass to the Linux kernel the old parameter
# format "root=/dev/xxx" instead of "root=/dev/disk/by-uuid/xxx"
#GRUB_DISABLE_LINUX_UUID=true

# Uncomment to disable generation of recovery mode menu entries
GRUB_DISABLE_RECOVERY=true

# Uncomment and set to the desired menu colors.  Used by normal and wallpaper
# modes only.  Entries specified as foreground/background.
#GRUB_COLOR_NORMAL="light-blue/black"
#GRUB_COLOR_HIGHLIGHT="light-cyan/blue"

# Uncomment one of them for the gfx desired, a image background or a gfxtheme
#GRUB_BACKGROUND="/path/to/wallpaper"
#GRUB_THEME="/path/to/gfxtheme"

# Uncomment to get a beep at GRUB start
#GRUB_INIT_TUNE="480 440 1"

# Uncomment to make GRUB remember the last selection. This requires to
# set 'GRUB_DEFAULT=saved' above.
#GRUB_SAVEDEFAULT="true"

/boot/grub/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
#
### BEGIN /etc/grub.d/00_header ###
insmod part_gpt
insmod part_msdos
if [ -s $prefix/grubenv ]; then
  load_env
fi
if [ "${next_entry}" ] ; then
   set default="${next_entry}"
   set next_entry=
   save_env next_entry
   set boot_once=true
else
   set default="0"
fi

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
else
  menuentry_id_option=""
fi

export menuentry_id_option

if [ "${prev_saved_entry}" ]; then
  set saved_entry="${prev_saved_entry}"
  save_env saved_entry
  set prev_saved_entry=
  save_env prev_saved_entry
  set boot_once=true
fi

function savedefault {
  if [ -z "${boot_once}" ]; then
    saved_entry="${chosen}"
    save_env saved_entry
  fi
}

function load_video {
  if [ x$feature_all_video_module = xy ]; then
    insmod all_video
  else
    insmod efi_gop
    insmod efi_uga
    insmod ieee1275_fb
    insmod vbe
    insmod vga
    insmod video_bochs
    insmod video_cirrus
  fi
}

if [ x$feature_default_font_path = xy ] ; then
   font=unicode
else
insmod lvm
insmod ext2
set root='lvmid/YPm8Dv-HYiA-CyfU-yV0y-aVH0-n917-W3uEwd/GyClul-dXdo-8gyf-j0N4-RwTG-wFVt-3KH4fO'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='lvmid/YPm8Dv-HYiA-CyfU-yV0y-aVH0-n917-W3uEwd/GyClul-dXdo-8gyf-j0N4-RwTG-wFVt-3KH4fO'  46268152-ba54-4ecf-ad04-b381c8da1c2b
else
  search --no-floppy --fs-uuid --set=root 46268152-ba54-4ecf-ad04-b381c8da1c2b
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm
if [ x$feature_timeout_style = xy ] ; then
  set timeout_style=menu
  set timeout=5
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=5
fi
### END /etc/grub.d/00_header ###

### BEGIN /etc/grub.d/10_linux ###
menuentry 'Arch Linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-simple-46268152-ba54-4ecf-ad04-b381c8da1c2b' {
    load_video
    set gfxpayload=keep
    insmod gzio
    insmod part_gpt
    insmod ext2
    set root='hd0,gpt2'
    if [ x$feature_platform_search_hint = xy ]; then
      search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b558ecc3-2d22-481b-91eb-26cdc2e86cf0
    else
      search --no-floppy --fs-uuid --set=root b558ecc3-2d22-481b-91eb-26cdc2e86cf0
    fi
    echo    'Loading Linux linux ...'
    linux   /vmlinuz-linux root=/dev/mapper/Arch-root rw cryptdevice=/dev/sda3:crypto resume=/dev/mapper/Arch-swap quiet
    echo    'Loading initial ramdisk ...'
    initrd  /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-46268152-ba54-4ecf-ad04-b381c8da1c2b' {
    menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-46268152-ba54-4ecf-ad04-b381c8da1c2b' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b558ecc3-2d22-481b-91eb-26cdc2e86cf0
        else
          search --no-floppy --fs-uuid --set=root b558ecc3-2d22-481b-91eb-26cdc2e86cf0
        fi
        echo    'Loading Linux linux ...'
        linux   /vmlinuz-linux root=/dev/mapper/Arch-root rw cryptdevice=/dev/sda3:crypto resume=/dev/mapper/Arch-swap quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-linux.img
    }
    menuentry 'Arch Linux, with Linux linux (fallback initramfs)' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-fallback-46268152-ba54-4ecf-ad04-b381c8da1c2b' {
        load_video
        set gfxpayload=keep
        insmod gzio
        insmod part_gpt
        insmod ext2
        set root='hd0,gpt2'
        if [ x$feature_platform_search_hint = xy ]; then
          search --no-floppy --fs-uuid --set=root --hint-ieee1275='ieee1275//disk@0,gpt2' --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  b558ecc3-2d22-481b-91eb-26cdc2e86cf0
        else
          search --no-floppy --fs-uuid --set=root b558ecc3-2d22-481b-91eb-26cdc2e86cf0
        fi
        echo    'Loading Linux linux ...'
        linux   /vmlinuz-linux root=/dev/mapper/Arch-root rw cryptdevice=/dev/sda3:crypto resume=/dev/mapper/Arch-swap quiet
        echo    'Loading initial ramdisk ...'
        initrd  /initramfs-linux-fallback.img
    }
}

### END /etc/grub.d/10_linux ###

### BEGIN /etc/grub.d/20_linux_xen ###
### END /etc/grub.d/20_linux_xen ###

### BEGIN /etc/grub.d/30_os-prober ###
### END /etc/grub.d/30_os-prober ###

### BEGIN /etc/grub.d/40_custom ###
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.
### END /etc/grub.d/40_custom ###

### BEGIN /etc/grub.d/41_custom ###
if [ -f  ${config_directory}/custom.cfg ]; then
  source ${config_directory}/custom.cfg
elif [ -z "${config_directory}" -a -f  $prefix/custom.cfg ]; then
  source $prefix/custom.cfg;
fi
### END /etc/grub.d/41_custom ###

ls -l /dev/disk/by-uuid

lrwxrwxrwx 1 root root 10 Mar 29 18:13 16459d28-76a6-40c4-b96d-090cf2f411fc -> ../../sda3
lrwxrwxrwx 1 root root 10 Mar 29 18:13 46268152-ba54-4ecf-ad04-b381c8da1c2b -> ../../dm-2
lrwxrwxrwx 1 root root 10 Mar 29 18:13 4ef43d75-a4c7-4ef0-84d9-66a968578ff1 -> ../../dm-1
lrwxrwxrwx 1 root root 10 Mar 29 18:13 7AE8-13D9 -> ../../sda1
lrwxrwxrwx 1 root root  9 Mar 29 18:44 9671-F6FA -> ../../sdb
lrwxrwxrwx 1 root root 10 Mar 29 18:13 b558ecc3-2d22-481b-91eb-26cdc2e86cf0 -> ../../sda2

/etc/fstab

# /dev/mapper/Arch-root
UUID=46268152-ba54-4ecf-ad04-b381c8da1c2b   /           ext4        rw,relatime 0 1

# /dev/sda2
UUID=b558ecc3-2d22-481b-91eb-26cdc2e86cf0   /boot       ext2        rw,relatime,block_validity,barrier,user_xattr,acl   0 2

# /dev/sda1
UUID=7AE8-13D9          /boot/efi   vfat        rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro   0 2

# /dev/mapper/Arch-swap
UUID=4ef43d75-a4c7-4ef0-84d9-66a968578ff1   none        swap        defaults    0 0

/etc/crypttab

# Configuration for encrypted block devices.
# See crypttab(5) for details.

# NOTE: Do not list your root (/) partition here, it must be set up
#       beforehand by the initramfs (/etc/mkinitcpio.conf).

# <name>       <device>                                     <password>              <options>
# home         UUID=b8ad5c18-f445-495d-9095-c9ec4f9d2f37    /etc/mypassword1
# data1        /dev/sda3                                    /etc/mypassword2
# data2        /dev/sda5                                    /etc/cryptfs.key
# swap         /dev/sdx4                                    /dev/urandom            swap,cipher=aes-cbc-essiv:sha256,size=256
# vol          /dev/sdb7                                    none
crypto  UUID=b558ecc3-2d22-481b-91eb-26cdc2e86cf0    none                    luks,timeout=180

/etc/mkinitcpio.conf

# Configuration for encrypted block devices.
# vim:set ft=sh
# MODULES
# The following modules are loaded before any boot hooks are
# run.  Advanced users may wish to specify all system modules
# in this array.  For instance:
#     MODULES=(piix ide_disk reiserfs)
MODULES=()

# BINARIES
# This setting includes any additional binaries a given user may
# wish into the CPIO image.  This is run last, so it may be used to
# override the actual binaries included by a given hook
# BINARIES are dependency parsed, so you may safely ignore libraries
BINARIES=()

# FILES
# This setting is similar to BINARIES above, however, files are added
# as-is and are not parsed in any way.  This is useful for config files.
FILES=(/crypto_keyfile.bin)

# HOOKS
# This is the most important setting in this file.  The HOOKS control the
# modules and scripts added to the image, and what happens at boot time.
# Order is important, and it is recommended that you do not change the
# order in which HOOKS are added.  Run 'mkinitcpio -H <hook name>' for
# help on a given hook.
# 'base' is _required_ unless you know precisely what you are doing.
# 'udev' is _required_ in order to automatically load modules
# 'filesystems' is _required_ unless you specify your fs modules in MODULES
# Examples:
##   This setup specifies all modules in the MODULES setting above.
##   No raid, lvm2, or encrypted root is needed.
#    HOOKS=(base)
#
##   This setup will autodetect all modules for your system and should
##   work as a sane default
#    HOOKS=(base udev autodetect block filesystems)
#
##   This setup will generate a 'full' image which supports most systems.
##   No autodetection is done.
#    HOOKS=(base udev block filesystems)
#
##   This setup assembles a pata mdadm array with an encrypted root FS.
##   Note: See 'mkinitcpio -H mdadm' for more information on raid devices.
#    HOOKS=(base udev block mdadm encrypt filesystems)
#
##   This setup loads an lvm2 volume group on a usb device.
#    HOOKS=(base udev block lvm2 filesystems)
#
##   NOTE: If you have /usr on a separate partition, you MUST include the
#    usr, fsck and shutdown hooks.
HOOKS=(base udev autodetect modconf block keymap encrypt lvm2 resume filesystems keyboard fsck)

# COMPRESSION
# Use this to compress the initramfs image. By default, gzip compression
# is used. Use 'cat' to create an uncompressed image.
#COMPRESSION="gzip"
#COMPRESSION="bzip2"
#COMPRESSION="lzma"
#COMPRESSION="xz"
#COMPRESSION="lzop"
#COMPRESSION="lz4"

# COMPRESSION_OPTIONS
# Additional options for the compressor
#COMPRESSION_OPTIONS=()

脚注

1 https://gist.github.com/HardenedArray/31915e3d73a4ae45adc0efa9ba458b07

ベストアンサー1

回答が遅れましたが、他の人に役立つ可能性があります。

UEFIシステムがあります。したがって、ブートローダは/boot/efi/EFI/ArchLinux/grubx64.efiファームウェアなどによってロードされます。ファームウェアは/boot/efiPARTUUIDを使用してUEFI NVRAMブート変数に格納されていて、それを介して見つけることができるパーティション(EFIシステムパーティション、またはESPとも呼ばれる)を見つけますefibootmgr -v。 ESPは暗号化されてはいけません。そうしないと、ファームウェアはブートローダを読み取ることができません。

ブートローダが起動すると、独自の設定ファイルが読み込まれます。構成ファイルの場所はディストリビューションによって異なりますが、一般的なシナリオはgrub.cfgESPの最小ファイルをgrubx64.efiこのファイルと同じディレクトリに配置することです。このミニにはgrub.cfg「実際」を見つけて読むのに必要な行だけが含まれています。grub.cfg/boot/grub/grub.cfg

(代替案は実際の場所をインストールgrub.cfgに含めることです...しかし、これは署名を無効にするため、セキュアブートを使用するシステムでは機能しません。)grubx64.efigrubx64.efi

あなたの場合は、/boot/efi/EFI/ArchLinux/grub.cfg次のように見えることがあります。

search.fs_uuid b558ecc3-2d22-481b-91eb-26cdc2e86cf0 root
set prefix=($root)'/grub'
configfile $prefix/grub.cfg

rootここを参照してくださいLinux ルートファイルシステムを参照しません。代わりに、GRUB構成ファイルを含むファイルシステム、つまり/bootファイルシステムのルートディレクトリです。これが最初の行でパーティションのUUIDを参照する理由です/dev/sda2

あなたの場合、/dev/sda2これは暗号化されていない設定です/boot。 mini-configはGRUBにUUIDとしてそれを見つけ、実際のGRUB設定ファイルを読み取るように指示します。これは、<root of /boot filesystem>/grub/grub.cfgオペレーティングシステムが実行されマウントされたときによく知られています。ただし、起動時にGRUBは一度に1つのファイルシステムにのみアクセスできます。/boot/grub/grub.cfg/boot

実際には、グラフィックモードを使用してgrub.cfgLinuxルートファイルシステムからロードするためのこのビットが含まれています。/usr/share/grub/unicode.pf2

set root='lvmid/YPm8Dv-HYiA-CyfU-yV0y-aVH0-n917-W3uEwd/GyClul-dXdo-8gyf-j0N4-RwTG-wFVt-3KH4fO'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='lvmid/YPm8Dv-HYiA-CyfU-yV0y-aVH0-n917-W3uEwd/GyClul-dXdo-8gyf-j0N4-RwTG-wFVt-3KH4fO'  46268152-ba54-4ecf-ad04-b381c8da1c2b
else
  search --no-floppy --fs-uuid --set=root 46268152-ba54-4ecf-ad04-b381c8da1c2b
fi
    font="/usr/share/grub/unicode.pf2"
fi

if loadfont $font ; then
  set gfxmode=auto
  load_video
  insmod gfxterm
  set locale_dir=$prefix/locale
  set lang=en_US
  insmod gettext
fi
terminal_input console
terminal_output gfxterm

GRUBはすでに暗号化されたルートファイルシステムにアクセスできますが、これまで暗号化されたLUKSボリュームを見つけるように指示されていないため、現在暗号化されているルートファイルシステムでは機能しません。 GRUBはファームウェアが提供する表示モードとフォントを使用しますが、ロードできないというメッセージを表示できます/usr/share/grub/unicode.pf2

最新のGRUBはLUKS暗号化ファイルシステムからファイルを読み取ることができますが、まずコマンドを確認する必要がありますcryptomount -u 16459d28-76a6-40c4-b96d-090cf2f411fc。これにより、GRUBはLUKSパスワードの入力を求められ、暗号化されたボリュームをGRUBにアクセスできるようになります(GRUBはファイルシステムとLVMを検索できます)。暗号化されたボリュームの内部)。

秘密情報が含まれていないため、コピーしてunicode.pf2設定するのが簡単になる可能性があるため、ルートファイルシステムにアクセスしようとする代わりに、そこからフォントをロードするコマンドを追加する方法を知ることができます。/boot/grub/GRUB_FONT=/boot/grub/unicode.pf2/etc/default/grubgrub-mkconfig

現在の構成によっては、GRUB が LUKS 暗号化を理解する必要がなくなります。つまり、/boot暗号化されていないファイルシステムからカーネルとinitramfsをロードし、パラメータセットをカーネルに渡すだけです。その後、initramfsファイルには暗号化パスワードを要求し、Linuxで使用できるように暗号化ロックを解除するスクリプトが含まれます。

現在のカーネルパラメータは次のようになりますgrub.cfg

linux   /vmlinuz-linux root=/dev/mapper/Arch-root rw cryptdevice=/dev/sda3:crypto resume=/dev/mapper/Arch-swap quiet

これは次の行によって決まります/etc/default/grub

GRUB_CMDLINE_LINUX_DEFAULT="quiet"
GRUB_CMDLINE_LINUX="cryptdevice=/dev/sda3:crypto resume=/dev/mapper/Arch-swap"

これは、ディスクデバイスの順序が変わらない限り機能しますが、起動時に誤ってUSBスティックを挿入するなどの状況に対してより強力であるため、UUIDを使用することをお勧めします。したがって、GRUB_CMDLINE_LINUXその行を次のように変更する必要があります。

GRUB_CMDLINE_LINUX="cryptdevice=UUID:16459d28-76a6-40c4-b96d-090cf2f411fc:crypto resume=/dev/mapper/Arch-swap"

ここでUUIDは、cryptsetup luksDump暗号化されたボリューム内のファイルシステムのUUIDではなく、表示されたUUIDです。これは、暗号化が最初にロック解除されるまでファイルシステムUUIDを使用できないためです。

(暗号化を使用しても同様です。GRUB/bootがcryptsetupロック解除状態をカーネルに渡すことができないためです。)GRUBが一度ロック解除された場合でも、カーネルは暗号化を再度ロック解除する必要があります。パスワードを一度入力する必要がないようにするには、initramfsの場合はinitramfsに保存されているキーファイルを使用してルートファイルシステムのロックを解除できます。絶対にしないルートファイルシステムキーファイルを含むinitramfsファイルにアクセスすると、ルートファイルシステムへのアクセスが解除されるため、暗号化されていないパーティションに保存されます。 )

このオプションは、本質的にルートファイルシステムを含むLUKSボリュームのロックを解除するinitramfsの行cryptdevice=と同じです。これが唯一のLUKSボリュームのロックを解除する必要がある場合、技術的にはまったく必要ありません。ただし、完全性のために次の行を使用してください。しなければならない:/etc/crypttab/etc/crypttab/etc/crypttab

crypto UUID=16459d28-76a6-40c4-b96d-090cf2f411fc none luks,timeout=180

ここのUUIDは、コマンドで表示されるUUIDでもありますcryptsetup luksDump。目的/etc/crypttabは、暗号化された各ボリュームがロック解除されたものとどのように表示されるか、およびロック解除がどのように行われるかを決定することです。この場合、この行はボリュームを表します/dev/sda3(ボリュームのUUIDによって識別されます。これは、ロック解除前にコンテンツとして識別するために必要なものです。ファイルシステムのUUIDまたはボリュームに保存されているLVMは使用できません)。ボリューム)LUKSボリュームであり、暗号化パスワードの自動ソースがないため、パスワードプロンプトが表示されます。これはencryptinitramfs ファイルのフックスクリプトを通して行われます。

パスワードを入力すると、initramfsは暗号化されたボリューム上のLVMボリュームグループを自動的に検出し、検出されるとすぐにArchVGを有効にします。これはすべてlvm2initramfsのフックスクリプトによって行われます。その後、アクセスできるように/dev/mapper/Arch-rootなり/dev/mapper/Arch-swap、initramfsはスワップを有効にし(オプションで休止状態のイメージがあるかどうかを確認し、その場合は復元し)、ルートファイルシステムをマウントできます。


現在、/etc/mkinitcpio.conf次の行があります。

FILES=(/crypto_keyfile.bin)

これは暗号化と組み合わせて使用​​され、/bootシステムのLUKSボリュームをロック解除するキーファイルを識別できます。つまり、cryptoを使用してGRUBの暗号化を/boot手動でロック解除する/bootと、GRUBはinitramfsがルートファイルシステム(または実際には暗号化されたボリューム)のロック解除を可能にするキーファイルを含むinitramfsファイルをロードします。追加のパスワードを入力してください。しかし、これはまた、initramfsファイルのセキュリティをシステムセキュリティにとって非常に重要にします。

暗号化されていない場合、ファイルはあなたや他の場所/bootで参照されないため、ファイルの目的を見ることはできません。/etc/crypttabこのファイルが存在し、パスワードを入力せずにLUKSボリュームをロック解除するための有効なキーが含まれている場合は、暗号化されていないinitramfsファイルで使用できます。したがって、パスワードを知らなくてもディスク暗号化のロックを解除できます。攻撃者が initramfs ファイルを調べ、crypto_keyfile.binその内容を把握します。

おすすめ記事