14

Recently, I purchased a used Nexus 5. I would like perform a full reset, so I’m trying to flash the factory image using Google’s official instructions.

However, I keep getting the message FAILED (remote: 'Bogus size sparse and chunk header') for the Writing 'userdata' step.

Am I doing something wrong, or is something wrong with the instructions or image from Google?

(Possibly) relevant info:

  • I'm running macOS Mojave 10.14 (18A391) on my computer.
  • I'm using fastboot from the Android SDK Platform-Tools version 28.0.1, installed using Android Studio 3.2.1.
  • I tried the two most recent images of Android version 6.0.1 (M4B30X and M4B30Z), both give the same issue.

The full output of the flashing process can be seen here:

$ ./flash-all.sh 
Sending 'bootloader' (3124 KB)                     OKAY [  0.310s]
Writing 'bootloader'                               OKAY [  0.516s]
Finished. Total time: 0.923s
rebooting into bootloader                          OKAY [  0.108s]
Finished. Total time: 0.108s
Sending 'radio' (45489 KB)                         OKAY [  1.640s]
Writing 'radio'                                    OKAY [  3.130s]
Finished. Total time: 4.867s
rebooting into bootloader                          OKAY [  0.104s]
Finished. Total time: 0.104s
extracting android-info.txt (0 MB) to RAM...
--------------------------------------------       
Bootloader Version...: HHZ20h
Baseband Version.....: M8974A-2.0.50.2.30
Serial Number........: ***redacted***
--------------------------------------------       
Checking product                                   OKAY [  0.100s]
Checking version-bootloader                        OKAY [  0.100s]
Checking version-baseband                          OKAY [  0.100s]
extracting boot.img (8 MB) to disk... took 0.037s
archive does not contain 'boot.sig'
archive does not contain 'dtbo.img'
archive does not contain 'dt.img'
archive does not contain 'odm.img'
archive does not contain 'product.img'
archive does not contain 'product-services.img'
extracting recovery.img (9 MB) to disk... took 0.033s
archive does not contain 'recovery.sig'
archive does not contain 'super.img'
extracting system.img (996 MB) to disk... took 7.816s
archive does not contain 'system.sig'
archive does not contain 'vbmeta.img'
archive does not contain 'vendor.img'
mke2fs 1.44.3 (10-July-2018)
Creating filesystem with 7137786 4k blocks and 1785856 inodes
Filesystem UUID: aab8dc10-d114-48a0-b9dc-c7ebdd24c79d
Superblock backups stored on blocks: 
    32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
    4096000

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (32768 blocks): done
Writing superblocks and filesystem accounting information: done   

mke2fs 1.44.3 (10-July-2018)
Creating filesystem with 179200 4k blocks and 44832 inodes
Filesystem UUID: 2d2b45ab-678b-43ba-8b3c-83827764dbc8
Superblock backups stored on blocks: 
    32768, 98304, 163840

Allocating group tables: done                            
Writing inode tables: done                            
Creating journal (4096 blocks): done
Writing superblocks and filesystem accounting information: done

Sending 'boot' (9154 KB)                           OKAY [  0.510s]
Writing 'boot'                                     OKAY [  0.776s]
Sending 'recovery' (10012 KB)                      OKAY [  0.564s]
Writing 'recovery'                                 OKAY [  0.832s]
Sending 'system' (1020665 KB)                      OKAY [ 36.364s]
Writing 'system'                                   OKAY [ 69.147s]
Erasing 'userdata'                                 OKAY [ 14.079s]
Sending 'userdata' (4272 KB)                       OKAY [  0.360s]
Writing 'userdata'                                 FAILED (remote: 'Bogus size sparse and chunk header')
Finished. Total time: 133.541s

3 Answers 3

22

I encounter the same problem today :) flash-all script failed when writing userdata

I have managed to solve this issue by manually continue the flashing process:

1) extract image-hammerhead-m4b30z.zip

2) cd to the extracted folder

3) run the following commands (one by one)
fastboot erase userdata
fastboot flash userdata userdata.img
fastboot erase cache
fastboot flash cache cache.img
fastboot reboot
2

it's too late for this post, but I'm answering for anyone else finding this post refer to this link http://www.gandalfk7.it/2019/03/24/fastboot-too-old-and-error-cannot-generate-image-for-userdata/ you must update your os platform tools and execute sh flash-all.sh after updating the platform set the PATH in your directory as this reference says

do these steps and like the link said and you will make it!

-  download the newer platform-tools from https://developer.android.com/studio/releases/platform-tools.
-  Decompress them with #unzip platform-tools_r28.0.2-linux.zip
a new platform-tools folder will be created
then in your folder where you have unzipped the factory default
-  edit flash-all.sh and add this line on top:

export PATH=/home/YOURUSER/Downloads/platform-tools:$PATH

-  in this way the script will search for executables in that folder, using the newer ones.
0
1

Heads up to anyone that finds this happening on a Nexus 7. Same problem except there's a secondary problem after explicitly specifying platform tools. Force flashing userdata doesn't allocate all the remaining space for userdata. Solution is to resize it afterward before first boot. If you try to resize after first boot you will get stuck in a boot loop and have to reflash everything.

1

You must log in to answer this question.

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