Skip to content

Instantly share code, notes, and snippets.

@iesplin
iesplin / mk_encr_ext_rfs.sh
Last active February 26, 2020 05:25
Zymkey script for migrate existing SD card root fs to external LUKS storage device. Added support for Ubuntu 18.04.4
#!/bin/bash
#
# This script will make an encrypted root file system on a USB drive with the
# following steps:
# 1) create a LUKS key that is locked up by zymkey
# 2) create a LUKS dm-crypt partition on an external drive
# 3) create an ext4 volume on the dm-crypt partition
# 5) copy the existing root file system on /dev/mmcblkXpY (X=0, Y=2 by default)
# to the dm-crypt volume
# 6) create an initramfs which will be used to boot to the dm-crypt volume
@iesplin
iesplin / mk_encr_sd_rfs.sh
Created February 26, 2020 05:19
Zymkey script for converting an existing SD card root fs to LUKS. Added support for Ubuntu 18.04.4
#!/bin/bash
#
# This script will make an encrypted root file system on the RPi SD card.
# This script needs an external storage device which is used for hosting
# a temporary root file system as well as storing the temporary backup
# of the root file system on the SD card. The script is equipped to
# recognize if the external drive already has the necessary components
# installed so that the migration can be expedited.
# Ensure running as root or exit