TWRP lost my files - Moto G Q&A, Help & Troubleshooting

I have a XT1033
I've done a nandroid backup, complete with data.
I use AppLock. It has a Photo Vault feature, where you send your pictures you want to hide. I've put many photos there.
I've installed a custom rom over stock 4.4.4
So I did the Nandroid and then format. After that, installed the new rom.
Then I recovery AppLock with TitaniumBackup
Photos gone.
Then I recover that Nandroid backup, absolutely certain that there's no way my files would be gone with a Nandroid backup.
I open AppLock Photo Vault and.... nothing there.
I go to ES file explorar and try to find the files in the .dom0o7b1ile Applock's folder located in sdcard/0/
The directories are all there, but no pictures.
So please someone give some light on what the hell is going on here?? How could the nandroid miss the .XXXX directory??
thanks!

TWRP's data backup excludes the emulated sdcard. TWRP's "factory reset" also excludes the emulated sdcard. But if you format, it will delete all your data, so you should have copied all important files from "internal storage" (aka emulated sdcard) to your computer before.

_that said:
TWRP's data backup excludes the emulated sdcard. TWRP's "factory reset" also excludes the emulated sdcard. But if you format, it will delete all your data, so you should have copied all important files from "internal storage" (aka emulated sdcard) to your computer before.
Click to expand...
Click to collapse
If I get it right, /0 = emulated sdcard? What's the usage of this emulated sdcard? I don't understand how it doesn't backup that since all user files go there? You do a Nandroid backup to backup everything...

fscussel said:
If I get it right, /0 = emulated sdcard?
Click to expand...
Click to collapse
Yes, /data/media or /data/media/0.
fscussel said:
What's the usage of this emulated sdcard?
Click to expand...
Click to collapse
User-managed storage space with no specific per-app permissions.
fscussel said:
I don't understand how it doesn't backup that since all user files go there?
Click to expand...
Click to collapse
On some devices that's the only backup target (with no physical microSD card and no OTG storage), and it often contains a lot of data that you don't want to back up regularly.
fscussel said:
You do a Nandroid backup to backup everything...
Click to expand...
Click to collapse
...that is not easily copied to the PC by other means (e.g. MTP).

_that said:
Yes, /data/media or /data/media/0.
User-managed storage space with no specific per-app permissions.
On some devices that's the only backup target (with no physical microSD card and no OTG storage), and it often contains a lot of data that you don't want to back up regularly.
...that is not easily copied to the PC by other means (e.g. MTP).
Click to expand...
Click to collapse
Man I don't understand this.
/0, is it a shortcut to some folder? Which folder?
How to explain that the directories in the AppLock folder (which name starts with a DOT I don't know the meaning) are all there, only the jpg files are missing? it creates a folder with coded name ex 8943228 for each picture it hides. All foders, one for each picture, are there, only the jpg files missing inside.
Also, since the /0 folder seems to be a shortcut, symbolic link, what-so-ever, is it possible that the files still exists?

So did you format /data or not?

_that said:
So did you format /data or not?
Click to expand...
Click to collapse
I did only after the full Nandroid backup.

Then maybe your data hiding software recreated the directories based on information in app-private data that was restored with your backup. As I said, the emulated sdcard (shared storage) is not backed up as part of /data since whoever wrote that code assumed that users would back up that data by simply copying it elsewhere.

_that said:
Then maybe your data hiding software recreated the directories based on information in app-private data that was restored with your backup. As I said, the emulated sdcard (shared storage) is not backed up as part of /data since whoever wrote that code assumed that users would back up that data by simply copying it elsewhere.
Click to expand...
Click to collapse
But the strange thing is:
When I recover the backup that directory exists even without booting for the first time after restore... in TWRP file manager I go and the directories are there... but not the files... how can this be possible?
Also, since the emulated sdcard refer to a folder, which is that folder? is it a sym link?

???

fscussel said:
When I recover the backup that directory exists even without booting for the first time after restore... in TWRP file manager I go and the directories are there... but not the files... how can this be possible?
Click to expand...
Click to collapse
Not possible if you really formatted /data.
fscussel said:
Also, since the emulated sdcard refer to a folder, which is that folder? is it a sym link?
Click to expand...
Click to collapse
In Android, /sdcard is emulated by the sdcard daemon as a fuse filesystem using /data/media or /data/media/0 as backing storage. In TWRP it's just a bind mount.

_that said:
Not possible if you really formatted /data.
In Android, /sdcard is emulated by the sdcard daemon as a fuse filesystem using /data/media or /data/media/0 as backing storage. In TWRP it's just a bind mount.
Click to expand...
Click to collapse
But how can the directories exist after twrp recovery and not the files (if I really did format /data because I don't really remember) ?

Related

Titanium and an External SD Card

I use MyBackup Pro and it can store its backups on an external SD card. I've searched but haven't been able to discover if Titanium has this same capability. If a phone needs to be replaced, what good is it to have the backup internally? I know I can perform a copy of the TitaniumBackup folder to my external SD card (or my PC) along with its files, but can it be done automagically as a program option during the backup?
Titanium allows you to change the name of the backup folder, so I went so far as to keep the TitaniumBackup folder name but point the folder location to the SD card (\sdcard\sd). No luck...unless my syntax is wrong.
So, in summary, I want to have the Titanium Backups deposited on my external SD card as part of the normal, one-step backup process. If it can't be done, I wonder why it hasn't been implemented as an option since it seems logical (at least to me ).
oh yes i would like this too, but can it be done?
Drop the sdcard and use a relative path. I have several directories on my external card. I have a main titanium directory with subdirectories for the roms I load..for example here's my current path:
sd/TitaniumBackup/JH7
Raleran said:
Drop the sdcard and use a relative path. I have several directories on my external card. I have a main titanium directory with subdirectories for the roms I load..for example here's my current path:
sd/TitaniumBackup/JH7
Click to expand...
Click to collapse
Thank you! I just heard back from the developer and was about to post his reply (which equals yours). My backup is now at sd/TitaniumBackup.
For others, here's what you do - assuming you're using an external SD card. In Titanium's preferences change the backup folder name to sd/TitaniumBackup. If you need to exchange your device you can then put your SD card in your new phone and restore the backups contained therein.
Don't forget to delete the existing backups and TitaniumBackup folder that's, by default, internal to your phone. Then create your "portable" backups.
so after you make the change, when you open up and see stats page, backup directory should say: /sdcard/sd/titaniumbackup ?
clueless captivate said:
so after you make the change, when you open up and see stats page, backup directory should say: /sdcard/sd/titaniumbackup ?
Click to expand...
Click to collapse
Yes, plus the first two directory items should read:
Data directory: /data
External storage: /sdcard (ok)

[Q] How did my sdcard get "wiped" when I installed the newest AOKP ROM?

OK, so I'm using wiped in quotes because according to my available free space, it appears my data is still there somewhere. It's just that it's really not and I don't understand why (or where it may be hiding). I've done this many times and never had this problem, so I don't think I did anything wrong, but here are the steps I took: I made a TWRP backup. I wiped my cache, then my Dalvik cache, and then did a factory reset. I installed the new AOKP ROM (aokp_d2vzw_jb-mr1_build-3), installed Gapps, and installed the flashable zip for Titanium Backup. I then booted into Android with no problem, went through the setup process, and rebooted into TWRP. At that point, I was going to install the flashable update.zip I created from Titanium Backup, but I couldn't find it or any of my normal files or folders. I booted back into Android and checked again with a file explorer and sure enough – it's only showing the basic folders you start with and none of my content is there. Like I said, it appears my data is still there somewhere according to my available free space, but I haven't been able to find it anywhere. When I was in TWRP, I hit the button to restore and it showed me my two Nandroid backups, so I feel like the files have to be hiding somewhere.
I'm not really sure what caused it, but I know the files were still there after the wiping and the factory reset, or else I wouldn't have had the zip files to then flash. Therefore, I feel like it had to be during the AOKP or the Gapps install where my sdcard got erased (I forgot to mention my Titanium Backup somehow never got installed). Oh, and just to be clear, I'm talking about the internal (emulated) sdcard, so I can't simply pull it out and put it in my PC to search the contents.
Does anyone have any idea how this happened or where my files are? I'm tempted to do a restore to see if get everything back so I can then make more backups and store them somewhere else.
On your internal SD, do you have a /0 folder? methinks all your stuff's in there....
It's an artifact of flashing 4.2.1 and it's "multiple user accounts" feature
letinsh said:
On your internal SD, do you have a /0 folder? methinks all your stuff's in there....
It's an artifact of flashing 4.2.1 and it's "multiple user accounts" feature
Click to expand...
Click to collapse
No, I don't have a /0 folder on my sdcard. I did find a /0 folder somewhere in my root, but it only mirrored what's currently on the sdcard.
I found it! It's not on my card, but in the root, under data/media. There is a /0 folder in there as well and it links to the sdcard folder. To be safe, I'm going to first copy everything to my real external sdcard before trying to put it back.
/data/media is the real path for your internal sd card. All the other paths (/mnt/sdcard0, /sdcard, /storage/sdcard0, etc) are just pointers that look at the /data/media location. If you were looking in any of those other locations, the 0 folder should have been seen...
Either way, I'm glad you found your data!
letinsh said:
/data/media is the real path for your internal sd card. All the other paths (/mnt/sdcard0, /sdcard, /storage/sdcard0, etc) are just pointers that look at the /data/media location. If you were looking in any of those other locations, the 0 folder should have been seen...
Either way, I'm glad you found your data!
Click to expand...
Click to collapse
Well, that makes sense, but I assure you it isn't showing. The only thing that's showing is the contents of the /0 folder which is inside the data/media folder.
In other words, it appears the system created a /0 folder in my internal sdcard and decided that new folder would now be my internal sdcard. So if I'm trying to browse the internal sdcard, I have no way of going up a level and getting to my old content; the system considers that part of the root. Luckily, I can use FX File Explorer to get in there and access the files.
JerseyMike4 said:
Well, that makes sense, but I assure you it isn't showing. The only thing that's showing is the contents of the /0 folder which is inside the data/media folder.
In other words, it appears the system created a /0 folder in my internal sdcard and decided that new folder would now be my internal sdcard. So if I'm trying to browse the internal sdcard, I have no way of going up a level and getting to my old content; the system considers that part of the root. Luckily, I can use FX File Explorer to get in there and access the files.
Click to expand...
Click to collapse
It's like that because of Android profiles you can create now on 4.2, so basically I'd you were to make another profile it'd be /1 and so on.
Sent from my SCH-I535 using xda app-developers app
GoonAssJuan said:
It's like that because of Android profiles you can create now on 4.2, so basically I'd you were to make another profile it'd be /1 and so on.
Sent from my SCH-I535 using xda app-developers app
Click to expand...
Click to collapse
That makes sense. But it would have been nice if the system "moved" my data automatically when I upgraded.

Does it make sense to make a backup of the whole /data folder?

I know that /data/media/0 (= /sdcard) contains user accessible data and /data/data app data, but I don't know what all the rest is for.
Not using the popular Titanium Backup (Pro), and with adb backup deprecated, I am not sure what useful approaches are to make proper backups either using an app, adb or a root shell (being on a custom ROM with microG instead of Google Play Services, I'm not using any Google services and thus can not make use of Google's cloud backup functionality).
If simply going for a full backup of the /data folder, which folders are safe to exclude or is /data/data followed by a backup of /sdcard enough?
Any suggestions are highly appreciated.
With adb root not working ("adbd cannot run as root in production builds"), a simply adb pull /data is not an option, and @Chainfire 's adb Insecure, that was mentioned somewhere, seems to be dead since 2014.
Any other way to pull /data without making a copy to internal storage (not an option if not enough storage available)?
P.S. I have just tried the following, but strangely the exclude option didn't work as it still tried to backup the content of /data/media/0 as well:
Code:
/sdcard/Download # tar cvjf data.tar.bz2 --exclude="/data/media/0" /data
Folder /data/media is Android's user-space where all the Pictures, Videos, Musics, Documents, Movies are stored. The trailing number is user's id.
In order to not backup partitions / folders to phone's internal storage memory, but to computer's HDD, you can use
Code:
adb exec-out
command.
jwoegerbauer said:
Folder /data/media is Android's user-space where all the Pictures, Videos, Musics, Documents, Movies are stored. The trailing number is user's id.
Click to expand...
Click to collapse
I know, and backing up that folder isn't an issue, but the rest is.
Master One said:
I know, and backing up that folder isn't an issue, but the rest is.
Click to expand...
Click to collapse
AFAIK TAR operates on mountpoints: /data/media/<USER-ID> isn't a mountpoint, it's by default mounted as /storage/emulated/<USER-ID>, but I may err, as always.
jwoegerbauer said:
AFAIK TAR operates on mountpoints: /data/media/<USER-ID> isn't a mountpoint, it's by default mounted as /storage/emulated/<USER-ID>, but I may err, as always.
Click to expand...
Click to collapse
tar works with folders, not mount points (same as with zip or any other compression/archive software).
Does it make sense to make a backup of the whole /data folder?
It depends on what you want to backup.
App specific data?
monica lewinsky said:
It depends on what you want to backup.
App specific data?
Click to expand...
Click to collapse
That really just depends on what's worth backing up in /data, that's why I'm asking.
Without having to think about it, a simply backup of the whole /data folder (file based, not the /data partition by running a backup in recovery) would be it, but as shown, that's not an easy task.
As I can see you still don't know difference between partition and mountpoint:
Partition is a formatted - and populated with data - section of device's storage memory. A partition can't get accessed unless it's mounted - what typically is done when Android boots up
Mountpoint is the link to a mounted partition ( such as /system, /data & /cache ).
In your case partition named /data is mounted as similarily named /data . Hence you can access its content ( folders & files ) if not denied by OS.
Remember I already told you this.
@jwoegerbauer, I already know all of that and this is obviously a misunderstanding (likely because I'm not using the correct expressions).
tar does not care if working on mount points, folders or files, so it does not matter if trying to use it on /data/media/<USER-ID>, /storage/emulated/<USER-ID> or /sdcard, which all leads to the same content.
And yes, I want to back up the content of the /data mount point and not the partition itself.
you can use titanium backup to backup apps data instead of the whole data partition
ineedroot69 said:
you can use titanium backup to backup apps data instead of the whole data partition
Click to expand...
Click to collapse
Master One said:
Not using the popular Titanium Backup (Pro)
Click to expand...
Click to collapse
And no intention to (seems abandoned, no further update since November 2019).
I'm looking for a 2-way approach, one for the command line, the other by app. For the latter I'm having an eye on Migrate and OAndBackupX.
Master One said:
With adb root not working ("adbd cannot run as root in production builds"), a simply adb pull /data is not an option, and @Chainfire 's adb Insecure, that was mentioned somewhere, seems to be dead since 2014.
Click to expand...
Click to collapse
Hi, did you make any progress? I'd be interested in the solution
Why not try adb insecure? A working tool doesn't need updates, that may be the reason for lack of development activity.
Also, did you try https://github.com/spion/adbfs-rootless ?
L.E.V. said:
Hi, did you make any progress? I'd be interested in the solution
Why not try adb insecure? A working tool doesn't need updates, that may be the reason for lack of development activity.
Also, did you try https://github.com/spion/adbfs-rootless ?
Click to expand...
Click to collapse
No, didn't follow this any further. Currently just relying on backups of the data partition from recovery, /sdcard content by just copying over and using OAndBackupX (though I haven't been in a situation to actually try a restore).

Full backup of dying phone using TWRP, backup should be accessible without the phone

Hello,
I have a Redmi Note 5 with TWRP and AOSP Extended, the charging circuits of which have died, so the phone cannot be charged or even take power from a charger, otherwise entirely functional. I now have my "last charge", the phone is charged to 100% and turned off, but as soon as the battery reaches 0% it is dead, probably forever, as it is not possible to charge it.
Now, I would like to somehow make a backup of the entire phone, in case there is some data that I might find out I need in the future. Is it possible to create a backup that I will be able to fully access after the phone dies? Is it possible to make such an image of the phone, that I could import it into a virtual machine and run on my computer?
Thank you very much.
Using TWRP file manager you can backup your pictures, video, documents etc. To your SD card,, otg or pc. But you can't backup you /data. Data and internal storage are different. Data doesn't include pictures or videos. It just includes your apps and apps data. To backup this /data you have to use migrate or titanium backup. A /data backup of a perticular device from TWRP, might not boot on another device. So use migrate. You can select the apps you want to backup and you can put that in your SD card or drive. That apps can easily be flashed on other phones. TWRP only backs up /data NOT internal storage
Android emulators run on x86/x86-64 CPU based machines whereas Android OS - all it installed apps included - runs on 32-bit/64-bit ARM-CPU based devices. Hence it doesn't make any sense trying to clone an existing Android device in order to run this clone in an Android emulator. It simply doesn't work.
Tab E said:
Using TWRP file manager you can backup your pictures, video, documents etc. To your SD card,, otg or pc. But you can't backup you /data. Data and internal storage are different. Data doesn't include pictures or videos. It just includes your apps and apps data. To backup this /data you have to use migrate or titanium backup. A /data backup of a perticular device from TWRP, might not boot on another device. So use migrate. You can select the apps you want to backup and you can put that in your SD card or drive. That apps can easily be flashed on other phones. TWRP only backs up /data NOT internal storage
Click to expand...
Click to collapse
You are wrong. The /data partition - also called /userdata - is located on device's internal storage memory. To keep you updated: The /data partition has subfolder /data/media where user's data like pictures, musics, videos, etc.pp are stored.
The /data partition what also holds all apps and their data ( obb excluded ) installed by user in subfolder /data/apps always - using the right tool - can completely get backed up.
Tab E said:
Using TWRP file manager you can backup your pictures, video, documents etc. To your SD card,, otg or pc. But you can't backup you /data. Data and internet storage are different. Data doesn't include pictures or videos. It just includes your apps and apps
Tab E said:
Using TWRP file manager you can backup your pictures, video, documents etc. To your SD card,, otg or pc. But you can't backup you /data. Data and internet storage are different. Data doesn't include pictures or videos. It just includes your apps and apps data. To backup this /data you have to use migrate or titanium backup. A /data backup of a perticular device from TWRP, might not boot on another device. So use migrate. You can select the apps you want to backup and you can put that in your SD card or drive. That apps can easily be flashed on other phones
Click to expand...
Click to collapse
data. To backup this /data you have to use migrate or titanium backup. A /data backupof a perticular from TWRP, might not boot on another device. So use migrate. You can select the apps you want to backup and you can put that in your SD card or drive. That apps can easily be flashed on other phones
Click to expand...
Click to collapse
jwoegerbauer said:
You are wrong. The /data partition - also called /userdata - is located on device's internal storage menory. The /data partition has subfolder /data/media where user's data like pictures, musics, videos, etc.pp are stored. The /data partition what also holds all apps and their data ( obb excluded ) installed by user always - using the right tool - can completely get backed up.
Click to expand...
Click to collapse
Thanks for informing
Thank you everyone for clarifying, I ended up just making a backup of the internal storage manually and then all the other partitions using TWRP backup.

backup /data/media WITHOUT root.

The subject says it all...... Anyone know of any way to do this on a stock android file system?? (7.0 Nougat)
Thanks
Sandman
Partition /data/media contains all of the contents of what you think of as your internal sdcard.
To backup it use ADB Backup method.
Thanks
xXx yYy said:
Partition /data/media contains all of the contents of what you think of as your internal sdcard.
To backup it use ADB Backup method.
Click to expand...
Click to collapse
SO if I copy data/media/0 over too my external SD card it would be the same a creating a .tar file from within TWRP??
A .TAR-file is a compressed archive-file, whereas a simple copy of files / folders always is uncompressed.
Other than compression, either way would have identical backup content; that's what I was asking.

Categories

Resources