android boot with forceencrypt take a long time
4
votes
0
answers
867
views
I am building cm-13.0 for oneplus bacon here. I want the ROM to encrypt on first boot, so I changed the flag in Android fstab file (device/oneplus/bacon/rootdir/etc) from encryptable to forceencrypt.
Before:
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,errors=panic wait,check,formattable,encryptable=/dev/block/platform/msm_sdcc.1/by-name/reserve4
/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs noatime,nosuid,nodev,rw,inline_xattr wait,check,formattable,encryptable=/dev/block/platform/msm_sdcc.1/by-name/reserve4
after:
/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 noatime,nosuid,nodev,barrier=1,data=ordered,noauto_da_alloc,errors=panic wait,check,formattable,forceencrypt=/dev/block/platform/msm_sdcc.1/by-name/reserve4
/dev/block/platform/msm_sdcc.1/by-name/userdata /data f2fs noatime,nosuid,nodev,rw,inline_xattr wait,check,formattable,**forceencrypt**=/dev/block/platform/msm_sdcc.1/by-name/reserve4
and it worked, but the first boot took more than 2 hours. And I read on android development site (https://source.android.com/security/encryption/index.html)
> What we’ve added for Android 5.0 Created fast encryption, which only
> encrypts used blocks on the data partition **to avoid first
> boot taking a long time**. Only ext4 and f2fs filesystems
> currently support fast encryption. Added the forceencrypt flag to
> encrypt on first boot.
How can I avoid this long boot time?
Note: *if I keep the flag "encryptable" and boot the device then go to Settings -> security -> encryption and click encrypt, it will take less than 7 minutes for the process to finish. Why is it so long?*
Asked by Osama
(141 rep)
Apr 12, 2016, 11:07 AM
Last activity: Dec 22, 2020, 10:50 AM
Last activity: Dec 22, 2020, 10:50 AM