installer icon indicating copy to clipboard operation
installer copied to clipboard

Encrypted root not mounting

Open ShayBox opened this issue 6 years ago • 3 comments

I picked grub and encrypted lvm options, it set up the encryption but didn't configure grub to ask for a password, so it never tries to mount the roots and fails to boot.

EDIT: I don't know what I was thinking with grub, the installer just didnt run mkinitcpio

ShayBox avatar Sep 02 '19 17:09 ShayBox

Here's the part of lib/configure_boot.sh that sets up GRUB:

grub_config() {

	if "$crypted" ; then
		sed -i 's!quiet!cryptdevice=/dev/lvm/lvroot:root root=/dev/mapper/root!' "$ARCH"/etc/default/grub
	else
		sed -i 's/quiet//' "$ARCH"/etc/default/grub
	fi

	if "$drm" ; then
		sed -i '/GRUB_CMDLINE_LINUX_DEFAULT=/ s/.$/ nvidia-drm.modeset=1"/;s/" /"/' "$ARCH"/etc/default/grub
	fi

	if "$UEFI" ; then
		(arch-chroot "$ARCH" grub-install --efi-directory="$esp_mnt" --target=x86_64-efi --bootloader-id=boot
		cp "$ARCH"/"$esp_mnt"/EFI/boot/grubx64.efi "$ARCH"/"$esp_mnt"/EFI/boot/bootx64.efi) &> /dev/null &
		pid=$! pri=0.1 msg="\n$grub_load1 \n\n \Z1> \Z2grub-install --efi-directory="$esp_mnt"\Zn" load

		if ! "$crypted" ; then
			arch-chroot "$ARCH" mkinitcpio -p "$kernel" &>/dev/null &
			pid=$! pri=1 msg="\n$uefi_config_load \n\n \Z1> \Z2mkinitcpio -p $kernel\Zn" load
		fi
	else
		arch-chroot "$ARCH" grub-install /dev/"$DRIVE" &> /dev/null &
		pid=$! pri=0.1 msg="\n$grub_load1 \n\n \Z1> \Z2grub-install /dev/$DRIVE\Zn" load
	fi
	arch-chroot "$ARCH" grub-mkconfig -o /boot/grub/grub.cfg &> /dev/null &
	pid=$! pri=0.1 msg="\n$grub_load2 \n\n \Z1> \Z2grub-mkconfig -o /boot/grub/grub.cfg\Zn" load

}

It does appear to run mkinitcpio, so that shouldn't be the problem. Please try the installation again and post the log (/tmp/anarchy.log).

Edit: Also please don't reference unrelated issues, best to comment on each one separately. You can also add a thumbs up on them if you've also run into them, to keep the comment section cleaner.

erazemk avatar Sep 03 '19 19:09 erazemk

I don't know, I just know at some point it's either not running mkinitcpio, or it's running it before it edits the file to include the encrypt hook, going in and running it again fixes it

ShayBox avatar Sep 03 '19 19:09 ShayBox

Ok, I'll try it out on a test machine and try and see where it fails. If possible please still try to post logs.

erazemk avatar Sep 03 '19 21:09 erazemk