I'm a Ubuntu beginner trying to do an encrypted dual boot with Windows 10 and Ubuntu 18.04. For the Ubuntu installation, I have followed some guides where the partitions are encrypted using a bootable USB, and starting Ubuntu without installing it, for example:
- https://www.mikekasberg.com/blog/2020/04/08/dual-boot-ubuntu-and-windows-with-encryption.html and
- How can I install Ubuntu encrypted with LUKS with dual-boot?.
Both of these guides tells you to stay in the USB environment after installation to finish up the last steps. The last one being running update-initramfs -k all -c
in a chroot environment.
Every time I try to run it, Ubuntu tells me:
update-initramfs is disabled since running on read-only media.
I have tried sudo
, which did not work. I have also tried live-update-initramfs
, which did not exist, and installation of it using apt get
did not work either.
This is my third time trying to install the encrypted Ubuntu partition, and I really can't figure it out, I would really appreciate some help.
EDIT: Since it seems that the creation of the logical volumes might be the problem, here is the steps I have been following before the installation, this time from the second tutorial mentioned above.
ubuntu@ubuntu:~$ sudo cryptsetup luksFormat /dev/nvme0n1p5
WARNING!
This will overwrite data on /dev/nvme0n1p5 irrevocably.
Are you sure? (Type uppercase yes): YES
Enter passphrase for /dev/nvme0n1p5:
Verify passphrase:
ubuntu@ubuntu:~$ sudo cryptsetup luksOpen /dev/nvme0n1p5 nvme0n1p5_crypt
Enter passphrase for /dev/nvme0n1p5:
ubuntu@ubuntu:~$ sudo pvcreate /dev/mapper/nvme0n1p5_crypt
Physical volume "/dev/mapper/nvme0n1p5_crypt" successfully created.
ubuntu@ubuntu:~$ sudo vgcreate ubuntu-vg /dev/mapper/nvme0n1p5
Device /dev/mapper/nvme0n1p5 not found.
ubuntu@ubuntu:~$ sudo vgcreate ubuntu-vg /dev/mapper/nvme0n1p5_crypt
Volume group "ubuntu-vg" successfully created
ubuntu@ubuntu:~$ sudo lvcreate -n swap_1 -L 16g ubuntu-vg
Logical volume "swap_1" created.
ubuntu@ubuntu:~$ sudo lvcreate -n root -L 290g ubuntu-vg
Logical volume "root" created.
ubuntu@ubuntu:~$ sudo mkfs.ext4 /dev/mapper/ubuntu--vg-root
mke2fs 1.44.1 (24-Mar-2018)
Creating filesystem with 76021760 4k blocks and 19005440 inodes
Filesystem UUID: 79a0b577-0e14-444f-9bac-816bebd67be4
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
4096000, 7962624, 11239424, 20480000, 23887872, 71663616
Allocating group tables: done
Writing inode tables: done
Creating journal (262144 blocks): done
Writing superblocks and filesystem accounting information: done
ubuntu@ubuntu:~$ sudo mkswap /dev/mapper/ubuntu--vg-swap_1
Setting up swapspace version 1, size = 16 GiB (17179865088 bytes)
no label, UUID=4552fc09-0e77-4eab-a379-e221d83b0e3f
ubuntu@ubuntu:~$
Here follows the commands I applied after the installation, where I chose "something else", and assigned the volumes according to the tutorial. This time the update-initramfs
command worked, but gives some warnings.
ubuntu@ubuntu:~$ sudo blkid /dev/nvme0n1p5
/dev/nvme0n1p5: UUID="db4b0e02-96ab-438b-8961-b0c8ad6ad65c" TYPE="crypto_LUKS" PARTUUID="80424d8a-ad5f-4c59-bacd-5979d2a68a92"
ubuntu@ubuntu:~$ sudo mount /dev/mapper/ubuntu--vg-root /mnt
ubuntu@ubuntu:~$ sudo mount /dev/nvme0n1
nvme0n1 nvme0n1p1 nvme0n1p2 nvme0n1p3 nvme0n1p4 nvme0n1p5 nvme0n1p6
ubuntu@ubuntu:~$ sudo mount /dev/nvme0n1p4 /mnt/boot
ubuntu@ubuntu:~$ sudo mount --bind /dev /mnt/dev
ubuntu@ubuntu:~$ sudo chroot /mnt
root@ubuntu:/# mount -t proc proc /proc
root@ubuntu:/# mount -t sysfs sys /sys
root@ubuntu:/# mount -t devpts devpts /dev/pts
root@ubuntu:/# nano /etc/crypttab
root@ubuntu:/# cat /etc/crypttab
# <target name> <source device> <key file> <options>
nvme0n1p5_crypt UUID=db4b0e02-96ab-438b-8961-b0c8ad6ad65c none luks,retry=1,lvm=ubuntu-vg
root@ubuntu:/# update-initramfs -k all -c
update-initramfs: Generating /boot/initrd.img-5.4.0-42-generic
W: Possible missing firmware /lib/firmware/i915/tgl_dmc_ver2_04.bin for module i915
W: Possible missing firmware /lib/firmware/i915/skl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/bxt_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/glk_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/kbl_guc_33.0.0.bin for module i915
W: Possible missing firmware /lib/firmware/i915/icl_guc_33.0.0.bin for module i915
root@ubuntu:/#
lsblk
andmount | grep /dev
would help with diagnostics. – Mikebdict Aug 21 '20 at 18:34