Fastboot error cannot generate image for userdata

During flashing of Nexus factory image, running flash-all.sh or simply

During flashing of Nexus factory image, running flash-all.sh or simply

# fastboot -w update image-hammerhead-m4b30z.zip

fails with message

/usr/bin/mke2fs failed with status 1
fastboot: error: Cannot generate image for userdata

If you remove ‘-w’ from the fastboot command, the installation can complete without formatting (wiping) userdata partition. However that is not an ideal situation and may cause first boot to freeze or loop.

mke2fs is part of Android platform tools that also come with adb and fastboot.

The error is caused by older platform tools version where mke2fs is not compatible with the newer factory images.

Install the latest platform tools from Google Android Developer website.

Check for correct PATH where platform tools are located. Eg. /usr/bin/ and /usr/loca/bin to make sure you only have one and latest copy of adb, fastboot and mke2fs in PATH

When done correctly, mke2fs will format (wipe) the userdata partition with the fastboot -w update command.

# fastboot -w update image-hammerhead-m4b30z.zip
......
......
Erasing 'userdata' OKAY [ 10.202s]
mke2fs 1.44.4 (18-Aug-2018)
Creating filesystem with 3351034 4k blocks and 838832 inodes
Filesystem UUID: 5e6cb2b1-73ad-4645-8e75-27dddcacd9fd
Superblock backups stored on blocks:
32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208
......

However, the latest mke2fs may still cause first boot freeze or bootloop especially for Nexus 5. Wiping Dalvik and Cache will help. To do this, use third party recovery tools such as Team Win Recovery Project (twrp) for wiping partitions.

Download latest twrp recovery images from:
twrp recovery image for Nexus 5
twrp recovery image for Nexus 5X
twrp recovery image for Nexus 6P

If you have other model, just replace the model code name (hammerhead/bullhead/angler) in the url with your model. Then flash the recovery with fastboot

# fastboot flash recovery twrp-3.3.0-0-hammerhead.img

Reboot into recovery (it should start Team Win Recovery), and perform Wipe-> Format Data, then Advanced Wipe select to wipe Dalvik / Art Cache, Data, Internal Storage (optional) and Cache. (Leave System unchecked unless you want to re-flash factory image)

You may re-flash factory image and restore stock recovery. If you like, leave out the ‘-w’ option to bypass format of userdata partition.

# fastboot update image-hammerhead-m4b30z.zip

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

Try to install an Official fastboot ROM via Mi Flash tool (use «clean all» option and not «clean all & lock» of course…).

If your device still can’t boot to System, then contact an «EDL Unbrick» paid service via Telegram (@*spam*paid*service*).

Strictly follow this guide after that your device is working fine on an Official ROM: https://xiaomi.eu/community/threads…-for-mi11-pro-ultra-lite-5g-using-twrp.62738/

;)

Hi,
I downloaded newest flash tool here: https://www.xiaomiflash.com/download/

Then installed, started with admin privileges. Then I get asked to install drivers. I hit OK and then get this error message (and loggs attached). What should I do?

1631860377223.png

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.IO.DirectoryNotFoundException: Could not find a part of the path ‘C:UsersPflaumenschnappsDownloadsMiFlash20181115logmiflash@2021917.txt’.
at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share, Int32 bufferSize)
at XiaoMiFlash.code.Utility.Log.Installw(String installationPath, String msg)
at XiaoMiFlash.code.bl.MiDriver.InstallDriver(String infPath, String installationPath, Boolean uninstallOld)
at XiaoMiFlash.code.bl.MiDriver.InstallAllDriver(String installationPath, Boolean uninstallOld)
at XiaoMiFlash.form.DriverFrm.btnInstall_Click(Object sender, EventArgs e)
at System.Windows.Forms.Control.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnClick(EventArgs e)
at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.ButtonBase.WndProc(Message& m)
at System.Windows.Forms.Button.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************
mscorlib
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
—————————————-
XiaoMiFlash
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Pflaumenschnapps/Downloads/MiFlash20181115/XiaoMiFlash.exe
—————————————-
System.Windows.Forms
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4400.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
—————————————-
System
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4360.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
—————————————-
System.Drawing
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4395.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
—————————————-
MiUSB
Assembly Version: 1.0.0.0
Win32 Version: 1.0.0.0
CodeBase: file:///C:/Users/Pflaumenschnapps/Downloads/MiFlash20181115/MiUSB.DLL
—————————————-
System.Management
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4161.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Management/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Management.dll
—————————————-
System.Configuration
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4341.0 built by: NET48REL1LAST_C
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
—————————————-
System.Core
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4395.0 built by: NET48REL1LAST_B
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
—————————————-
System.Xml
Assembly Version: 4.0.0.0
Win32 Version: 4.8.4161.0 built by: NET48REL1
CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
—————————————-

************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.

For example:

<configuration>
<system.windows.forms jitDebugging=»true» />
</configuration>

When JIT debugging is enabled, any unhandled exception
will be sent to the JIT debugger registered on the computer
rather than be handled by this dialog box.

Понравилась статья? Поделить с друзьями:

Читайте также:

  • Fastapi return error
  • Fastapi docs error
  • Fast api return error
  • Fast api response error
  • Fasm include win32a inc error file not found

  • 0 0 голоса
    Рейтинг статьи
    Подписаться
    Уведомить о
    guest

    0 комментариев
    Старые
    Новые Популярные
    Межтекстовые Отзывы
    Посмотреть все комментарии