The machine was a fresh install of Ubuntu 18.04.1 and used LVM and LUKS during install.
The machine was working fine on kernel 4.15.0-33-generic.
The kernel upgraded from 4.15.0-33 to 4.15.0-34-generic.
After the kernel updated, it no longer prompts for LUKS passphrase and boots straight to BusyBox v1.27.2
When booting from the older kernel, it prompts for LUKS like normal and the machine is able to boot properly.
The issue is when booting from the newer kernel.
I tried to run fsck from a liveCD of 18.04.
I unlocked the drive first then ran
fsck -f /deb/sda3
However I only get
fsck from util-linux 2.31.1
and nothing else.
Is there a fix that I can run?
Best Answer
The problem is that
/sbin/cryptsetup
is not in initramfs file/boot/initrd.img-4.15.0-36-generic
.You need to add
CRYPTSETUP=y
in/etc/cryptsetup-initramfs/conf-hook
. You also need to add theinitramfs
option in/etc/crypttab
. Then, you have to runupdate-initramfs
, which solves this problem.Detailed solution:
When the live USB Ubuntu is ready, connect to Internet (WiFi or wired)
Open a terminal
Find the encrypted block device.
Decrypt the device
List mapped devices.
control
is a file used to send command to the device mapper.nvme0n1p3_crypt
is the decrypted device.ubuntu--vg-root
is a LVM logical volume in the LVMubuntu-vg
volume group.Create mount point. This is where we will mount the / of our system that won't boot.
Mount root logical volume
Mount pseudo file systems
Copy DNS information
Change root
Mount
/boot
, which contains the initramfs file. This partition is unencrypted.Install binwalk (to see the content of the init ram file system)
Find offset of gzipped initramfs content
The problem is that the initramfs file system does not contain cryptsetup. So, that is why there is no LUKS password prompt.
To decrypt root at boot, the initramfs needs to contain:
Add the
initramfs
option in/etc/crypttab
Add
CRYPTSETUP=y
in/etc/cryptsetup-initramfs/conf-hook
Run
update-initramfs
:Now, we have
cryptsetup
in initramfs and the Linux kernel moduledm-crypt.ko
too:Now, run update-initramfs, without -c (new) and without -v (verbose):
Verify that the initramfs is actually correct
Now, reboot.