[Q] mount cryptfs?

Search This thread

dy/dx

Member
Feb 13, 2006
38
1
vdc cryptfs enablecrypto/changepw exists.

Where is vdc cryptfs mount?
I.e., how can I mount the encrypted /data partition from a shell (ultimately via adb shell in recovery)?

Thanks!
 

Lekensteyn

Member
Aug 12, 2012
48
94
lekensteyn.nl
By experimentation and checking the system/vold/ source code, I was able to unlock the encrypted partition using:
Code:
setprop ro.crypto.state encrypted
vdc cryptfs checkpw 'your passphrase here'

The unlocked device is then available in /dev/block/dm-0, and can be mounted directly read-only using:
Code:
mount -o ro /dev/block/dm-0 /data

If you want it to be read/write, simply remove the -o ro part (or run mount -o remount,rw /data after running the above mount command). Do not run vdc cryptfs restart in recovery, there is nothing to catch the triggers so all future vdc commands will hang.

Oh, and when done, do not forget to unmount your partition:
Code:
umount /data
 

dy/dx

Member
Feb 13, 2006
38
1
Thanks a lot, that sounds great.

However, now I have big trouble getting vdc cryptfs to work in recovery :( It needs /dev/socket/vold but vold is not started.

I am getting a bootloop with cyanogenmod and want to disable the encryption from recovery. Any ideas how to resolve that/start vold?
 

Lekensteyn

Member
Aug 12, 2012
48
94
lekensteyn.nl
Thanks a lot, that sounds great.

However, now I have big trouble getting vdc cryptfs to work in recovery :( It needs /dev/socket/vold but vold is not started.

I am getting a bootloop with cyanogenmod and want to disable the encryption from recovery. Any ideas how to resolve that/start vold?

For future readers, I have a minivold process in recovery. If you do not have (mini)vold, try upgrading recovery.
 

svengo

New member
Feb 28, 2014
1
0
No such file or directory

The unlocked device is then available in /dev/block/dm-0

I tried the commands in clockwerkmod recovery but /dev/block/dm-0 isn't found (nexus 4 with Cyanogenmod 11):

Code:
~ # setprop ro.crypto.state encrypted
~ # vdc cryptfs checkpw '1234'
200 0 10
~ # mount /dev/block/dm-0 /data
mount /dev/block/dm-0 /data
mount: mounting /dev/block/dm-0 on /data failed: No such file or directory

Is there a way to access the encrypted data?
 
Last edited:

Lekensteyn

Member
Aug 12, 2012
48
94
lekensteyn.nl
I tried the commands in clockwerkmod recovery but /dev/block/dm-0 isn't found (nexus 4 with Cyanogenmod 11):

Code:
~ # setprop ro.crypto.state encrypted
~ # vdc cryptfs checkpw '1234'
200 0 10
~ # mount /dev/block/dm-0 /data
mount /dev/block/dm-0 /data
mount: mounting /dev/block/dm-0 on /data failed: No such file or directory

Is there a way to access the encrypted data?

There is likely a way, but if it does not work (this is not documented, so it might change), have a look at your logs for what went wrong. Since logcat is probably nog available, you have to read logs with cat /dev/log/system and/ or (in a second shell) cat /dev/log/main.
 
  • Like
Reactions: rahimali

boeleman

New member
Jun 12, 2014
1
0
There is likely a way, but if it does not work (this is not documented, so it might change), have a look at your logs for what went wrong. Since logcat is probably nog available, you have to read logs with cat /dev/log/system and/ or (in a second shell) cat /dev/log/main.

Don't know whether this helps, but I found that these commands work on cwm recovery while they do not on twrp. This seems to be because in cmw vold is started while in twrp it isn't.
 

_allo_

Member
Sep 17, 2015
27
3
Is there some "cryptfs clear", which wipes the crypt signature?
I am having trouble with creating a crypted data with some ROM right now and always need to override the whole device to get rid of the crypt signature (i guess in the end of the device?). So something which clears the crypt bytes, so the data can be reformatted as non-crypt partition would be useful. So the ROMS still want to mount it with password.
 

amigasmann

New member
Jan 26, 2016
4
0
problem with mounting /data

Hi, Guys... please, give me advice. I try to mount encrypted /data.
Samsung Galaxy Note 2 (N7100), CWM 6.0.4.7 / root(SU) / Android 4.4.2 stock / busybox 50 / USB Debugging ON:
Code:
C:\Users\SDK\platform-tools>adb devices
List of devices attached
4df749af12f330b7        recovery
Next:
Code:
C:\Users\SDK\platform-tools>adb shell
~ # setprop ro.crypto.state encrypted
~ # vdc cryptfs checkpw "njjm.0mk."
200 0 -1
~ # mount /dev/block/dm-0 /data
mount: mounting /dev/block/dm-0 on /data failed: No such file or directory
Logcat (system):
Code:
~ # cat /dev/log/system
'   З  З  э├*NД╫↨Vold Vold 2.1 (the revenge) firing up F   З  З  э├*NД╫↨Vold
 Volume sdcard1 state changing -1 (Initializing) -> 0 (No-Media) G   З  З  э├*N
Д╫↨Vold Volume usbdisk0 state changing -1 (Initializing) -> 0 (No-Media) @   З
 Л  э├*NБGб↓Vold Volume sdcard1 state changing 0 (No-Media) -> 2 (Pending) R
З  Л  э├*NБGб↓DirectVolume DirectVolume::handlePartitionAdded -> MAJOR 179, MIN
OR 17, PARTN 1
 F   З  Л  э├*NБGб↓Vold Volume sdcard1 state changing 2 (Pending) -> 1 (Idle-Un
Cryptfs Bad magic for real block device /dev/block/mmcblk0p16
Cryptfs Error getting crypt footer and key
 @   З  ╕  р┼*N?6р0Cryptfs Bad magic for real block device /dev/block/mmcblk0p1
6
 -   З  ╕  р┼*N?6р0Cryptfs Error getting crypt footer and key
 @   З  ╕  е╔*N╖▀[$Cryptfs Bad magic for real block device /dev/block/mmcblk0p1
6
 -   З  ╕  е╔*N╖▀[$Cryptfs Error getting crypt footer and key
Logcat (main):
Code:
~ # cat /dev/log/main
В   Д  Д  э├*N┴а¶!ARMAssembler generated scanline__00000077:03545405_00000A02_0
0000000 [ 37 ipp] (59 ins) at [0x4176c1f0:0x4176c2dc] in 133083 ns
 Б   Д  Д  э├*NБcя'ARMAssembler generated scanline__00000077:03545405_00000A01_
00000000 [ 37 ipp] (58 ins) at [0x4176c2e0:0x4176c3c8] in 54625 ns
 Б   Д  Д  э├*NБcя'ARMAssembler generated scanline__00000077:03545405_00000A08_
00000000 [ 37 ipp] (59 ins) at [0x4176c3d0:0x4176c4bc] in 38041 ns
 Б   Д  Д  э├*NA∙Ш-ARMAssembler generated scanline__00000077:03545405_00000000_
00000000 [ 36 ipp] (50 ins) at [0x4176c4c0:0x4176c588] in 64708 ns
FSTab:
Code:
~ # cat /etc/fstab
/dev/block/mmcblk0p12 /cache ext4 rw
/dev/block/mmcblk0p16 /data ext4 rw
/dev/block/mmcblk0p13 /system ext4 rw
/dev/block/mmcblk0p14 /preload ext4 rw
/dev/null /sdcard datamedia rw
/dev/block/mmcblk1p2 /sd-ext ext4 rw
/dev/block/mmcblk1p1 /external_sd auto rw
~ #
MOUNT -A:
Code:
~ # mount -a
mount: mounting /dev/block/mmcblk0p16 on /data failed: Invalid argument
I try to mount encrypted /data and delete the file *.key which contains Android SCREENLOCK password. My Xposed SecureSettings module reset my password and I can't access my Android Desktop Screen.
Please help. What can I do without FORMATting DATA..?:eek:
 
Last edited:

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    By experimentation and checking the system/vold/ source code, I was able to unlock the encrypted partition using:
    Code:
    setprop ro.crypto.state encrypted
    vdc cryptfs checkpw 'your passphrase here'

    The unlocked device is then available in /dev/block/dm-0, and can be mounted directly read-only using:
    Code:
    mount -o ro /dev/block/dm-0 /data

    If you want it to be read/write, simply remove the -o ro part (or run mount -o remount,rw /data after running the above mount command). Do not run vdc cryptfs restart in recovery, there is nothing to catch the triggers so all future vdc commands will hang.

    Oh, and when done, do not forget to unmount your partition:
    Code:
    umount /data
    1
    I tried the commands in clockwerkmod recovery but /dev/block/dm-0 isn't found (nexus 4 with Cyanogenmod 11):

    Code:
    ~ # setprop ro.crypto.state encrypted
    ~ # vdc cryptfs checkpw '1234'
    200 0 10
    ~ # mount /dev/block/dm-0 /data
    mount /dev/block/dm-0 /data
    mount: mounting /dev/block/dm-0 on /data failed: No such file or directory

    Is there a way to access the encrypted data?

    There is likely a way, but if it does not work (this is not documented, so it might change), have a look at your logs for what went wrong. Since logcat is probably nog available, you have to read logs with cat /dev/log/system and/ or (in a second shell) cat /dev/log/main.
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone