Skip to content

Unable to encrypt phone #17

@dbeniamine

Description

@dbeniamine

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,

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions