In certain Ubuntu versions (e.g. Xubuntu 18.10) this issue might be caused by an apt autoremove
. Due to this bug apt will suggest to remove
cryptsetup cryptsetup-bin cryptsetup-initramfs cryptsetup-run dmeventd libdevmapper-event1.02.1 liblvm2app2.2 liblvm2cmd2.02 libreadline5 lvm2
which makes the system non-bootable (because the root partiation cannot be mounted and unencrypted using LVM).
If you are not using LVM and disk encryption this answer is probably not for you.
I was able to fix it by re-installing cryptsetup and lvm2 in a chroot environment: boot from a live USB stick, run commands below in a terminal, reboot.
# find root partition
sudo fdisk -l
# unencrypt partition
# Note: replace /dev/nvme0n1p3 with your disk
# replace "nvme0n1p3_crypt" with the correct name
# check by running this in chroot:
# $ cat /etc/crypttab | cut -f1 -d " "
# nvme0n1p3_crypt
sudo cryptsetup luksOpen /dev/nvme0n1p3 nvme0n1p3_crypt
# mount root partition
sudo vgscan
sudo vgchange -ay
sudo mount /dev/mapper/xubuntu--vg-root /mnt
# prepare chroot environment
sudo mount /dev/nvme0n1p2 /mnt/boot/ # replace nvme0n1p2 with your boot partition!
sudo mount -o rbind /dev/ /mnt/dev/
sudo mount -t proc proc /mnt/proc/
sudo mount -t sysfs sys /mnt/sys/
# make dns available in chroot
sudo cp /etc/resolv.conf /mnt/etc/resolv.conf
# enter chroot
sudo chroot /mnt /bin/bash
# re-install missing packages
apt install cryptsetup lvm2
# re-generate (this might be done also by apt in the step before, I'm not sure)
update-initramfs -u -k all
# Leave chroot environment - not sure if the following is really necessary...
exit
# Write buffers to disk
sudo sync
# Unmount file systems
sudo umount /mnt/sys
sudo umount /mnt/proc
sudo umount /mnt/boot
This Q&A helped me collecting the commands.
This Q&A is kind of related, but maybe not relevant for you anylonger if you are having this issue already.
lsblk
and add the output to your question.lsblk
is not available?