Is it possible to mount data partition on PC or USB to recover data - Galaxy Note5 Q&A, Help & Troubleshooting

Is it possible to mount data partition on PC or USB to recover data?
Edit: I meant userdata partition

I have tried backing up data partition using TWRP, but it prompted me that pictures and downloads will not be backed-up!
Isn't the data partition that holds my camera and download folder?

I am looking for a tool or and app that can let me take a disk image of internal SD partition, or create a whole image of my phone; so that I can use data recovery in my PC.

Making Dump Files Out of Android Device Partitions
have u try this

Thanks I have tried it but when I execute
Code:
noblelte:/ # dd if=/dev/block/sda17 of=/sda17.img
Gives me
Code:
dd: /sda17.img: Read-only file system
Just to be sure : I ran the adb code while the phone is on normally not in TWRP.

I also ran the code in TWRP terminal, while connecting a USB and mounting it.
It created the image inside the USB , however it stopped at 4GB saying the file is too large.

SilverDove said:
I also ran the code in TWRP terminal, while connecting a USB and mounting it.
It created the image inside the USB , however it stopped at 4GB saying the file is too large.
Click to expand...
Click to collapse
Are you just wanting to back up pictures, download folder, etc etc? Backing up the data partition the way you are is pointless as you're just accomplishing what twrp already does. Data partition is apps, system configurations, texts, calls, etc. Not pictures you've taking, download folder, etc.
And is there a reason you want an img file? Seems pointless to me when you can just copy it all over by drag and drop or adb pull the internal storage lol

I want to make a userdata partition image because it holds the camera album I deleted by mistake. I want to take the image and try to recover the deleted files using PC recovery software.
I found out that my problem was the 4GB limit of FAT32, so I formatted my USB flash memory using both exFat and ext4 and recovered the partition using TWRP terminal with the code above.
However I am still unable to read the image through Linux Reader and I can't attach the image as VHD.
Is what I am doing is useless? Because it came to my mind that if the recovered userdata partition is encrypted I will not be able to opened it, however, TWRP can browse the files so I guess it is not encrypted.

SilverDove said:
I want to make a userdata partition image because it holds the camera album I deleted by mistake. I want to take the image and try to recover the deleted files using PC recovery software.
I found out that my problem was the 4GB limit of FAT32, so I formatted my USB flash memory using both exFat and ext4 and recovered the partition using TWRP terminal with the code above.
However I am still unable to read the image through Linux Reader and I can't attach the image as VHD.
Is what I am doing is useless? Because it came to my mind that if the recovered userdata partition is encrypted I will not be able to opened it, however, TWRP can browse the files so I guess it is not encrypted.
Click to expand...
Click to collapse
You may need to convert the file type of the img using simg2img, make_ext4fs, etc
You can see what the file system type of the img you have by running:
file blahblah.img
But still don't think you're going to recover them but possibly lol never tried as I sync everything to a cloud

SilverDove said:
Is it possible to mount data partition on PC or USB to recover data?
Edit: I meant userdata partition
Click to expand...
Click to collapse
For backing up app data, I'm more of a Titanium Backup person myself and for backing up partitions I generally prefer TWRP, but there are also apps for backing up all the different partitions as well. This is just one. Never tried it, but Wanam is a much trusted developer in the XDA community for Samsung devices.
https://play.google.com/store/apps/details?id=ma.wanam.partitions
NOTE: You can always save these backups to a USB OTG device if you need to as well. That's what I do with my Titanium Backup app data files and the information is with me all the time hanging on my key chain.(More info about that under "No SD Card Slot" on this post HERE.) This information can of course always be copied to a PC too.

Related

Files in storage disappears after a rom install. 21GB used and I can't find it.

I decided to flash the Android Revolution 4.2.2 ROM after waiting diligently for an OTA. I made nandroid backup, wiped my data and flashed the ROM as usual. As expected all app and app data were gone, but all the files, music and picture were as well. The twist is that they are still there somewhere within the file system. In my storage info it shows that I have 20GB of unknown files on my device but they are no where to be found. I checked:
/sdcard/
/mnt/sdcard/
/storage/emulated/0/
/storage/emulated/legacy/
/storage/sdcard0/
and they all showed the same default clean install files(weird). Is there a way to mount some partition I don't know about to recover my files? Is this a problem with HTC's weird sdcard emulation? Is there even a way to completely delete everything on internal storage?
tevinwade said:
I decided to flash the Android Revolution 4.2.2 ROM after waiting diligently for an OTA. I made nandroid backup, wiped my data and flashed the ROM as usual. As expected all app and app data were gone, but all the files, music and picture were as well. The twist is that they are still there somewhere within the file system. In my storage info it shows that I have 20GB of unknown files on my device but they are no where to be found. I checked:
/sdcard/
/mnt/sdcard/
/storage/emulated/0/
/storage/emulated/legacy/
/storage/sdcard0/
and they all showed the same default clean install files(weird). Is there a way to mount some partition I don't know about to recover my files? Is this a problem with HTC's weird sdcard emulation? Is there even a way to completely delete everything on internal storage?
Click to expand...
Click to collapse
As stated on mikes page it was highly recommended to format your sd before installation of 4.2.2... Because android 4.2.2 handles files differently from 4.1. Not HTC s doing I believe(correct if wrong)
tevinwade said:
I decided to flash the Android Revolution 4.2.2 ROM after waiting diligently for an OTA. I made nandroid backup, wiped my data and flashed the ROM as usual. As expected all app and app data were gone, but all the files, music and picture were as well. The twist is that they are still there somewhere within the file system. In my storage info it shows that I have 20GB of unknown files on my device but they are no where to be found. I checked:
/sdcard/
/mnt/sdcard/
/storage/emulated/0/
/storage/emulated/legacy/
/storage/sdcard0/
and they all showed the same default clean install files(weird). Is there a way to mount some partition I don't know about to recover my files? Is this a problem with HTC's weird sdcard emulation? Is there even a way to completely delete everything on internal storage?
Click to expand...
Click to collapse
Try data/media/
If it's not there then download DiskUsage and see if it helps you find it. https://play.google.com/store/apps/details?id=com.google.android.diskusage
Sent from my HTC One using xda premium
BEFORE RUNNING THE ADB METHOD IN THIS WEBSITE, MAKE SURE YOU ARE IN RECOVERY AND MAKE SURE THAT ADB IS WORKING. DO NOT RUN THESE COMMANDS MORE THAN ONCE OR YOU WILL WIPE YOUR ENTIRE SDCARD. BACK UP ALL YOUR DATA AND MAKE SURE THAT YOU HAVE ALL YOUR CRITICAL DATA OFF THE PHONE OR YOU WILL REGRET IT WHEN YOU WIPE OUT PRECIOUS MEMORIES AND DATA.
http://trickdroid.org/trickdroid-6-0-android-4-2-2-and-your-sd-card/
Use the ADB method. it will move everything.
I case anyone has the same problem. It was in data/media as redbull123 stated. It appears as if Astro File Manager doesn't display the files in the folder while ES File Explorer does.

[Q] Fix missing space (23.03GB vs. 64GB), but keep data

I've run in to the problem some other people were having too. A problem, where after fastboot flashing userdata.img (from stock factory image), I'm left with 23.03GB of storage on my device, even though it's a 64GB model.
I've Googled the problem, and people suggest running "fastboot format data" to fix it. But of course that will wipe all my settings and so forth. My question is if I can back up the data partition using TWRP onto an OTG device. Then run "fastboot format data" and finally restore data again using TWRP.
Would that work? And would it even fix the problem of the missing space.
For reference, the issue has previously been discussed here:
http://forum.xda-developers.com/nexus-6/help/nexus-6-64gb-23gb-free-space-t2953636
stokholm said:
I've run in to the problem some other people were having too. A problem, where after fastboot flashing userdata.img (from stock factory image), I'm left with 23.03GB of storage on my device, even though it's a 64GB model.
I've Googled the problem, and people suggest running "fastboot format data" to fix it. But of course that will wipe all my settings and so forth. My question is if I can back up the data partition using TWRP onto an OTG device. Then run "fastboot format data" and finally restore data again using TWRP.
Would that work? And would it even fix the problem of the missing space.
For reference, the issue has previously been discussed here:
http://forum.xda-developers.com/nexus-6/help/nexus-6-64gb-23gb-free-space-t2953636
Click to expand...
Click to collapse
Just so its clear the fastboot format does the trick. (I also did fastboot and vol scrolled to recovery and did a full wipe before the format)(that was prob overkill)
fastboot format userdata
fastboot format cache
fastboot reboot
I've never done that with twrp. I usually just dump my whole SD card to a hard drive then start fresh. Its a reasonable pain to ensure there are no problems.
Also wouldn't you have been totally wiped anyway if you were going back to stock? Have you been using it with 23gb for a while?
No, haven't been using it for long like that. Only a few days actually.
It's not that I have a lot of files, but I do have a lot of settings and app settings. I know I could probably use Titanium Backup to back that stuff up, but I don't trust that method do get everything and not mess something up.
One more question though. Why format cache too? I saw that suggested in the thread I referenced. But isn't it enough to format data? I guess it makes no difference really, but I'm trying to learn in the process too.
stokholm said:
I've run in to the problem some other people were having too. A problem, where after fastboot flashing userdata.img (from stock factory image), I'm left with 23.03GB of storage on my device, even though it's a 64GB model.
I've Googled the problem, and people suggest running "fastboot format data" to fix it. But of course that will wipe all my settings and so forth. My question is if I can back up the data partition using TWRP onto an OTG device. Then run "fastboot format data" and finally restore data again using TWRP.
Would that work? And would it even fix the problem of the missing space.
Click to expand...
Click to collapse
Yes and no.
Let me explain;
The first problem, which may or may not actually *be* a problem, is whether or not recovery will PERMIT a backup to an OTG. Assuming that it does, it unfortunately will only backup everything on the data partition BESIDES the "media" directory (where the "internal SD card" can be found).
To work around this, perform your backup TO the internal storage, then reboot back to Android, copy *everything" from the "internal storage" path to your computer (which will include the "backup" directory, whatever it happens to be called with the recovery you prefer). Then perform the fastboot format on the data partition, boot into Android skipping all the signin junk, copy everything BACK to the internal storage, reboot into recovery again, and restore it.
ALTERNATIVELY, and probably much easier (definitely much faster, since it should complete within a few seconds)...
I *believe* that most recoveries should include the resize2fs command (though I've never had an actual need for this, so haven't actually tested it), so via ADB into your recovery.....
Code:
umount /data
resize2fs /dev/block/platform/msm_sdcc.1/by-name/userdata
should do the trick.
NOTE HOWEVER, it is generally recommended to backup any partition where you are resizing a filesystem PRIOR to resizing it.
HAVING SAID THAT, I've run resize2fs hundreds of times on hundreds of systems, and never had an issue with a grow operation.
Running resize2fs without a "size" parameter will grow the filesystem to the size of the partition. The partition table still holds the correct size, which is why "fastboot format" fixes the issue.
That was a great explanation, @doitright. Thank you for that. I will try resize2fs at some point.
stokholm said:
No, haven't been using it for long like that. Only a few days actually.
It's not that I have a lot of files, but I do have a lot of settings and app settings. I know I could probably use Titanium Backup to back that stuff up, but I don't trust that method do get everything and not mess something up.
One more question though. Why format cache too? I saw that suggested in the thread I referenced. But isn't it enough to format data? I guess it makes no difference really, but I'm trying to learn in the process too.
Click to expand...
Click to collapse
Resizef2s sounds relatively painless, but does again, as doitright says, require caution by backing up before.
About the cache thing. I think to do a full format, data and cache are on different blocks, so that might be why. But then again the SD card is mounted in /data/media so maybe only format data is needed and the cache is to help with something else or just to be cautious, I don't know.
Now I wonder (and this can be searched here in xda) if TWRP back up data is /data/data or /data minus /data/media? Because fastboot format data I think is all of data i.e. /data. This is worth knowing for the future. Especially since we are flashinging things to our phones and whatever else.
MunkinDrunky said:
Now I wonder (and this can be searched here in xda) if TWRP back up data is /data/data or /data minus /data/media? Because fastboot format data I think is all of data i.e. /data. This is worth knowing for the future. Especially since we are flashinging things to our phones and whatever else.
Click to expand...
Click to collapse
ALL recovery backups are /data/* EXCEPT /data/media, being "backed up" to /data/media/something.
It simply cannot be implemented any other way for devices without separate storage devices, otherwise the backup would back up previous backups, which would be just plain wasteful.
The /cache partition is practically irrelevant. There is quite literally NO REASON to ever worry about it. No reason to wipe it, no reason for format it unless it somehow becomes corrupt.
It doesn't seem like resize2fs is included in TWRP.
stokholm said:
It doesn't seem like resize2fs is included in TWRP.
Click to expand...
Click to collapse
The resolution really is as simple as you originally thought. Its a common issue I've seen a hundred times on the nexus 5.
Take a full TWRP backup and then copy your entire sdcard to PC.
Format data
Boot into android and do initial set up.
Copy sdcard backup back to device whilst booted into android
Restore TWRP backup
You can use the file manager in TWRP to copy your entire sdcard to USB-OTG and copy it back. Personally, I find this easier than copying to PC.
adrman said:
You can use the file manager in TWRP to copy your entire sdcard to USB-OTG and copy it back. Personally, I find this easier than copying to PC.
Click to expand...
Click to collapse
The reason I said to copy it to PC via android was that using MTP or adb in recovery will break the sdcard permissions, when it is copied back. If you're confident OTG in TWRP works differently to adb and MTP in TWRP, cool. I just haven't tested it myself so won't suggest it.
rootSU said:
The reason I said to copy it to PC via android was that using MTP or adb in recovery will break the sdcard permissions, when it is copied back. If you're confident OTG in TWRP works differently to adb and MTP in TWRP, cool. I just haven't tested it myself so won't suggest it.
Click to expand...
Click to collapse
I used OTG via TWRP's file manager, when I wiped to decrypt and everything came back properly. I would assume that would be the case here as well.
adrman said:
I used OTG via TWRP's file manager, when I wiped to decrypt and everything came back properly. I would assume that would be the case here as well.
Click to expand...
Click to collapse
Excellent
rootSU said:
Excellent
Click to expand...
Click to collapse
Channeling Mr. Burns? [emoji1]
adrman said:
Channeling Mr. Burns? [emoji1]
Click to expand...
Click to collapse
Always, aren't you?
From within TWRP there is an easy way to do this even after you have your phone all setup. This issue always happens on my Nexus 5 and Nexus 6.
I did this without doing a backup and after my phone has been used on marshmallow for a week or so.
Steps from within TWRP:
1. Wipe > Advanced Wipe
2. Select the Data partition.
3. Select Repair or Change File System
(Notice the Partition Size)
4. Select Resize
(Wait and shortly after see the partition size be up to full size.)
This doesn't appear to work on 6.0.1 custom Rom with systemless SU 2.61... gave me a bad partition error.
Guess I will have to wipe.
maamdroid said:
From within TWRP there is an easy way to do this even after you have your phone all setup. This issue always happens on my Nexus 5 and Nexus 6.
I did this without doing a backup and after my phone has been used on marshmallow for a week or so.
Steps from within TWRP:
1. Wipe > Advanced Wipe
2. Select the Data partition.
3. Select Repair or Change File System
(Notice the Partition Size)
4. Select Resize
(Wait and shortly after see the partition size be up to full size.)
Click to expand...
Click to collapse
I have come across this thread. Here is what worked for me. (in case somebody needs it in the future)
1. Boot into twrp, type
Code:
adb shell
2. list the mounted partitions
Code:
df
You should see
Code:
df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 1507020 24 1506996 0% /dev
tmpfs 1507020 24 1506996 0% /tmp
/dev/block/mmcblk0p38
253920 264 248416 0% /cache
/dev/block/mmcblk0p42
24143612 23590364 536864 98% /sdcard
/dev/block/mmcblk0p42
24143612 23590364 536864 98% /data
/dev/block/mmcblk0p41
2015408 1965276 33748 98% /system
3. unmount /data and /sdcard
Code:
umount /dev/block/mmcblk0p42
umount /dev/block/mmcblk0p41
4. run
Code:
e2fsck -f /dev/block/platform/msm_sdcc.1/by-name/userdata
resize2fs /dev/block/platform/msm_sdcc.1/by-name/userdata
now you should see:
Code:
df
Filesystem 1K-blocks Used Available Use% Mounted on
tmpfs 1507020 24 1506996 0% /dev
tmpfs 1507020 24 1506996 0% /tmp
/dev/block/mmcblk0p38
253920 264 248416 0% /cache
/dev/block/mmcblk0p42
57306748 23598452 33691912 41% /data
/dev/block/mmcblk0p42
57306748 23598452 33691912 41% /sdcard
5. reboot, you are done

Please help me. Tried to change /data file system and wiped all my files...

I'm panicking very much right now.
I did a big, big stupid and accidentally wiped my entire /data partition, including /sdcard (!!) in TWRP 3.0.4.1 while attempting to change the filesystem of my /data partition from F2FS to EXT4. I did a full backup of my phone, including /data partition (but excluding /data/media/0/ which is the location for /sdcard of course) on my phone prior to attempting to change the filesystem.
I didn't think that this would also wipe /sdcard, and ALL MY FILES INCLUDING MY BACKUP...
I'm frantically searching through Google as we speak for guides to clone these formatted sectors over USB (I'd imagine using ADB shell) to a PC and use Windows file or partition recovery tools to try and save every, if not most files.
Please lend me your knowledge and links to fixing this issue, Android community. <3
In older Android versions the /sdcard partition was it's own partition, which is why I didn't think of copying all my files over to a PC before making changes to /data.
well, when you wipe data from any partition in twrp it sort of resets all space to be overwritten. The data that is marked for overwrite doesn't remain when you full wipe. Since you changed the file system, the data was removed and overwritten by the wipe with blank space.... i hope you had at least some of it backed up on your pc. I never use those apps personally, i always hard backup all my things with a drag and drop onto my pc. I highly recommend it, saves you a disaster. Im very sorry.... i hope you didnt lose anything really important.
OcazPrime said:
well, when you wipe data from any partition in twrp it sort of resets all space to be overwritten. The data that is marked for overwrite doesn't remain when you full wipe. Since you changed the file system, the data was removed and overwritten by the wipe with blank space.... i hope you had at least some of it backed up on your pc. I never use those apps personally, i always hard backup all my things with a drag and drop onto my pc. I highly recommend it, saves you a disaster. Im very sorry.... i hope you didnt lose anything really important.
Click to expand...
Click to collapse
Heh, that's exactly what happened. I'm gonna attempt this guide: https://forum.xda-developers.com/ga...de-internal-memory-data-recovery-yes-t1994705
Basically try to use "dd" to make a RAW copy of "dev/block/dm-0" which according to the mount command I ran in TWRP's terminal shell, is what block /data is used on OnePlus 3T (OOS 4.1.3).
Wish me luck.

How to unencrypt backed up disk image

Recently I tried to flash root on my phone and I corrupted the ROM. I couldn't boot so I backed up an image of the disk, saved it on my pc and then recovered my phone. I have the disk image, and I'd like to unencrypt it to recover some things I had on my phone. Is it possible to unencrypt the image on my computer?
gooseman35 said:
Recently I tried to flash root on my phone and I corrupted the ROM. I couldn't boot so I backed up an image of the disk, saved it on my pc and then recovered my phone. I have the disk image, and I'd like to unencrypt it to recover some things I had on my phone. Is it possible to unencrypt the image on my computer?
Click to expand...
Click to collapse
Can you explain every steps?? I mean how did you corrupt the Rom while rooting???
Most of the times The Backup can be restored easily and phone works fine. But in your case *Disk image , i am unable to understand what you are talking about???? Are you referring to system image??
tytfusokhszxc said:
Can you explain every steps?? I mean how did you corrupt the Rom while rooting???
Most of the times The Backup can be restored easily and phone works fine. But in your case *Disk image , i am unable to understand what you are talking about???? Are you referring to system image??
Click to expand...
Click to collapse
I flashed supersu to get root but the system woudln't boot. I ran adb pull on the data partition and backed it up to my pc. After that I formatted the disk and reinstalled the os, so I dont have the data on my phone anymore, only on my computer on a .img file. I want to know if you can decrypt that file and get the original data.

unable to mount internal storage due to encryption

Long story short, I've been trying to get into my internal storage via TWRP but its saying that there are 0MB in the internal storage and that there is nothing in the sdcard folder
I've tried formatting it, hasn't worked
I've tried changing the format to FAT and then back to EXT4
then after that didn't work i tried the same but with EXT2 , it showed the amount of storage but still didn't let me see what was inside of the sdcard folder, whenever i'd go in there its just completely empty
Can I please have some help with this, I've been stuck on this for a couple hours now
Ouch! Please don't say that you just formatted userdata (/data).
You've just killed all your data on your phone.
No, I'm not that experienced with TWRP and I don't know which versions under which circumstances it can mount userdata.
I use custom recoveries and just presume that I can't mount userdata in them.
In the normal system (which mounts and decrypts) I use normal tools to sync or backup.
Renate said:
Ouch! Please don't say that you just formatted userdata (/data).
You've just killed all your data on your phone.
No, I'm not that experienced with TWRP and I don't know which versions under which circumstances it can mount userdata.
I use custom recoveries and just presume that I can't mount userdata in them.
In the normal system (which mounts and decrypts) I use normal tools to sync or backup.
Click to expand...
Click to collapse
I didn't format data it self i meant that i factory reset it, sorry i should of been a lot more clear on that
Oh, ok.
Well, in any case, if it's encrypted you need to mount it not with a simple "mount" command but something fancier using dm.
They don't try to make it easy to do.
Unless you're destroyed your system and you're trying to recover your data, whatever you're trying to do is best done in the normal system.
never mind i found a fix for it
well not really a fix just a way around it
thanks for the help ^^
SoftieIsVibing said:
never mind i found a fix for it
well not really a fix just a way around it
thanks for the help ^^
Click to expand...
Click to collapse
I had the same issue so I flashed a raw firmware after taking full system backup. Now TWRP is working fine.

Categories

Resources