Help finding decrypted block device in TWRP - Sony Xperia XZ1 Compact Questions & Answers

I'm hoping to pull an image of my decrypted /data partition in order to hopefully recover some deleted files via sophisticated recovery software on the PC side of things. I manage to pull an image just fine, but it ends up being encrypted when adb is done pulling it.
From what I can gather doing a lot of google searches when you decrypt in TWRP you're supposed to get a new apparent mount/partition visible under /dev/block or thereabouts. Called "dm-0" on a lot of other phones it seems, but I don't get one of those. Decrypting directly on the phone or via adb works just fine and I can access my /data partition via the shell w/o issues.
However this still ends up being encrypted after pulling it. Is there a way to actually create and pull a decrypted image of said partition this way or am I way off? I need help finding said decrypted and supposed mount point/partition. Can't see anything new under /dev/block or as far as those directories goes so I'm at a loss.
Using:
XZ1 Compact
Android 9
TWRP 3.6.1_9-0
Latest adb from android sdk platform tools as of this writing.

Hmm. Have you tried pulling it while the phone is in recovery? If you are rooted, before pulling have you tried giving root to adb?
adb shell
su

Yes that's what I'm trying to do in order to get a decrypted image. Did not try pulling the image as root. You think that could make a difference?
EDIT: Hold on though. From the shell you can't send adb commands? I.E. opening the terminal with adb shell you have no access to adb?

knerlington said:
Hold on though. From the shell you can't send adb commands? I.E. opening the terminal with adb shell you have no access to adb?
Click to expand...
Click to collapse
adb root
adb remount
Now you're back to adb. Not sure if it will make a difference in this case, but worth a shot.
Also, you could try making a copy of the patrition via TWRP > Advanced > File manager and transferring it to PC regularly from explorer.

I have no problems making an image of said partition in different ways, but the problem is that everything that I need access to from the image file is encrypted despite making the image from twrp after decrypting it.
I'm trying to restore and recover deleted files from this partition, but in order to do that I need an image that I can use in more sophisticated recovery programs.
So is this possible at all or is there a way to decrypt an encrypted image somehow?

Related

Any way to get data back after wipe?

Ive used programs like TestDisk to get pictures from a "formatted" flash card. I forgot to backup my SMS messages before doing a wipe (backed up everything...). Is there a way I can access the phones built-in memory using software like TeskDisk?
http://www.cgsecurity.org/wiki/TestDisk
androidmonkey said:
Ive used programs like TestDisk to get pictures from a "formatted" flash card. I forgot to backup my SMS messages before doing a wipe (backed up everything...). Is there a way I can access the phones built-in memory using software like TeskDisk?
http://www.cgsecurity.org/wiki/TestDisk
Click to expand...
Click to collapse
Did you do a nandroid? if not then I am pretty sure the answer is no.
That's like formatting my HDD then asking if can i recover all those programs.
Ace42 said:
That's like formatting my HDD then asking if can i recover all those programs.
Click to expand...
Click to collapse
Umm... you do know that when you format your hard drive you can still get some of the data back, right? Unless you use a secure erase program, the data is still on the hard drive. The same goes for flash memory. Format or delete images from your flash card and use TestDisk to see what you can get back. If you havent written anything to the drive, chances are you can get it all back. For your sake, I hope you securely wipe your hdds before throwing/giving them away. That goes for everyone.
Back to the topic. I just want to know how to access the built-in memory where this stuff is stored. Some type of developer tool maybe?
I'd personally like to know what this really has to do with development. You may be looking for some "developer tool" to recover lost data, but this adds nothing to any development going on or anything.
grandomegabosses said:
I'd personally like to know what this really has to do with development. You may be looking for some "developer tool" to recover lost data, but this adds nothing to any development going on or anything.
Click to expand...
Click to collapse
The chances of such a tool existing would be known by the smart developers/coders in this forum
androidmonkey said:
The chances of such a tool existing would be known by the smart developers/coders in this forum
Click to expand...
Click to collapse
Check the rules of the forum. This section isn't meant to ask developers something. It's meant for development.
I would try booting into recovery and then use adb to manually mount your partitions. I would assume you just need to mount the /data partition.. I know this works on my Magic so just check and make sure that you have the right block device if your running on a Dream!
1. open adb shell
2. make a new directory with mkdir "name of new dir"
3. mount /data with mount -t yaffs /dev/block/mtdblock5 "name of new dir"
4. open new terminal/command prompt and use adb pull command as follows
to bring the data partition over to your computer:
adb pull "name of new dir" "name of file to be placed on computer"
5. now see if you have any files and attempt recovery of your sms database
Good Luck
[EDIT] Oh yeah the other guy's are right you should post this type of question in General next time. Fortunately I'm not a **** so I posted how I would try to rescue my stuff and remember Nandroid would have saved your ass
nrmerritt said:
I would try booting into recovery and then use adb to manually mount your partitions. I would assume you just need to mount the /data partition.. I know this works on my Magic so just check and make sure that you have the right block device if your running on a Dream!
1. open adb shell
2. make a new directory with mkdir "name of new dir"
3. mount /data with mount -t yaffs /dev/block/mtdblock5 "name of new dir"
4. open new terminal/command prompt and use adb pull command as follows
to bring the data partition over to your computer:
adb pull "name of new dir" "name of file to be placed on computer"
5. now see if you have any files and attempt recovery of your sms database
Good Luck
[EDIT] Oh yeah the other guy's are right you should post this type of question in General next time. Fortunately I'm not a **** so I posted how I would try to rescue my stuff and remember Nandroid would have saved your ass
Click to expand...
Click to collapse
Thanks nrmerritt, ill give it a try. How do I get root in adb shell via windows? When I try to mkdir, it says "Read-only file system"
Also, I do have a Dream (G1), any ideas which block to use?
Thanks
Are you using Amon_Ra's latest recovery? On my phone when I boot into recovery mode and connect with adb it's already in a root environment.
About the block device I would try the one I posted. You can always just do an "ls" command on the new directory you mounted it on before you copy it to the computer so can you see if/what files are possibly still left.
As a last resort effort you could also try the "dd" command to make an image of the partition while it's still on the phone then copy that to your computer with adb.
One more thing..If you did a wipe and rebooted your phone, your chances are not very good for recovery since the phone would have written a whole bunch of files to the data partition on first boot into Android. Side note, maybe one day Google will incorporate messages into sync and improve our lives a little.

Please Help- FRF91 unable to root with Superboot! Bricked?

I'm having serious issues with my N1 since receiving it back from HTC for a repair. I had rooted the phone before it was repaired for a crack in the glass, but the repair center had re-locked the bootloader. I followed steps the way I had done before to root my phone and succeeded in re-unlocking bootloader but when I did superboot (using mac terminal) did not come to screen where root permissions were offered... booted phone, no wifi signal, did not recognize sd, very glitchy, unstable and maybe worst of all unable to mount to computer. So I don't know if anyone with this small amount of information would have any clue as to what I can do. Oh yes and when I had gotten my phone back from repair center I had done update to FRF91.. so I know I'm an idiot for trying to use superboot when there isn't one for the FRF91. There you go gentlemen. If someone is willing to help I can provide any other information required.
As long as you can get to your recovery screen, you're not bricked. Most important, are you running a custom recovery like Amon_RA's?
Edit: If you have a stock recovery and want the superuser/unsecured boot use the updates from here
-If you have a custom recover just flash a ROM that includes superuser/unsecured boot
*Always do a Nandroid
I didn't have it before I unlocked my bootloader, and I can't seem to install it considering that every post says you put it on the sd.. and as I said I cant even mount my phone So apparently I'm on stock..
Micro SD adapter?
That does make things interesting, the only thing i can think of is getting a Micro-sd adapter and putting the update on the sd, then place the sd back in your phone and flash.
Thread moved to Q&A.
Can't you adb push the file while in the recovery menu?
I can't flash if I can't mount my sd card right? So that would make the ROM with superuser useless.. Can you think of a way I can get Amon_Ra recovery through bootloader?
I can't flash if I can't mount my sd card right? So that would make the ROM with superuser useless.. Can you think of a way I can get Amon_Ra recovery through bootloader?
I've heard about this but I'm a total n00b, don't know how to..
I was referring to the adb push.. any help with this would be GREATLY appreciated!
ADB method
If you still have the adb ability try fastboot flashing...just follow the steps here
Emul8tor I really appreciate the continuing advice- home from work now.. I can't seem to get adb if i have done everything correctly working on terminal mac os.. have android sdk and i should be running it under sdk/tools dir correct? i type in adb or adb devices and I get adb: command not found..suggestions?
Have you used the adb method before, kinda sounds like you haven't set the PATH for your environment. I don't have any clue about the set-up for Mac, but theres a tutorial here
okay going to read through this again especially part on creating the PATH.. back soon
really don't know what to think I have no idea how to create a .bash profile and I'm not so sure this is why adb isn't working. Thoughts?
and I didn't use the adb method before.. only fastboot
found this by googling, adding tools to your path lets you run Android Debug Bridge (adb) and the other command line tools without needing to supply the full path to the tools directory when typing commands in Terminal
Dude this guy's having the same problem as me, I guarantee you he used the wrong version superboot with FRF91 http://androidforums.com/all-things-root-nexus/127689-please-help.html
I'll bet he can't mount sd card either
Alright I ran adb command but it isn't registering the phone after list of devices attatched. But it did issue a string of commands after so I assume it is working... Now i guess I can say that I am truly scared because my adb doesn't even recognize the device.
Just a hunch...is debugging enabled on your device?

[Q] nc don't boot

i used this method to boot:http://forum.xda-developers.com/showthread.php?t=920347
first it worked but i powered my nc off and since it didn't boot even if a kept the n button pressed,when i plug it on my computer adb dont detect it and the light is orange in charge and on computer
plz help me
thx
cwr
i boot from cwr and used this method:http://forum.xda-developers.com/showthread.php?t=931720
but still doesn't boot
need help
please someone help me i don't know what to do
Does your NC totally not boot at all? If you followed instruction in this thread - http://forum.xda-developers.com/showthread.php?t=931720 basically you are booting from SD. In this case, it has nothing to do what's on your internal flash. Check whether your SD card is created correctly.
it boots
it only boots from CWR
i had the same problem you have. i booted into CWM using the 1 gig sdimage, put the stock boot.img and system.img (from here - http://forum.xda-developers.com/showthread.php?t=919353) and did the dd commands from adb as shown there and my system booted normally.
i had a problem with the stock B&N usb cable where it didn't detect through adb at all. i had to use a different usb cable and it worked good.
i'll try
thx i'll try it tonight,it 1 pm in france^^,tell you if it worked
i don't have any other cable,i ll try to see at virgin tomorrow ,if you have an easier way let me know
the only other way i can think of doing that is to use nookie froyo and wireless adb. the problem with this method was when i tried doing that, i had no market, so i couldn't get wireless adb. i didn't feel like doing a workaround to getting that apk on there. problem with this method is i didn't know if the partitions would look the same or even show off the nook as i was working off the sdcard for froyo, so i wouldn't be able to say if this would actually work.
using the stock B&N cable, i noticed that the device would show in adb, but not online. so reading around i found out if u used a different usb cable it might work, so i did and it did work lol.
Simply flash my repartition boot file...
Sent from my HTC Desire using XDA App
samuelhalff said:
Simply flash my repartition boot file...
Sent from my HTC Desire using XDA App
Click to expand...
Click to collapse
i looked at sam's method before as well, but didn't try it since i had luck with my usb cable connection for ADB usage. just dd-ing system and boot seemed to work for me and allowed me to keep it how i had it before (with all my previous apps installed). my partitions are probably still shorter though. flashing the zip looks like it'll restore everything to stock.
i bought a new cable,still don't work with adb ,windows detect it but it says it's two different devices and i cant change the driver,sooner nc booted under nookie froyo i don't know how,i'll try to boot again with 2.2 and work with adb from here
were u able to adb in the first place? i used this link http://forum.xda-developers.com/showthread.php?t=882751 to get it working. i also went through the nookdev site to get adb working. i was assuming it was my cable at least since it was tweaking (connecting/disconnecting) with the stock B&N usb cable.
still no adb even over nookie froyo,i try with your method
i have adb usb ,now i don't know how to do cause i only have a 2gb card so i only can put boot but not system on it,i don't know how to enter the command ,is it in adb shell?
i went through CWM and mounted system, data and sdcard. u use adb shell to get into the shell in the nook. then adb'd and
dd if=/sdcard/boot.img of=/dev/block/mmcblk0p1
dd if=/sdcard/system.img of=/dev/block/mmcblk0p5
Click to expand...
Click to collapse
did that. i guess u can put one file and then another file after the first file is dd'd. i used adb to push those img files to the sdcard.
i try it,could you make me a kind of how to with steps and stuff plz?
petithor said:
i try it,could you make me a kind of how to with steps and stuff plz?
Click to expand...
Click to collapse
in your situation this is what i would do.
boot into cwm
mount system, boot and sdcard through the menus
without entering the shell (adb shell) type in: adb push <boot.img file location> /sdcard
now enter the nook's shell by type adb shell then enter
so you're in the nook's shell, and type "dd if=/sdcard/boot.img of=/dev/block/mmcblk0p1"
delete the boot.img file so you have enough space on for the system image by typing "rm boot.img" (make sure you're in the root of sdcard)
type exit to exit the nook's shell
now you're going to push the system.img to the sdcard: adb push <system.img file location> /sdcard
enter into the nook's shell again (adb shell)
type in "dd if=/sdcard/system.img of=/dev/block/mmcblk0p5"
once that is done reboot and everything should work just like before you ran that other script.
this is pretty much what i did. i'm on windows 7 x64 so i just dragged and dropped the files into the command prompt to get the file locations.
again: http://forum.xda-developers.com/showthread.php?t=919353 for more reference of what i was doing.
it worked thx very much ,you are a god besides the humans

[Q] : some changes failed. need to transfer new rom

I was trying to install bad seeds sense 6 and sadly did not back up and did not had any old rom as aback up. the rom installed ok but i got this at the end set_metadata_recursive: some changes failed . the phone just keeps rebooting to twrp. i tried to transfer another rom via adb but im not getting my commands right, any other way to add another rom. or way to update my twrp ? please help?
kmacho714 said:
I was trying to install bad seeds sense 6 and sadly did not back up and did not had any old rom as aback up. the rom installed ok but i got this at the end set_metadata_recursive: some changes failed . the phone just keeps rebooting to twrp. i tried to transfer another rom via adb but im not getting my commands right, any other way to add another rom. or way to update my twrp ? please help?
Click to expand...
Click to collapse
Here's what to do (before having to RUU):
boot into TWRP;
connect USB cable;
adb shell into the device;
Code:
adb shell
see if /sdcard is ok (meaning you didn't mistakenly flash entirely the wrong ROM or something):
Code:
ls /sdcard
if the above shows files is a list of tings you recognize (like Downloads, Ringtones, whatever), two things are ok: i) your data area; and ii) your adb is working, then issue these commands (for good measure):
Code:
umount /system
exit
Using TWRP normally (use the touch screen), Wipe the following: system, cache, dalvik-cache, data;
Now, push a ROM file you want, for now I'd suggest one of the Sense 5.5 ROMs -- at least until the Sense 6 ROMs stabilize a bit more and we've had time to settle out all the new idiosynchrasies). Once downloaded, you'll have some zip file, let's call it "myrom.zip" for the purpose of commands (it'll be something different, just use the actual file name instead of myrom.zip below):
Code:
adb push myrom.zip /sdcard
Using the TWRP touch interface, just install the rom from /sdcard/myrom.zip
Just fyi -- the Sense 6 Roms have been exhibiting some oddities for folks in recoveries -- the issue actually is not the ROM, rather in the ext4 file system and some file system metadata bugs when dropping so many files in one shot as the ROM installer zips are doing. I've been debugging this in my TWRP builds and will be putting an option in to cover for the problem (it's deep in the android of ext4, believe it or not -- the kernel is detecting a problem and remounting the file systems read-only and that's what makes the install fail).
Hope this helps.
twrp sideload
tdhite said:
Here's what to do (before having to RUU):
boot into TWRP;
connect USB cable;
adb shell into the device;
Code:
adb shell
see if /sdcard is ok (meaning you didn't mistakenly flash entirely the wrong ROM or something):
Code:
ls /sdcard
if the above shows files is a list of tings you recognize (like Downloads, Ringtones, whatever), two things are ok: i) your data area; and ii) your adb is working, then issue these commands (for good measure):
Code:
umount /system
exit
Using TWRP normally (use the touch screen), Wipe the following: system, cache, dalvik-cache, data;
Now, push a ROM file you want, for now I'd suggest one of the Sense 5.5 ROMs -- at least until the Sense 6 ROMs stabilize a bit more and we've had time to settle out all the new idiosynchrasies). Once downloaded, you'll have some zip file, let's call it "myrom.zip" for the purpose of commands (it'll be something different, just use the actual file name instead of myrom.zip below):
Code:
adb push myrom.zip /sdcard
Using the TWRP touch interface, just install the rom from /sdcard/myrom.zip
Just fyi -- the Sense 6 Roms have been exhibiting some oddities for folks in recoveries -- the issue actually is not the ROM, rather in the ext4 file system and some file system metadata bugs when dropping so many files in one shot as the ROM installer zips are doing. I've been debugging this in my TWRP builds and will be putting an option in to cover for the problem (it's deep in the android of ext4, believe it or not -- the kernel is detecting a problem and remounting the file systems read-only and that's what makes the install fail).
Hope this helps.
Click to expand...
Click to collapse
sorry but i feel so ignorant. i installed the drivers and have the rom ready, but how to i the phone to adb shell. do i go to mount on twrp or on the advance settings adb sideload? when i put adb shell in the command prompt but it says adb not recognized. i would really appreciate your help if you could help me with more detail if possible.
kmacho714 said:
sorry but i feel so ignorant. i installed the drivers and have the rom ready, but how to i the phone to adb shell. do i go to mount on twrp or on the advance settings adb sideload? when i put adb shell in the command prompt but it says adb not recognized. i would really appreciate your help if you could help me with more detail if possible.
Click to expand...
Click to collapse
Goodness -- I thought you were all setup for adb and understood this stuff.
Here's what you need to do *first*, then follow the instructions above after you get adb working. To "adb shell" in to the phone -- you will boot into TWRP, which starts the adb server on the phone. But you use your computer and a "command terminal" window. We have to have this one way or another, so you have to learn. You will plug in your USB cable to the phone and computer, then the commands will work -- yes, they will work with TWRP.
To setup the adb stuff, learn here: http://forum.xda-developers.com/showthread.php?t=2277892 and look for Question 8
adb
tdhite said:
Here's what to do (before having to RUU):
boot into TWRP;
connect USB cable;
adb shell into the device;
Code:
adb shell
see if /sdcard is ok (meaning you didn't mistakenly flash entirely the wrong ROM or something):
Code:
ls /sdcard
if the above shows files is a list of tings you recognize (like Downloads, Ringtones, whatever), two things are ok: i) your data area; and ii) your adb is working, then issue these commands (for good measure):
Code:
umount /system
exit
Using TWRP normally (use the touch screen), Wipe the following: system, cache, dalvik-cache, data;
Now, push a ROM file you want, for now I'd suggest one of the Sense 5.5 ROMs -- at least until the Sense 6 ROMs stabilize a bit more and we've had time to settle out all the new idiosynchrasies). Once downloaded, you'll have some zip file, let's call it "myrom.zip" for the purpose of commands (it'll be something different, just use the actual file name instead of myrom.zip below):
Code:
adb push myrom.zip /sdcard
Using the TWRP touch interface, just install the rom from /sdcard/myrom.zip
Just fyi -- the Sense 6 Roms have been exhibiting some oddities for folks in recoveries -- the issue actually is not the ROM, rather in the ext4 file system and some file system metadata bugs when dropping so many files in one shot as the ROM installer zips are doing. I've been debugging this in my TWRP builds and will be putting an option in to cover for the problem (it's deep in the android of ext4, believe it or not -- the kernel is detecting a problem and remounting the file systems read-only and that's what makes the install fail).
Hope this helps.
Click to expand...
Click to collapse
do i need android sdk? and htc sync? i have the drivers i think? on my device managers it doesnt say adb . just device and on the info it says htc device
thank you
tdhite said:
Goodness -- I thought you were all setup for adb and understood this stuff.
Here's what you need to do *first*, then follow the instructions above after you get adb working. To "adb shell" in to the phone -- you will boot into TWRP, which starts the adb server on the phone. But you use your computer and a "command terminal" window. We have to have this one way or another, so you have to learn. You will plug in your USB cable to the phone and computer, then the commands will work -- yes, they will work with TWRP.
To setup the adb stuff, learn here: http://forum.xda-developers.com/showthread.php?t=2277892 and look for Question 8
Click to expand...
Click to collapse
thanks a lot! those commands work ! just needed to install the drivers . thanks! again

Broken Screen, Not Rooted, Lockscreened.

SOLVED
(No success for me personally, but I'd still like to explain how I realised there's no hope left - description is at the bottom of this post)
Hi, not a regular poster in the S3 mini section, but a friend of mine has had his entire screen smashed. Somehow though, the phone is still breathing and can be turned on/off.
The problem is: My friend has asked me to extract his photos and similar media from the device's memory.
The device isn't rooted and I'm not sure if there's a default recovery mode or something like that built in the device.
I've tried connecting the device to my PC and it gets recognized and the drivers install themselves, but the device is empty. Moreover, I've downloaded KIES which also recognized the device, but says that there's a lockscreen and he can't go any further.
Any advices? Most of the other xda answers are for rooted phones so they haven't been very helpful, unfortunately.
There's a picture of the device in the attachments below, and KIES interface aswell.
<<EDIT>>
I'm using this http://forum.xda-developers.com/showthread.php?t=2339530 Recovery operation but it keeps saying "adb.exe" not found. I've installed ADB via the 15sec install ( http://forum.xda-developers.com/showthread.php?t=2588979 ) and entered the path correctly, but it still can't detect it. Any tips? perhaps i'm using the wrong ADB - I don't have c:\android\platform-tools folder - it's simply c:\adb\adb.exe.
SOLVED PROBLEM:
After messing with this for 2-3 days, I've decided to go with the simplest method - find a way to list all directories on the device and then see if there's anything in "sdcard" or a similar folder. To do this, after ADB recognizes your device, type : adb shell ls -R
adb shell ls -R will list a zillion directories so you may want to save the data into a .txt file. to do this, type adb shell ls -R > output.txt (or any other name).
After that, open the output.txt file and then use ctrl-f to find the sdcard folders and check if there's any data left in them.
IMPORTANT:
I've read that, without root permission, one cannot access the data or sdcard directories. The device I was working on had USB debugging OFF so there was no way I could root the phone in order to access the data directories.
Silly question, but did you use option 2 in RecoverData to change the path of ADB to c:\adb\?
aumedina said:
Silly question, but did you use option 2 in RecoverData to change the path of ADB to c:\adb\?
Click to expand...
Click to collapse
Yup, but it still can't find it. That's why I think the ADB-15sec install might be flawed.
There's a screencap of the Recovery + TotalCMD in the background in the attachments.
<EDIT>
Alright so I've followed an ADB tutorial (http://forum.xda-developers.com/showthread.php?t=2266638), installed all the SDK packages just to be sure.
ADB now recognizes the device after I've booted it into recovery mode. I've tried doing adb pull /data and it says 0 files pulled, 0 files skipped. Does this mean the device's internal memory is blank? No it doesn't, only the folder "data" is blank, other system data is present.
<EDIT 2> Can anyone please tell me the path to the internal camera storage folder? I may have fixed the problem if only I knew the correct path. SOLVED: The correct path is one of 4 combinations, usually these: /mnt/sdcard0/ /mnt/sdcard/ /storage/sdcard0/ /storage/sdcard/

Categories

Resources