It’s been interesting getting back into Android development again, and in particular, working with the newer phones. My wife and I got a matching pair of Ulefone Armor 7s, and yet they had surprisingly different results when trying to install a new custom ROM. In particular, it was interesting working with the new “Super” partition.

Back in the old days, there were lots of partitions in the phone memory, and from that you installed your custom ROM. Nowadays, a lot of phones use “Super” partitions that have one large partition that contains several smaller logical partitions. The benefit being that you can use fastbootd (in userspace) and change the sizes within the super partition rather quickly, or even somewhat dynamically.

I built my own version of Phhusson’s AOSP GSI, and flashed it on our phones. I prefer going Gapp-less, and vanilla, and having super user permissions installed and enabled. Flashing to my wife’s phone was fairly simple, no issues were had at all. My phone, which is identical, raised the following error:

alaskalinuxuser@alaskalinuxuser-PowerEdge-R520:~$ ./platform-tools/fastboot flash system ./system-roar-arm64-ab-vanilla.img 
Resizing 'system'                                  FAILED (remote: 'Not enough space to resize partition')
fastboot: error: Command failed
alaskalinuxuser@alaskalinuxuser-PowerEdge-R520:~$

But, a few minutes on the web brought me to an issue discussion with Phhusson and Android2468 about this issue, and Phhusson recommended that Android2468 delete the product partition so there would be room to flash the system partition. So, I followed suit:

alaskalinuxuser@alaskalinuxuser-PowerEdge-R520:~$ ./platform-tools/fastboot delete-logical-partition product
Deleting 'product'                                 OKAY [  0.017s]
Finished. Total time: 0.017s
alaskalinuxuser@alaskalinuxuser-PowerEdge-R520:~$ ./platform-tools/fastboot flash system ./system-roar-arm64-ab-vanilla.img 
Resizing 'system'                                  OKAY [  0.002s]
Sending sparse 'system' 1/6 (262140 KB)            OKAY [  8.351s]
Writing 'system'                                   OKAY [  1.447s]
Sending sparse 'system' 2/6 (262140 KB)            OKAY [  8.390s]
Writing 'system'                                   OKAY [  1.570s]
Sending sparse 'system' 3/6 (262140 KB)            OKAY [  8.466s]
Writing 'system'                                   OKAY [  1.566s]
Sending sparse 'system' 4/6 (262140 KB)            OKAY [  8.387s]
Writing 'system'                                   OKAY [  1.557s]
Sending sparse 'system' 5/6 (262140 KB)            OKAY [  8.507s]
Writing 'system'                                   OKAY [  1.665s]
Sending sparse 'system' 6/6 (221800 KB)            OKAY [  7.094s]
Writing 'system'                                   OKAY [  1.458s]
Finished. Total time: 58.464s
alaskalinuxuser@alaskalinuxuser-PowerEdge-R520:~$ 

And that worked! Can’t do much better than getting good advice from the legend himself (Phhusson)! Still not sure why there was a difference between the two identical phones, but it was nice that it was an easy fix.

Linux – keep it simple.

2 Replies to “Fastboot: ‘Not enough space to resize partition’”

  1. Howdy.

    I stumbled across this post while searching the error message you mention after a failed DivestOS install. From my perspective that’s some deep Android esoterica.

    I’ve never found a decent reference for understanding the inner-workings of the Android OS. Perhaps you could recommend one?

    1. Great question. First, I’m glad my post helped. Second, Android development really should be it’s own IT college degree/school. But, if you are looking for resources, you can always check out my Youtube videos for building Android, it will not cover anything, but it is a start. Most devs just use trial and error, web searching, and the Google Android documentation.

Leave a Reply

Your email address will not be published. Required fields are marked *