How to mount encrypted /data in recovery

I’ve read this discussion about mounting an encrypted /data in recovery on an FP2.

As I don’t have a FP2 but a FP1 things are quite different:

  • The custom recovery is CWM instead of TWRP. It doesn’t support mounting encrypted filesystems out of the box.
  • The phone has no hardware support for encryption. This might be less secure but it also means: This is straight Android, no vendor specific things involved.

I’ve found a solution and it only works for the FP1 with CWM as recovery:

  • boot into recovery
  • connect your phone to your PC
  • open an adb shell
  • execute setprop ro.crypto.state encrypted
  • execute vdc cryptfs checkpw "<passphrase>"
  • Your filesystem should now be decrypted and available at /dev/block/dm-0.
  • mount it: mount /dev/block/dm-0 /data

You should now be able to use it normally (e.g. create a NANDROID backup).
(Caution: If your filesystem is encrypted it might not be a good idea to store an unencrypted backup on your SD card.)

Don’t forget to unmount afterwards.

I’ve got the steps from here.

Now what are they doing exactly?

As you may know, Android uses dm-crypt for encrypting /data and vold to access most filesystems.

In CWM there is vold available, but most of the Android framework is missing.
(See here for details on the normal mounting process at boot.)

1 Like

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.