46

Many people say that fastboot can be used to flash an image on one of the partitions.

Is the reverse also possible, that is to take a binary snapshot and store it as a zip file containing the exact binary representation of the partition to be backed up?

The reason I ask this is backup has two steps.

  1. Take an image/snapshot and store it in the backup location (backup), and
  2. Replacing the image/snapshot with the one from the backup location (restore)

To me, it seems that fastboot is only doing (1), while being able to write to the Android's internal flash (in binary "dd"-style) seems it should also be able to read from the flash.

This way, nobody would need to organize and run another potentially not trustworthy ROM to do the reading job.

Andrew T.
  • 16,898
  • 10
  • 77
  • 134
humanityANDpeace
  • 807
  • 1
  • 10
  • 16

2 Answers2

31

If you check with our tag-wiki, and follow up the link to the List of fastboot commands, you will see the answer is NO. Fastboot only has commands to write to the device. A few exceptions include:

  • making sure there is a device at all, using fastboot devices
  • some OEM specific commands to read configuration values (fastboot oem <option> – note that all those, except for oem lock/oem unlock, options start with INFO?)
  • several bootloader specific commands
  • rebooting the device after "work done" (fastboot reboot / fastboot reboot-bootloader)

From the CyanogenMod Fastboot Intro, emphasis mine:

fastboot is a small tool that comes with the Android SDK (software developer kit) that can be used to re-flash partitions on your device. It is an alternative to the recovery mode for doing installations and updates.

Wikipedia describes fastboot as a diagnostic protocol included with the SDK package used primarily to modify the flash filesystem via a USB connection from host computer. (again, emphasis mine).

No source speaks about backing up partitions (or data) from the device.

Update: newer SDKs added fastboot fetch PARTITION OUT_FILE, so backing up partitions should be possible. However, I didn't yet encounter a device supporting that – plus you'd need to know the names of partitions in advance (I didn't see any fastboot command to list existing partitions).

Izzy
  • 91,536
  • 76
  • 351
  • 968
25

We can temporarily load a custom recovery

fastboot boot <kernel> [<ramdisk>]

then backup system partitions.

Andrew T.
  • 16,898
  • 10
  • 77
  • 134
duing
  • 251
  • 3
  • 3