1

I'm currently trying to enable the full disk encryption in Android on my custom board. Some informations:

  • The /data Partition is the 4th Partition on my SD Card.
  • after the /data Partition there is >2MB free space
  • the /data Partition is ext4

If I run vdc cryptfs enablecrypto inplace 1234 I get

logcat | grep crypt
E/Cryptfs ( 2407): Orig filesystem overlaps crypto footer region.  Cannot encrypt in place.

If I run vdc cryptfs enablecrypto wipe 1234 I get

device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table
device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table
device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table
device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table
device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table
device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table
device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table
device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table
device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table
device-mapper: table: 254:0: crypt: Error creating IV
device-mapper: ioctl: error adding target to table

and the device reboots afterwards...

Some extended information: fstab

cat /fstab.boundary
....
$BD4    /data    ext4    nosuid,nodev,nodiratime,noatime,nomblk_io_submit,noauto_da_alloc,errors=panic    wait,encryptable=footer
....

init.rc

cat /init.boundary.rc
...
mount_all /fstab.boundary
...

Screenshot from the partition layout: Screenshot from the partition layout

Any help is very welcome.

0

I assume you use the wrong parameter in your fstab. You can't place the footer in space already reserved for a filesystem. Either make an extra partition (sdc5) and specify footer=/dev/sdc5:0 (to put it at the beginning of this partition) or specify a negative offset to use the space at the end of the partition, e.g. to use 16k of the partition specify: encryptable=footer,length=-16384

Not sure if you'd need to make your ext4 filesystem not smaller than the partition, otherwise it could overwrite your footer.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.