You are not logged in.

#1 2024-03-15 09:52:29

hugsie
Member
Registered: 2018-01-26
Posts: 46

[SOLVED] grub not prompting for passphrase for encrypted partition

Hi,

i updated my system yesterday and after a reboot grub does not prompt me for a passphrase for my luks encrypted disk any more.

I was able to boot into a rescue system and could decrypt the disk there. So my data is safe at least. But i would like to repair the system instead of having to reinstall everything.

As far as i understand it, the passphrase prompt should be initiated by the initramfs and not by grub, right?
Regenerating the initramfs within the chroot gives me this output (can i ignore the shared library error?):

mkinitcpio -p linux

==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'default'
==> Using configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux.img
==> Starting build: '6.7.9-arch1-1'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [autodetect]
  -> Running build hook: [keyboard]
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
  -> Running build hook: [modconf]
  -> Running build hook: [block]
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
  -> Running build hook: [encrypt]
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
  -> Running build hook: [btrfs]
  -> Running build hook: [filesystems]
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux.img'
==> Initcpio image generation successful
==> Building image from preset: /etc/mkinitcpio.d/linux.preset: 'fallback'
==> Using configuration file: '/etc/mkinitcpio.conf'
  -> -k /boot/vmlinuz-linux -c /etc/mkinitcpio.conf -g /boot/initramfs-linux-fallback.img -S autodetect
==> Starting build: '6.7.9-arch1-1'
  -> Running build hook: [base]
  -> Running build hook: [udev]
  -> Running build hook: [keyboard]
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
  -> Running build hook: [modconf]
  -> Running build hook: [block]
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
  -> Running build hook: [encrypt]
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
  -> Running build hook: [btrfs]
  -> Running build hook: [filesystems]
grep: error while loading shared libraries: /usr/lib/libpcre2-8.so.0: file too short
  -> Running build hook: [fsck]
==> Generating module dependencies
==> Creating zstd-compressed initcpio image: '/boot/initramfs-linux-fallback.img'
==> Initcpio image generation successful
mkinitcpio -p linux  3.66s user 2.24s system 93% cpu 6.296 total


lsblk -f

NAME             FSTYPE      FSVER LABEL               UUID                                 FSAVAIL FSUSE% MOUNTPOINTS
loop0            squashfs    4.0                                                                  0   100% /run/live/rootfs/grml64-full.squashfs
sda                                                                                                        
|-sda1                                                                                                     
|-sda2           vfat        FAT32                     7E46-BADF                             454.9M    11% /boot
`-sda3           crypto_LUKS 2                         8cae1a86-a479-4889-9d2b-da0c7e2d3402                
  `-btrfs-system btrfs             btrfs               e59d11f1-8b57-4120-acb9-1f6cd689aae3    1.9G    85% /home
                                                                                                           /
sr0              iso9660           grml64-full 2022.11 2023-12-13-12-35-40-00                     0   100% /run/live/medium
vda              vfat        FAT12 cidata              6B76-6D42 

fstab

# /dev/mapper/btrfs-system LABEL=btrfs
UUID=e59d11f1-8b57-4120-acb9-1f6cd689aae3	/         	btrfs     	rw,relatime,compress=lzo,ssd,discard,space_cache,subvolid=258,subvol=/root,subvol=root	0 0

# /dev/sda2
UUID=7E46-BADF      				/boot     	vfat      	rw,relatime,fmask=0022,dmask=0022,codepage=437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro	0 2

# /dev/mapper/btrfs-system LABEL=btrfs
UUID=e59d11f1-8b57-4120-acb9-1f6cd689aae3	/home     	btrfs     	rw,relatime,compress=lzo,ssd,discard,space_cache,subvolid=256,subvol=/home,subvol=home	0 0

# /dev/mapper/btrfs-system LABEL=btrfs
UUID=e59d11f1-8b57-4120-acb9-1f6cd689aae3	/swap     	btrfs     	rw,relatime,compress=lzo,ssd,discard,space_cache,subvolid=259,subvol=/swap,subvol=swap	0 0

/swap/swapfile  				none      	swap      	defaults  	0 0

Here is my 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 part_gpt
insmod cryptodisk
insmod luks2
insmod gcry_rijndael
insmod gcry_rijndael
insmod gcry_sha256
insmod btrfs
cryptomount -u 8cae1a86-a479-4889-9d2b-da0c7e2d3402
set root='cryptouuid/8cae1a86a47948899d2bda0c7e2d3402'
if [ x$feature_platform_search_hint = xy ]; then
  search --no-floppy --fs-uuid --set=root --hint='cryptouuid/8cae1a86a47948899d2bda0c7e2d3402'  e59d11f1-8b57-4120-acb9-1f6cd689aae3
else
  search --no-floppy --fs-uuid --set=root e59d11f1-8b57-4120-acb9-1f6cd689aae3
fi
    font="/root/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=7
# Fallback normal timeout code in case the timeout_style feature is
# unavailable.
else
  set timeout=7
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-e59d11f1-8b57-4120-acb9-1f6cd689aae3' {
	load_video
	set gfxpayload=keep
	insmod gzio
	insmod part_gpt
	insmod fat
	set root='hd0,gpt2'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  7E46-BADF
	else
	  search --no-floppy --fs-uuid --set=root 7E46-BADF
	fi
	echo	'Loading Linux linux ...'
	linux	/vmlinuz-linux root=UUID=e59d11f1-8b57-4120-acb9-1f6cd689aae3 rw rootflags=subvol=root dobtrfs cryptdevice=UUID=8cae1a86-a479-4889-9d2b-da0c7e2d3402:btrfs-system root=/dev/mapper/btrfs-system rw rootfstype=btrfs dobtrfs cryptdevice=UUID=8cae1a86-a479-4889-9d2b-da0c7e2d3402:btrfs-system root=/dev/mapper/btrfs-system rw rootfstype=btrfs
	echo	'Loading initial ramdisk ...'
	initrd	/intel-ucode.img /initramfs-linux.img
}
submenu 'Advanced options for Arch Linux' $menuentry_id_option 'gnulinux-advanced-e59d11f1-8b57-4120-acb9-1f6cd689aae3' {
	menuentry 'Arch Linux, with Linux linux' --class arch --class gnu-linux --class gnu --class os $menuentry_id_option 'gnulinux-linux-advanced-e59d11f1-8b57-4120-acb9-1f6cd689aae3' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  7E46-BADF
		else
		  search --no-floppy --fs-uuid --set=root 7E46-BADF
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=e59d11f1-8b57-4120-acb9-1f6cd689aae3 rw rootflags=subvol=root dobtrfs cryptdevice=UUID=8cae1a86-a479-4889-9d2b-da0c7e2d3402:btrfs-system root=/dev/mapper/btrfs-system rw rootfstype=btrfs dobtrfs cryptdevice=UUID=8cae1a86-a479-4889-9d2b-da0c7e2d3402:btrfs-system root=/dev/mapper/btrfs-system rw rootfstype=btrfs
		echo	'Loading initial ramdisk ...'
		initrd	/intel-ucode.img /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-e59d11f1-8b57-4120-acb9-1f6cd689aae3' {
		load_video
		set gfxpayload=keep
		insmod gzio
		insmod part_gpt
		insmod fat
		set root='hd0,gpt2'
		if [ x$feature_platform_search_hint = xy ]; then
		  search --no-floppy --fs-uuid --set=root --hint-bios=hd0,gpt2 --hint-efi=hd0,gpt2 --hint-baremetal=ahci0,gpt2  7E46-BADF
		else
		  search --no-floppy --fs-uuid --set=root 7E46-BADF
		fi
		echo	'Loading Linux linux ...'
		linux	/vmlinuz-linux root=UUID=e59d11f1-8b57-4120-acb9-1f6cd689aae3 rw rootflags=subvol=root dobtrfs cryptdevice=UUID=8cae1a86-a479-4889-9d2b-da0c7e2d3402:btrfs-system root=/dev/mapper/btrfs-system rw rootfstype=btrfs dobtrfs cryptdevice=UUID=8cae1a86-a479-4889-9d2b-da0c7e2d3402:btrfs-system root=/dev/mapper/btrfs-system rw rootfstype=btrfs
		echo	'Loading initial ramdisk ...'
		initrd	/intel-ucode.img /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/25_bli ###
if [ "$grub_platform" = "efi" ]; then
  insmod bli
fi
### END /etc/grub.d/25_bli ###

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

### BEGIN /etc/grub.d/30_uefi-firmware ###
if [ "$grub_platform" = "efi" ]; then
	fwsetup --is-supported
	if [ "$?" = 0 ]; then
		menuentry 'UEFI Firmware Settings' $menuentry_id_option 'uefi-firmware' {
			fwsetup
		}
	fi
fi
### END /etc/grub.d/30_uefi-firmware ###

### 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 ###

Last edited by hugsie (2024-03-15 11:11:55)

Offline

#2 2024-03-15 10:49:36

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,591

Re: [SOLVED] grub not prompting for passphrase for encrypted partition

No, you cannot ignore the shared library error. One of the critical libraries on your system is corrupt, you need to reinstall it.

Offline

#3 2024-03-15 11:01:47

hugsie
Member
Registered: 2018-01-26
Posts: 46

Re: [SOLVED] grub not prompting for passphrase for encrypted partition

I reinstalled pcre and got some errors (see below)

mkinitcpio -p linux looks exactly the same afterwards as in my first post.

pacman -Syu pcre
:: Synchronizing package databases...
 core is up to date
 extra is up to date
 community is up to date
warning: pcre-8.45-4 is up to date -- reinstalling
:: Starting full system upgrade...
resolving dependencies...
looking for conflicting packages...

Packages (1) pcre-8.45-4

Total Installed Size:  3.50 MiB
Net Upgrade Size:      0.00 MiB

:: Proceed with installation? [Y/n] 
(1/1) checking keys in keyring                                                      [################################################] 100%
(1/1) checking package integrity                                                    [################################################] 100%
(1/1) loading package files                                                         [################################################] 100%
(1/1) checking for file conflicts                                                   [################################################] 100%
(1/1) checking available disk space                                                 [################################################] 100%
:: Processing package changes...
(1/1) reinstalling pcre                                                             [################################################] 100%
ldconfig: File /usr/lib/libpcre2-16.so is empty, not checked.
ldconfig: File /usr/lib/libpcre2-16.so.0 is empty, not checked.
ldconfig: File /usr/lib/libpcre2-16.so.0.12.0 is empty, not checked.
ldconfig: File /usr/lib/libpcre2-32.so is empty, not checked.
ldconfig: File /usr/lib/libpcre2-32.so.0 is empty, not checked.
ldconfig: File /usr/lib/libpcre2-32.so.0.12.0 is empty, not checked.
ldconfig: File /usr/lib/libpcre2-8.so is empty, not checked.
ldconfig: File /usr/lib/libpcre2-8.so.0 is empty, not checked.
ldconfig: File /usr/lib/libpcre2-8.so.0.12.0 is empty, not checked.
:: Running post-transaction hooks...
(1/2) Arming ConditionNeedsUpdate...
(2/2) Removing old packages from pacman cache...
Removing old installed packages...
==> no candidate packages found for pruning
Removing old uninstalled packages...
==> no candidate packages found for pruning

Last edited by hugsie (2024-03-15 11:02:39)

Offline

#4 2024-03-15 11:02:51

Scimmia
Fellow
Registered: 2012-09-01
Posts: 11,591

Re: [SOLVED] grub not prompting for passphrase for encrypted partition

Because you reinstalled the wrong package. https://wiki.archlinux.org/title/Pacman … _databases

Why is Community still in the list? It's been gone for close to a year. https://wiki.archlinux.org/title/Pacman … nd_Pacsave

Last edited by Scimmia (2024-03-15 11:08:14)

Offline

#5 2024-03-15 11:11:41

hugsie
Member
Registered: 2018-01-26
Posts: 46

Re: [SOLVED] grub not prompting for passphrase for encrypted partition

Reinstalling core/pcre2 repaired the libraries and mkinitcpio -p linux created a working initramfs.

System is booting correctly again.


Thanks, marking this as solved.

Offline

Board footer

Powered by FluxBB