0

I've setup an encrypted UEFI-Booting Arch installation1. Why am I not asked for the phrase on booting?

Remark: If I change the name crypto in `/etc/crypttab` to e.g. encryptedBOOT I am required to enter a password on boot, though I can enter anything and get to login without a hassle.

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 "error\|warn\|fail"

[    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=()

Footnotes

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

  • 1
    the only reliable thing I understand is that UUID=b558ecc3-2d22-481b-91eb-26cdc2e86cf0 <=> /dev/sda2 (not /dev/sda3 as you probably wanted). Also since /boot is not encrypted, it looks to me that there's no need of any special GRUB support. I'm a bit baffled for the remaining part (where is retrieved the passphrase?) – A.B Mar 29 at 20:41

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.