I am trying to make a backup (a direct dd image of the partitions of my built-in memory card of my phone to my PC. I am using Linux and my phone is a Nexus 4.
Instead:
Install android-platform-tools
or android-sdk
onto your computer.
Download TWRP.
Hold the volume down and volume up buttons and turn on your phone to start up the bootloader screen. Make sure your phone is plugged into your computer's USB port.
Boot TWRP by running fastboot boot twrp-3.1.0.0.img
. (No need to flash your recovery partition this way.)
In TWRP, select Advanced, then Terminal, which will open a shell. Type mount
and press [ENTER] to see the partitions. You're looking for the /data
and possibly /sdcard
mounts.
Let's say your /data
partition maps to /dev/mmcblk0p28
. Just run adb pull /dev/block/mmcblk0p28 data.img
on your computer and it will copy the partition. Expect this process to take a while since it is copying the entire partition, regardless of how many files are stored in it.