This procedure converts a LUKS2 container to LUKS1 and then decrypts it in place using cryptsetup reencrypt --decrypt.
Warning
- This is a destructive block-level transformation.
- Ensure verified backup exists.
- Power loss during reencrypt --decrypt may corrupt the device.
- Ensure the system is on stable power (UPS recommended).
Steps:
-
Boot up the machine into a Rescue Environment Using a bootable Rocky DVD install, edit grub and add
inst.rescuethen pressCTRL+X -
Once into the rescue environment, press
CTRL + B, 2to switch the Tmux windows 2. -
Once on Window 2, run the operations below:
-
Inspect the Luks Partition by running:
lsblk -f cryptsetup luksDump <path-to-device>
-
Convert all key slots to use LUKS1 compatible parameter by running, (if using short password add
--force-password)cryptsetup luksChangeKey --pbkdf pbkdf2 <path-to-device> -
Convert LUKS2 to LUKS1 by running,
cryptsetup convert --type luks1 <path-to-device> -
Remove Encryption by running
cryptsetup reencrypt --decrypt <path-to-device>This step takes a while depending on drive size and read/write speeds.
-
Run the command below to probe partition change:
partprobe -s
-
Press
CTRL+B, 1to use windows 1. -
Choose option 1, which will auto mount the partitions and setup a chroot environment.
-
If all goes well, you'll get instruction to press enter and run the command
chroot /mnt/sysroot -
Truncate the
/etc/crypttabfilecat /dev/null > /etc/crypttab -
Edit the file
/etc/default/gruband:- Remove
luks.timeout,luks.uuid,rd.luks.uuid=... rd.luks.name=..., luks.uuid=..., luks.timeoutfields from your boot manager config. - Make sure all the lvm volumes are present in the form on
rd.lvm.lv=VolGroup/lv_Name - Example:
GRUB_CMDLINE_LINUX="audit=1 audit_backlog_limit=8192 slub_debug=P page_poison=1 vsyscall=none resume=/dev/mapper/VolGroup-swap rd.lvm.lv=VolGroup/root rd.lvm.lv=VolGroup/swap rd.lvm.lv=VolGroup/home rd.lvm.lv=VolGroup/var rd.lvm.lv=VolGroup/varlog rd.lvm.lv=VolGroup/vartmp rd.lvm.lv=VolGroup/varlog rd.lvm.lv=VolGroup/tmp rd.lvm.lv=VolGroup/varlogaudit rd.shell=0 pti=on" - Remove
-
Remake initramfs
dracut -fv --kver $(ls -1 /usr/lib/modules) -
Regenerate the grub configuration
grub2-mkconfig -o /boot/grub2/grub.cfg -
Exit chroot and rescue environment. The system will reboot and encryption removed.