Removing Device Encryption from an LG G2 (International) running CM11
I decided to turn on Device Encryption on my LG G2 International yesterday. Boy was that a mistake! My phone hasn't been as unstable in years. And, as it turns out, once device encryption is enabled, it's quite a mess to turn it off.
Before I enabled I was running TWRP 18.104.22.168, but that turns out the be incompatible with the type of encryption Cyanogenmod uses (at least for the G2), and because it's incompatible it's quite a hassle to get anything flashed to the device.
I between force reboots I managed to copy TWRP 22.214.171.124 to the /system partition of my phone, allowing me to flash it over the older version. This version *will* let you unlock your /data partition, but still was unable to format the data drive.
I ended up going to the adb shell and issuing make_ext4fs /dev/block/mmcblk0p35 (this block number is specific to the LG G2, if you have a different phone, make sure you locate the correct path to the userdata partition) directly to clear the encrypted partition, finally allowing me to boot back into my phone without a password. And finally returning to a stable experience.