FORUMS
Remove All Ads from XDA

[Q] mount cryptfs?

38 posts
Thanks Meter: 1
 
By dy/dx, Member on 15th October 2013, 07:47 AM
Post Reply Email Thread
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!
 
 
24th November 2013, 10:43 PM |#2  
Member
Thanks Meter: 91
 
Donate to Me
More
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
The Following 4 Users Say Thank You to Lekensteyn For This Useful Post: [ View ] Gift Lekensteyn Ad-Free
8th February 2014, 11:17 PM |#3  
OP Member
Thanks Meter: 1
 
More
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?
9th February 2014, 01:21 PM |#4  
Member
Thanks Meter: 91
 
Donate to Me
More
Quote:
Originally Posted by dy/dx

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.
28th February 2014, 12:53 PM |#5  
Junior Member
Thanks Meter: 0
 
More
No such file or directory
Quote:
Originally Posted by Lekensteyn

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?
4th March 2014, 10:52 AM |#6  
Member
Thanks Meter: 91
 
Donate to Me
More
Quote:
Originally Posted by svengo

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.
The Following User Says Thank You to Lekensteyn For This Useful Post: [ View ] Gift Lekensteyn Ad-Free
8th July 2014, 04:05 PM |#7  
Junior Member
Thanks Meter: 0
 
More
Quote:
Originally Posted by Lekensteyn

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.
17th September 2015, 10:56 PM |#8  
Junior Member
Thanks Meter: 2
 
More
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.
7th March 2018, 09:06 AM |#9  
amigasmann's Avatar
Junior Member
Flag |̲̲͡ ̲▫̲͡ ̲̲̲͡͡π̲̲͡
Thanks Meter: 0
 
More
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..?
Post Reply Subscribe to Thread

Tags
adb, cryptfs, encryption, shell, vdc

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes