Encrypt From External USB

Creating a new topic off of this one.

For reference:

  • Raspberry Pi 4b
  • Ubuntu Desktop 22.04
  • ZYMKEY4
  • 1x 64GB main SD card
  • 1x 112GB external storage via USB

The documentation on encrypting an SD card mentions the following:

One thing to note is that, if the external storage device has an ext4 formatted partition with the original root file system partition (e.g. /dev/mmcblk0p2) on it, this script will use what is already on the external storage device to convert the SD card. This cuts down time for converting lots of device root file systems and allows the script to be used in a mass production deployment.

The documentation, unfortunately, doesn’t go into much detail on how to duplicate the “golden image” from the existing external storage.

My assumption was that using a fresh SD card with a basic installation and the same mk_encr_sd_rfs.sh script would just copy it over. It does, but when it reboots the final time Ubuntu desktop comes up with cryptsetup: ERROR: cryptrfs: cryptsetup failed, bad password or options?.

This would indicate the script is doing what it’s supposed to do, but the ZYMKEY is failing to decrypt it. Can anyone tell me what I’m doing wrong here?