arifogel / twrpabx

Apache License 2.0
23 stars 7 forks source link

Error when extracting a backup made with "adb backup --twrp" #3

Open PetitCassoulet opened 6 years ago

PetitCassoulet commented 6 years ago

Hello,

I've tried using your tool to extract a backup of mine (+- 22G) and soon after it begins, it displays

Read 512  bytes
Data header type: twdatablock
Read 1048064  bytes
Wrote 1048064  bytes
Remaining bytes in backup file: 20590796800
Read 512  bytes
Corrupt start of data header

leaving me with a small "system.ext4.win" file that contains only little data. Do you have any idea of what's causing it, if the backup was not made properly or if it's something else ? Thank you !

arifogel commented 6 years ago

I'll need some more information to debug this:

arifogel commented 6 years ago

UPDATE: So I wrote this tool to extract a backup of my data partition. I did no other testing. Just now for sanity I tried rerunning it on my backups. On my data.ab file I get:

...
Remaining bytes in backup file: 1763840
Read 512  bytes
Data header type: twdatablock
Read 1048064  bytes
Wrote 1048064  bytes
Remaining bytes in backup file: 715264
Read 512  bytes
Data header type: twdatablock
Read 713728  bytes
Wrote 713728  bytes
Remaining bytes in backup file: 1024
Current offset: 10052364800
Read 512 bytes
File trailer type: md5trailer
Read 512 bytes
End ADB type: twendadb

But when I run on system.ab I get:

...
Remaining bytes in backup file: 1379328
Read 512  bytes
Data header type: twdatablock
Read 1048064  bytes
Wrote 1048064  bytes
Remaining bytes in backup file: 330752
Read 512  bytes
Corrupt start of data header

So since I can apparently reproduce your error, I have enough information to continue for now.

Out of curiosity, are you able to successfully extract your data partition?

arifogel commented 6 years ago

@PetitCassoulet I was able to successfully extract my system.ab with commit 8fad6b3. Can you try again with latest master?

PetitCassoulet commented 6 years ago

Hello @arifogel, I'm really sorry for only answering now but I was quite busy this week.

I tried on the latest master and am still getting "Corrupt start of data header", I'll give you more info on my system and how I am using your tool :

What OS are you running the tool on? archlinux
What was the exact command you ran? twrpabx *mysavefile*
Is what you posted the entire output? If not, could you attach a full transcript? It was not, here is a more complete one https://pastebin.com/JMmd2niZ, I skipped the middle of the log because it's quite repetitive
Would you be willing to (privately) provide me with your input file? Your partial output file? I have lots of personal data, isn't there another way around ? And the system partition seems to be extracted just fine btw.
What version of ADB did you use (first line of output from running adb with no arguments)? version 1.0.40
What version of TWRP did you use to make the backup? For what device? The latest for OnePlus 3t at the time, 3.2.1-0
Which partitions are supposed to be in the backup file? All of them, but I could try doing separate save files for separate partitions.

I will be more reactive on your following answers, thank you a lot for taking time to solve my issue !

arifogel commented 6 years ago

@PetitCassoulet So I haven't tested with multi-partition files. Can you try with one partition per file and let me know how that goes? In the meantime on my end I will try to produce and extract a multi-partition backup.

arifogel commented 6 years ago

@PetitCassoulet with respect to your input file: Would you be willing to provide a multi-partition input file not including your data partition? I don't think there should be any personal information on the other partitions. For instance, cache and system?

arifogel commented 5 years ago

Closing due to inactivity.

Chydzim commented 5 years ago

Hey. I'm having the same problem: "corrupt start of data header" with multi-partition backup. Have you found a fix yet?

arifogel commented 5 years ago

@Chydzim Can you provide the information I requested from @PetitCassoulet earlier?

I'll need some more information to debug this:

  • What OS are you running the tool on?
  • What was the exact command you ran?
  • Is what you posted the entire output? If not, could you attach a full transcript?
  • Would you be willing to (privately) provide me with your input file? Your partial output file? EDIT:
  • What version of ADB did you use (first line of output from running adb with no arguments)?
  • What version of TWRP did you use to make the backup? For what device? EDIT 2:
  • Which partitions are supposed to be in the backup file?
Chydzim commented 5 years ago

@Chydzim Can you provide the information I requested from @PetitCassoulet earlier?

I'll need some more information to debug this:

  • What OS are you running the tool on?
  • What was the exact command you ran?
  • Is what you posted the entire output? If not, could you attach a full transcript?
  • Would you be willing to (privately) provide me with your input file? Your partial output file? EDIT:
  • What version of ADB did you use (first line of output from running adb with no arguments)?
  • What version of TWRP did you use to make the backup? For what device? EDIT 2:
  • Which partitions are supposed to be in the backup file?

What OS are you running the tool on? Ubuntu from microsoft store. What was the exact command you ran? twrpabx backup.ab Is what you posted the entire output? If not, could you attach a full transcript? Data header type: twdatablock Read 1048064 bytes Wrote 1048064 bytes Remaining bytes in backup file: 10738827264 A few hundred lines later Data header type: twdatablock Read 1048064 bytes Wrote 1048064 bytes Remaining bytes in backup file: 8862924800 Read 512 bytes Data header type: twdatablock Read 1048064 bytes Wrote 1048064 bytes Remaining bytes in backup file: 8861876224 Read 512 bytes Corrupt start of data header2 Where "header2" is the line 96 with your "possible fix". I numbered lines which contains it to identify where the error occurs. Would you be willing to (privately) provide me with your input file? Your partial output file? Not really, because data there is sensitive. Sorry. What version of ADB did you use (first line of output from running adb with no arguments)? Don't remember, I updated ADB after making backup due to problems with bootloader. What version of TWRP did you use to make the backup? For what device? twrp-3.2.1-1-addison Which partitions are supposed to be in the backup file? System, data, cache, boot.

arifogel commented 5 years ago

Sorry for lack of progress - full-time job and all. I'm going to try to upgrade my phone OS this weekend, and will take the opportunity to add support for extracting everything my phone produces with TWRP backup. Maybe even add some tests ;) Hopefully that helps with your files.

AntiSol commented 3 years ago

HI There. Did you get anywhere with this? :) I'm trying to extract specific files from a multi-partition backup. hoping I can use this tool?

arifogel commented 3 years ago

@AntiSol Unfortunately I lost the phone that used a version of TWRP using this format. And this backup method has been deprecated and is no longer available in current versions of TWRP. So I have no way of producing multi-partition backups in this format to do any testing. Given lack of personal incentive nor means to continue development, I will be archiving this repo.