backup /data/media WITHOUT root. - General Questions and Answers

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.

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] Accidentally unzipped CM10 then placed on root, how do i remove these files?

Since i'm still on stock and I was supposed to place the rar file on the root, not the extracted files.. How do I remove all the extracted files??? backing up from my restore wont work because I did the backup after I placed all the files on. DOH!
rybednarski said:
Since i'm still on stock and I was supposed to place the rar file on the root, not the extracted files.. How do I remove all the extracted files??? backing up from my restore wont work because I did the backup after I placed all the files on. DOH!
Click to expand...
Click to collapse
With root explorer app of your choice. Or Odin back to stock.
in the CM10 rar is has 2 folders: system and meta-inf
When i copied it to the phone the system folder merged with system folder on my phone, along with all the other deeper folders.
So so i have to go through an manually select ALL the files that merged and arent supposed to be there since im still running my stock rom.
That's essentially my question.
Think you need to Odin stock firmware .tar image to format and restore system partition unless those folders are still intact and show as system/system and system/meta which is possible. They need to run the binary to split the files inside the folders. You only copied the folders to the root. Should not have split them up. I could be wrong. Not sure how you copied them to system root. Should have went to SD root. Can't access system root from PC via USB. Would have to put there with file explorer.
Download the original zip, explore all its contents and remove each one individually.
annoyingduck said:
Download the original zip, explore all its contents and remove each one individually.
Click to expand...
Click to collapse
They should just be sitting on the sd card. There are no original system, meta ect folders on sd card to merge with. Has me confused. Can't access system root from PC without using ADB. Also if on SD root would not affect anything and would not be in backup. Just delete the main folders that were extracted from the zip from the SD card.
Agreed
i have no sd card. I installed abd then moved then extracted zip to the root of my internal memory. ATM i have installed CM10 and have no issues except for a huge chunk of my memory is gone.. if i delete the system folder from the root is it going to mess up a bunch of other things??
rybednarski said:
i have no sd card. I installed abd then moved then extracted zip to the root of my internal memory. ATM i have installed CM10 and have no issues except for a huge chunk of my memory is gone.. if i delete the system folder from the root is it going to mess up a bunch of other things??
Click to expand...
Click to collapse
As long as it is on internal memory (SD) and not in the system partition should be no problem. If you mounted system in adb it is on or in the partition and not sure what to do except odin to reformat the partition. Some AOSP roms report the memory available wrong.
But he should have no issue finding it regardless of aosp storage issues. Op has no external, so he's either mnt/sdcard, internal, or usb storage. Emmc is out of play. Files should be clear as day. If you can put them on your root, you can take them off.
Agree with prdog, just Odin back if your unsure. But completely fixable.....
If I were you I'd give it more of a try without Odin just for the educational value.

TWRP lost my files

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) ?

Was my adopted storage decrypt key lost despite full nandroid backup in TWRP?

I have my phone encrypted and my sd card is used as adopted storage. I was about to change my /cache and /data partitions from ext4 to f2fs. Now I'm unable to decrypt my sd card. I use twrp 3.0.2-0.
What I did was:
Create a full backup of all available partitions on adopted storage. (using TWRP)
Copy the backup files to my PC over MTP.
Change /cache and /data partitions' file system from ext4 to f2fs.
Restore the backup of /cache and /data (first forgetting about the rm -rf option and thus having to repeat the previous step for /cache).
Boot up and notice I can't access my adopted storage any more.
It seems that my backup of /data partition does not include the /data/misc/vold/expand_$PARTGUID.key file. The /vold folder seems to not be included in the backup, while the other folders in /data/misc are. Should I have known this?
My backup also contains partition named external_sd. It has a /misc/vold folder but it only has an empty "bench" folder in it.
It appears that I am in the same boat as well, despite having a different phone and a slightly older version of TWRP. Despite restoring from the backup, it appears that the key file isn't included. I have tried restoring the external_sd backup, but that ultimately wipes my SD card and errors out due to the file being on said SD card.
My best guess from that is, it is trying to go ahead and restore the partition layout on the card itself. As I have a Moto E 2014, I am unable to test whether or not the backup will restore the key due to extremely limited storage.
So this time I was wiser and I saved the keyfile separately. When restoring the backup I placed it back in the same folder and the sd seemed to mount happily. Later I noticed that I couldn't see my data even though my sd seemed like it was filled with my data. Then I thought that it could be related to the fact that internal storage was chosen as the primary storage. I went to move data to sd in settings and now my sd card seems to be almost empty.
E: I even restored from the sd card after placing the keyfile into the correct folder with twrp!

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).

Categories

Resources