0

I was wondering if I can make a full backup of my system partition via fastboot or adb and re-apply the backup to a different phone of the exact same model? Or is this only possible if the bootloader is unlocked? Right now it sounds to me that the locked bootloader only prohibits flashing a new bootloader or recovery.

The firmware being backed up would always be an official firmware.

My case right now is about a Sony phone but it would be good to know if this is something that's generally possible or not.

5
  • 2
    The current set of commands in a typical fastboot binary supports only partition flashing, which means, an image can be sent from PC to Android but data of the partition can't be pulled from Android into PC. You'd have to use adb for that, either from a custom recovery or when Android OS is running.
    – Firelord
    Jan 26, 2016 at 13:30
  • So it is possible to do a full system partition backup via adb without root?
    – timonsku
    Jan 26, 2016 at 13:32
  • 3
    I've not heard of any other method of creating disk images in a running Android other than of using dd utility with input as block device file. In order to create an image dd must have appropriate permission to access the block device directly. The simplest way is to read from the block device file /dev/block/mmcblk***. The permission on that file is restricted to root user and root group only, so non-root users definitely can't make an image.
    – Firelord
    Jan 26, 2016 at 13:39
  • 1
    You cannot do full partition backup via adb, but take a look at adb backup functionality which does not need root or unlocked bootloaders.
    – Chahk
    Jan 26, 2016 at 13:41
  • 1
    @Firelord put both your comments together, and you've got a fine answer :)
    – Izzy
    Jan 26, 2016 at 15:50

1 Answer 1

3

As Firelord asked me to sum things up, here we go:

First, you cannot do a backup using . Fastboot is like a one-way road: you can only use it to write partitions (either by flashing a corresponding image, or by wiping it) – but you cannot "pull" a partition.

Which leaves ADB. Yes, it's possible via ADB – but it will require root. As Firelord pointed out, to create a disk image one has to access the corresponding block device, which can only be done with root permissions, as root is who owns them. On rooted devices, one then can use the dd tool. My tool Adebar can prove helpful in identifying the partitions you might need, even creating a script for you to back them up (and to restore).

Whether that's possible with the bootloader locked might depend on the device. For some devices, directly replacing the recovery partition is even the recommended way to get a custom recovery running on it, while on others even that doesn't work. Certainly, the backup part would be possible in any case – but what you'll get is not a "pure stock ROM", but a "rooted stock ROM" – for the reasons pointed out. Only way around this would be doing so while booted into using a custom recovery (as stock recoveries usually don't ship equipped with ADB or other means to access the shell).


1: short for "data duplicator", "disk duplicator" – or "disk destroyer" (as you easily can end up that way if not being very careful)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .