26

Many people tell about fastboot that it can be used to flash a image on one of the partitions.

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

the reason I ask this is backup has two steps.

1) take and image/snapshot to backuplocation (backup) 2) and replacing image/snapshop from backuplocaito (restore)

to me it seems that fastboot is only doing one, while being able to write to the Androids 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.

17

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.

  • 4
    Thank you, for answering the question. I know that it must seem to you, that I simply was not looking well enough for the info myself. With uboot, recovery partition, recovery mod, clockworkmod, fastboot, adb, etc there are really lots of things that seem to have similar purposes and the info is sometimes confusing. the point in real is that writing and reading to/from memory are basic operations and it seemed idiotic that one makes fastboot only being able to do one of the both. It is great you can flash with fastboot, but why would it not be able to read seemed "wrong to me", so i asked – humanityANDpeace Feb 23 '16 at 16:50
  • I didn't blame you in any way: Especially people new to it can easily get confused here (for the reasons you've pointed out). Had I wanted to blame you, I'd placed an "RTFM comment" – instead I rather thought a little summary cannot hurt .) // In fact, backing up partitions can be much more tricky (unless your custom recovery's Nandroid does exactly that). You can dd and transfer partitions, my Adebar can help you create a fitting script for that (working via ADB). – Izzy Feb 23 '16 at 16:56
  • of course, I simply though you were in the right hinting on the available resources. your answer was great and nicely phrased, thank you! I missed stating some background when composing the message. The background (i added in the meanwhile) is simply -and as indicated on the tag wiki- that its absurd (to me) you can flash images but not take them. – humanityANDpeace Feb 23 '16 at 17:00
  • That's not that absurd. It'd be absurd if you could create a backup that way but had no way to restore it #D But yes, I get your point of course. Glad I was able to shed some light! – Izzy Feb 23 '16 at 17:03
  • I suspect there is also the issue of security. One could use fastboot to make a sector image of a locked device, allowing access to the filesystem content without needing to factory reset. – jiggunjer Jul 13 '17 at 12:00
6

We can temporarily load a custom recovery

fastboot boot <kernel> [<ramdisk>]

then backup system partitions

  • Why is this downvoted? It should be possible to boot a system image that is able to read (and backup) the content of a device, shouldn't it? – Matthias Weiler May 5 '18 at 16:50
  • For future readers: the device must support the fastboot boot command. <kernel> may be something like ClockworkMod (cwm.zip) or TWRP (twrp*.img). – Johann Sep 24 '18 at 22:33
  • 1
    On some phones (e.g. Xiaomi) this also requires that the bootloader is unlocked, which you can't do without a data wipe. – chrki Sep 25 '18 at 12:27

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.