Hi. I recently started using DietPi and I love it already! However, there is this one major nagging issue: I haven’t been able to encrypt (most of) my DietPi system installation.
On my previous Raspberry Pi’s I have been using Berryboot as a simple way to encrypt my installations. Unfortunately, development was stopped years ago and the RPI Zero 2 W (which I have now) was never supported
Therefore, I have been looking for other means to encrypt the system. I found this great guide which I successfully tried on a regular Raspberry Pi OS installation, works like a charm.
I thought that I understood every step of the guide, I even made a few modifications by myself, but when I try using it on a DietPi installation it doesn’t work! The system hangs during the boot process, but whyyyyy?
Can someone skilled tell my why the guide isn’t working for DietPi and also suggest some modifications, PLEASE?
Did you complete the initial installation before performing the encryption? DietPi did not include encryption software on a new image. Something that may need to be installed first before encryption can be performed.
Actually I believe I did install all relevant encryption software. After flashing the DietPi image to the SD card I booted it up, activated wifi, and installed “cryptsetup-initramfs” from terminal. This installs some important dependencies as well, i.e. “cryptsetup” which is needed.
After all operations are done the system actually gets pretty far into the boot process before suddently hanging without any abvious error(s) displayed. It just freezes.
EDIT: The boot process halts before it reaches the “initramfs shell” or whatever it is called.
Ok, I am giving up on this. In my opinion it is too complicated right now to encrypt DietPi compared to regular RPI OS so I will wait until it (hopefully) becomes somewhat easier. I spent almost two whole days on this. I am very patient but this is it for me
If somebody would like to go through all the steps involved and provide me with an image having the following specs I wouldn’t break his or her leg
No changes from a basic install except for ETH and WIFI modules turned off (no packages removed). Nothing else changed during setup.
Root partition encrypted with the password “unlock”. Even I know how to change that.
I have read the instructions, which you provided in your first post and this part seems to be wrong:
cryptdevice=/dev/mmcblk0p2:sdcard
It will be decrypted as /dev/mapper/sdcard and not as /dev/mapper/rootfs.
It should have been:
cryptdevice=/dev/mmcblk0p2:rootfs
I would not recommend using /dev/mmcblk0p2 here, since it can change, if another SD card is connected to the Raspberry Pi. Better use the UUID of the partition.
You may want to check out my updated instructions for Raspberry Pi OS (Debian 12 Bookworm, ARM64).