To cut a long story short I wanted to make the system partition larger on my tablet PC as it's far too small to do anything practical on. I used ADB push to put Parted into the root directory and proceeded to resize some of the partitions, but it has failed terribly to the point I have bricked my tablet. I have luckily enough found some guides on the internet to after I got QHUSB_BULK in Windows Devivce Manager. At the moment I have managed to execute the command

fastboot boot twrp-3.2.3-0-flo.img

but this is temporarily running from RAM as I'm unable to flash any of the partitions as they are "missing".

This is the my original partition table:-


From some reading on the internet Linux can only have 4 primary partitons. I'm no expert in Linux. I know some basics but partitions is out of my area of expertise. All I know is that I have 30 partitions that I need to re-create and I don't know what partition type to set them to; primary, logical or extended.

I've played around with the three partition types but I get an error message saying "Too many primary partitions".

Could someone shine some light here please?

Many thanks


  • This script might be worth a shot. If you wish to restore original partitioning, install sysrepartundo.zip. This script will attempt to non-destructively resize system again but if you installed some mega-gapps, it will obviously fail. In this case, use TWRP and manually format the system partition, then restore system's backup. forum.xda-developers.com/… Or the link within about a way to un-brick the device. Hopefully it will bring Flow back to life.
    – Bo Lawson
    Jan 12, 2019 at 22:57
  • 1
    Maximum 4 partitions is the limitation of MBR partition table. Android devices use GPT partition table which can have up to 128 partitions. You can use parted or gdisk to create GPT. But creating partition table isn't enough. Many of your 30 partitions contain contents related to bootloaders which are critical for booting. So you have to flash the proper contents to every partition too. These are just system, boot, userdata, cache and recovery partitions we modify usually during ROM flashing. So your best bet is to flash whole factory firmware that creates partitions as well Jan 13, 2019 at 6:32
  • @IrfanLatif will just flashing a factory image re-partition the device? I thought they were just binary images. If this is the case I learned something new today. It is a nexus so its super easy and all firmware is available from Google. I have flashed a lot of nexi but I do it manual to the partition. Would he have to use the flash-all.bat to achieve this?
    – Bo Lawson
    Jan 13, 2019 at 16:16
  • 1
    @BoLawson Personally I have never erased all of my partitions to test if this works or not, but it is possible, though I'm not sure if all vendors implement this in their factory flasher software or not. In one of my Qualcomm SoC phone's factory firmware, rawprogram_unsparse.xml contains entries of images from sector 0 to the last sector of eMMC. It also includes 17KB at start for main and 16.5KB at the end for backup GPT boot sectors (gpt_main0.bin and gpt_backup0.bin image files) which clearly indicates that whole memory is rewritten during flashing process including partition table. Jan 13, 2019 at 18:15
  • 1
    Thanks for the replies. The problem I have is I can't load or flashing anything because I don't have any physical partitions. Currently TWRP is being assumingly loaded from RAM using 'fastboot boot' as I can't flash TWRP to the recovery partition. Once TWRP was temporarily loaded I then used ADB and entered Parted. It was here were I was having problems trying to re-create the 30 partitions. Jan 13, 2019 at 22:40

1 Answer 1


I was in the same position as you re a total resizing of the partition table > System to Data.

The following posts will help you. The first is a script to recreate all the required partitions. The second is a method to get the bootloader functioning from a Hard Brick.

Worked on this for hours last night and have now had successfully recovered back this morning.

Good luck.




  • Whilst this may theoretically answer the question, it would be preferable to include the essential parts of the answer here, and provide the link for reference.
    – Firelord
    Jan 27, 2019 at 12:37
  • Sorry for the extremely long reply back. I've only just managed to get some holiday since Christmas to sit down and crack on with this. Anyway I have restored my entire partition table byte by byte but it has taken me ages to do as I have had to copy and paste 60 lines into Parted. The first line of each of the 30 partitions is for the partition sizes itself and the second line is rename each partition. Is there a way I can make a backup or at least a batch file to speed up the process in the future? Mar 3, 2019 at 21:54
  • This file pastebin.com/aJJ1R4Be lists the entire procedure of commands I ran. However, after selecting 'Power off' in TWRP my Nexus 7 goes to a blank screen and I'm forced to follow the unbrick method again. What am I doing wrong? Mar 3, 2019 at 22:28
  • UPDATE - I've successfully restored all 30 partitions and have flashed the stock Nexus image. However, Its stuck on an infinite boot animation so I'm not much further than before. Apr 18, 2019 at 9:16

You must log in to answer this question.

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