[LineageOS Questions & Answers] wenzhi Chen:
We all know that there are two types of file encryption, one is called "wipe" and the other is "inplace". I have a project and I have to test how to use wipe to encrypt.

So I had a test about the ‘wipe’ encryption in pure lineageOS14.1 but unfortunately it failed. Here are my steps:*

1. Change the parameter "forcefdeorfbe" to "encryptable" in file fstab.angler then recompile the lineage source code to disable the forced encryption in Google Nexus 6P*

2. Get the root of the Nexus 6P (su root)*

3. Type the command in adb:

vdc cryptfs enablecrypto wipe password qwer

to use ‘wipe’ to delete all the files and then encrypt the system with the password set to ‘qwer’.*

Then my cell phone restarted without the encryption that I had expected, here is my log of that error:

02-05 06:22:00.701 370 3185 I Cryptfs : Enabling support for allow_discards in dmcrypt.*

02-05 06:22:00.701 370 3185 I Cryptfs : target_type = crypt*

02-05 06:22:00.701 370 3185 I Cryptfs : real_blk_name = /dev/block/platform/soc.0/f9824900.sdhci/by-name/userdata, extra_params = 1 allow_discards*

02-05 06:22:05.740 370 3185 E Cryptfs : Cannot load dm-crypt mapping table.*

02-05 06:22:05.741 370 3185 I Cryptfs : Making empty filesystem with command /system/bin/make_ext4fs -a /data -l 58688269824 /dev/block/dm-0*

02-05 06:22:05.811 370 3185 I make_ext4fs: SELinux: Loaded file_contexts contexts from /file_contexts.bin.*

02-05 06:22:05.812 370 3185 I make_ext4fs: Creating filesystem with parameters:*

02-05 06:22:05.812 370 3185 I make_ext4fs: Size: 58688266240*

02-05 06:22:05.812 370 3185 I make_ext4fs: Block size: 4096*

02-05 06:22:05.812 370 3185 I make_ext4fs: Blocks per group: 32768*

02-05 06:22:05.812 370 3185 I make_ext4fs: Inodes per group: 8192*

02-05 06:22:05.812 370 3185 I make_ext4fs: Inode size: 256*

02-05 06:22:05.812 370 3185 I make_ext4fs: Journal blocks: 32768*

02-05 06:22:05.812 370 3185 I make_ext4fs: Label:*

02-05 06:22:05.812 370 3185 I make_ext4fs: Blocks: 14328190*

02-05 06:22:05.812 370 3185 I make_ext4fs: Block groups: 438*

02-05 06:22:05.812 370 3185 I make_ext4fs: Reserved block group size: 1024*

02-05 06:22:05.826 370 3185 I make_ext4fs: Created filesystem with 11/3588096 inodes and 271280/14328190 blocks*

02-05 06:22:05.826 370 3185 I make_ext4fs: error: file_write: write: No space left on device*

02-05 06:22:05.830 370 3185 D Cryptfs : Successfully created filesystem on /dev/block/dm-0*

I read the function called cryptfs_enable_internal in the file cryptfs.c and there is a variable called "no_ui", it seems that this variable separated the process of encryption into two parts: the preparation before reboot and the real encryption after reboot. Although I don't think this variable should be used in this command when I want to use the ‘wipe’ command to wipe the cell phone and encrypt the cell phone. However, I still tried this:*

vdc cryptfs enablecrypto wipe password qwer noui*

The cell phone warned me that the data was corrupted and must have a factory reset.*

So now I can only use "inplace" to encryt my cell phone, could you please give me some ideas about:*

Is there anything wrong with my steps that makes the ‘wipe’ encryption never successful on my phone?