Skip to content

Instantly share code, notes, and snippets.

@alhoo
Created July 25, 2018 08:42
Show Gist options
  • Save alhoo/98a92abbd572030ab11cf59a1d81846c to your computer and use it in GitHub Desktop.
Save alhoo/98a92abbd572030ab11cf59a1d81846c to your computer and use it in GitHub Desktop.
Installing ubuntu 18.04 alongside windows

Preparations in windows

  • Shrink windows to free up some space for the ubuntu installation

Installing ubuntu 18.04

  • boot from the live-cd
  • create partitions for the luks storage and /boot
  • cryptsetup a new luks partition
  • launch disks
  • unlock (unencrypt) luks crypted drive
  • create vgcrypt-ubuntu-root on the unlocked luks drived
  • install ubuntu on the vgcrypt-ubuntu-root and /boot

Fixing encryption

After installation do the following to make the system bootable.

Chroot into the new installed system

mkdir  /mnt/root
mount /dev/vgcrypt/ubuntu-root /mnt/root/
mount <boot device> /mnt/boot/
cd /mnt/root
mount --bind /dev dev
mount --bind /proc proc
chroot .

Define disk encryption and make a new initial ram filesystem

echo CRYPTSETUP=y >> etc/cryptsetup-initramfs/conf-hook
CRYPT=$(lsblk -f|grep crypto|awk '{print $3}')
echo $CRYPT is your luks crypt storage. Fix if not.
echo luks-${CRYPT} ${CRYPT} none luks,timeout=180 >> /etc/crypttab
update-initramfs -u

Close the new system and boot

umount boot
umount proc
umount dev
exit
cd /
umount /mnt/root
reboot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment