[Linux] fastboot: error: Couldn't parse partition size '0x'

Hello there,

Update: This applies to Sony Xperia XA2 Ultra and likely many other models, too.

I just had a little Fun™ trying to flash my Sony Xperia X with Sailfish OS on Manjaro Linux (not officially supported, I know!) and I was constantly hitting this wall:

$ sudo ./flash.sh
Flashing boot partition..
fastboot: error: Couldn't parse partition size '0x'.

I sure had Fastboot installed:

$ fastboot --version
fastboot version 30.0.5

Then I remembered that I had seen this before, and dug up the Download Platform Tools page, and downloaded version 29.0.5 for Linux. I extracted only the fastboot binary to the folder with flash.sh, chmod +x fastbooted it, and finally succeeded flashing my device with this command:

# PATH=./:$PATH ./flash.sh

That is, temporarily prepend the current folder to the path, so that the older Fastboot gets found first, and it can successfully flash the boot partition, and all the remaining operations succeed as well.

Before you suggest running this command:

# fastboot flash:raw boot hybris-boot.img

I did try raw flashing with my Sony Xperia Z3 Compact Tablet, and it didn’t solve the issue. So, the only thing that worked for me was downgrading Fastboot. I don’t know about other Linux distributions at the moment, but it is very likely that the Fastboot version can and will cause issues sooner or later. Perhaps the flashing documentation could be updated accordingly?


Are you using USB3? Quite interesting that downgrading helped.
I have been messing around with building fastboot myself without any specialized environment… but so far not found a solution to the USB3 issues.
I have hacked in retries to getvar, which seems to work well enough, but actual flashing still fails.

It is almost like commands, and in your case replies, are segmented and reassembly isn’t handled.

Actually I used USB 3.1 because USB 3.0 and 2.0 ports “failed to bring the device up” or something similar. I tried with three known good cables. Once the device got set up correctly and was recognised in the first place, the fastboot version was 100% the cause. Strange, but verified…

And now I’m trying to flash my XA2 Ultra. The thing is that every time I run fastboot devices with the new or the old fastboot, the USB device disconnects and the flashing process stops before it even begins. Oh how very frustrating!

I found a solution, and this may affect a whole bunch of devices!

Connect the device in desired mode (vol up + connect USB cable for me), run powertop and disable autosuspend in Tunables view, something like this:

After that, my phone keeps connected after running fastboot commands on it!

Edit: I still have to use the old fastboot binary - I’m having exactly the same error regarding the boot partition… Updating the opening post accordingly.


For me it is already set to Bad… so not much to do?

I guess so :slight_smile:

Having said that, my computer still rejects the phone (the fastboot gets stuck and kernel gets tainted and stuff), and I have to fire up my ol’ faithful Windows 8.1… Once again… Oh well!

Thank you! This has saved me some head-banging, as I ran into the same issue when flashing an Xperia X under Arch Linux. Your solution worked perfectly!

1 Like