Skip to content
This repository has been archived by the owner on Apr 9, 2022. It is now read-only.

Encrypted root not mounting #837

Open
ShayBox opened this issue Sep 2, 2019 · 3 comments
Open

Encrypted root not mounting #837

ShayBox opened this issue Sep 2, 2019 · 3 comments
Labels
bug Bugs and errors need more info

Comments

@ShayBox
Copy link

ShayBox commented Sep 2, 2019

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 ShayBox added the bug Bugs and errors label Sep 2, 2019
@erazemk
Copy link
Member

erazemk commented Sep 3, 2019

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.

@ShayBox
Copy link
Author

ShayBox commented Sep 3, 2019

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

@erazemk
Copy link
Member

erazemk commented Sep 3, 2019

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.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Bugs and errors need more info
Projects
None yet
Development

No branches or pull requests

2 participants