Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to encrypt phone #17

Open
dbeniamine opened this issue Jan 17, 2021 · 0 comments
Open

Unable to encrypt phone #17

dbeniamine opened this issue Jan 17, 2021 · 0 comments

Comments

@dbeniamine
Copy link

Hi there,

Thanks again for the ROM, I am using the 17.1 now ("official" build, fresh install) and it works well, but I had an issue : I was not able to encrypt my phone: the phone reboots and does not compelte encryption.

I did the encryption process with logcat and could identify this error:

E Cryptfs : Bad magic for real block device /dev/block/bootdevice/by-name/userdata
E Cryptfs : Orig filesystem overlaps crypto footer region.  Cannot encrypt in place.

After a quick search if found a similar issue on another device.

I understood that the issue was that the device /dev/block/bootdevice/by-name/userdata was using all the space available while encrypt requires 16 kB free (4 blocks), so I did the following :

  1. Reboot to recovery
  2. Launch adb shell
  3. Identify the device : ls -l /dev/block/bootdevice/by-name/userdata which showed that it was a link to /dev/block/mmcblk0p48
  4. Get the size in block of the device tune2fs -l /dev/block/mmcblk0p48, get the value of block count, in my case 6372217
  5. Umount the device umount /sdcard
  6. e2fsck -y -f /dev/block/mmcblk0p48
  7. resize2fs /dev/block/mmcblk0p48 6372213
  8. reboot

After that I was able to encrypt my phone

I discourage anyone who does not understand the above commands to use them at a bad command could result on data loss.

I guess this could be fixed in the ROM by changing the default size of the sdcard filesystem to keep these 16kB

Best regards,

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant