How to copy the entire contents of an android device to a linux PC I am trying to create an exact copy of the filesystem on my android tablet on my PC.

The device is a rooted Nexus 7 (2013).

I opened a shell on the device through adb and attempted to create a tarball of the whole root directory, but my root access was limited to 15 minutes so there was not enough time for completion.

Can anyone help here, either by showing me how to copy the whole root directory?

*Note that I do not want a backup .ab file, only and exact copy of the filesystem
The correct reference would point to our nandroid tag-wiki, as a Nandroid backup is what covers all content. However, this is only available via custom recoveries.

An alternative to that would be the dd command ("Disk Duplicator"1).



Disclosure: the following describes an application I wrote and maintain:

My tool Adebar is able to generate you dd scripts for all partitions your device holds, which you then can cross-check before execution. While doing that, Adebar tries to figure out what each partition is used for, so you won't end up just with cryptic names on the disk-images. To get to the content, you still had to figure the file system used on each partition (to be able to mount it as a Loop Device). But for the "worst case", you should be able to use these images to restore your device to the state it was in when you've created them (though I must admit I've never tried that yet).


files pulled/generated by Adebar (click image for larger variant)

Adebar is mainly written in Bash version 4, and utilizes adb to communicate with the device. It definitely runs fine on Linux. I have not tested it on other systems, and so far got no feedback from users maybe having tried that.



1: careful: it's nick-named "Disk Destroyer", as if you use it the wrong way around (i.e. swap source and target), you can end up with a "disk without content"