yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Original Android Development] JekaPinsk:
Well, I still need to perform backup-restore trick before flashing gapps, because only ~260mb can be actually written to the /system partition. Flash ROM, then press "resize" in TWRP and try to manually copy gapps zip to the /system partition and voila - you got an error. The worst thing is that it won't produce any errors when installing gapps.

As I already mentioned in another thread, I believe the problem is because modern block-based packages somehow corrupt /system partition so it is stuck with the size specified in device tree.
[Nexus 5 Original Android Development] Clamor:
[MENTION=5042498]JekaPinsk[/MENTION] you aren't the first who has this issue. [MENTION=1521412]kraehetest[/MENTION] wrote here about it already. Somehow, only hammerheads are involved, flo and mako are fine. Next is that I was able to fill my /system partition without errors through coping big files (eg rom zips) to /system in TWRP and from Android and I got no file cuts or corruption on my hammerhead.
[Nexus 5 Original Android Development] JekaPinsk:
[MENTION=5424240]Clamor[/MENTION] Another thing I noticed is that flashing stock images results in infinite reboots like if power button stuck (google logo > reboot > repeat).

If I try to enter stock recovery, I get only lying robot and need to manually hold power, wait 3 secs and press vol up key. Then recovery options are shown and I can manually wipe data in order to successful boot. I believe I got this problem when I tried to return to stock after manual repartition by an older guide.

Maybe these problems are somehow connected?
[Nexus 5 Original Android Development] kraehetest:
I've also returned to Stock, no problems.
[Nexus 5 Original Android Development] Clamor:
[MENTION=5042498]JekaPinsk[/MENTION] I suppose you use f2fs on /data and stock kernel doesn't support it. That is why you need to make a /data format.
[Nexus 5 Original Android Development] JekaPinsk:
[MENTION=5424240]Clamor[/MENTION] Nope, I always use ext4 as /data FS.

And when you flash factory image /data is being formatted in ext4 anyways.

Looks more like there is an error with "wipe-after-install" task. [MENTION=1521412]kraehetest[/MENTION] do you have the same problem?
[Nexus 5 Original Android Development] kraehetest:
Hello,

I had the following effect. I enlarged the partition, installed Android, then did the resizing. I was then able to install a larger GAPPS package without any errors. But after that, the system partition was not much fuller than before. I guess he stops writing after one GB, or he writes to Nirvana. This could be a problem with the GAPPS installer. I haven't had time to test yet.
[Nexus 5 Original Android Development] JekaPinsk:
The problem is definitely not in gapps installer. As I mentioned before, it is impossible to manually write beyond 1gb (try to copy your rom zip to /system).

PS: Tried to flash stock rom via LGFlashTool to restore stock GPT table. No success. Probably will put my phone into 9008 mode to use BoardDiag.
[Nexus 5 Original Android Development] ipdev:
[MENTION=5042498]JekaPinsk[/MENTION] [MENTION=1521412]kraehetest[/MENTION]

Is it only with OpenGApps?

Did you try a different Gapps like DeltaGapps or MindTheGapps?

After installing rom and resizing the system image:

Install OpenGApps, no on screen errors, does the recovery.log file show errors?

Something like this maybe ?

install: can't create directory '/system/addon.d': Read-only file system
/tmp/installer.sh: line 2460: can't create /system/addon.d/70-gapps.sh: nonexistent directory

If you install a rom, resize system, wipe cache(s) and install OpenGApps. Does the installer fail and give space error?

If so, I might have a workaround or two that may work for you.

Note:

OT, so I will not get too far into explaining.

I have a similar problem with a different device and repartition method. I don't remember if I had to factory reset or just wipe cache to boot factory rom (Google mob30x). Only some users have an issue with system beyond 1.1G while most others have no problems using a 1.2G system.

PS.

My Hammerhead is charging. Was planning on repartitioning it tonight or tomorrow. Will let you know my outcome. :)
[Nexus 5 Original Android Development] Clamor:
[MENTION=5042498]JekaPinsk[/MENTION] use my repartition script once more to restore stock partition table.

P. S. Check attached screenshots
[Nexus 5 Original Android Development] JekaPinsk:
I didn't tried but I guess they will install correctly because of their small size.

Absolutely no errors. No difference from normal installation (even in installation duration).

---------- Post added at 17:06 ---------- Previous post was at 17:00 ----------

I manually used commands from your script to recover stock partition table (i.e. remove everything above mmcblk0p25 and recreate with default sizes).

After backup-restore trick I'm able to write above 1gb, too.

PS: by the way, can somebody share their's stock /crypto and /grow partitions (dd backups)?

I might lost them a while ago.
[Nexus 5 Original Android Development] Clamor:
[MENTION=5042498]JekaPinsk[/MENTION] they don't affect anything in our current state, but I'll ask untouched hh owner for this partition backups and upload them here.
[Nexus 5 Original Android Development] ipdev:
[MENTION=5042498]JekaPinsk[/MENTION]

I'm a little surprised that the log files do not hint at an error.

DeltaGApps is modular.

You can pretty much go completely stock google if you want.

Are you thinking size per installation has something to do with it?

OpenGApps installing everything at once ?

When I get some time, I will bulk up my Delta install. Normally I use gapps-base + gapps-keyboard. (I traditionally install the bare minimum in system. Anything more seems pointless to me since the first and sequential updates will be installed in userdata.)

Will let you know my findings.

[MENTION=5424240]Clamor[/MENTION]

Thank you. Repartitioning worked fine.

Some hiccups for me installing rom and gapps.

So far nothing that can not be overcome.

aosp_hammerhead-9-20181003.CAF

lineage-14.1-20181101-nightly-hammerhead

unified_partition_resize

open_gapps-arm-8.1-mini-20181103

open_gapps-arm-9.0-mini-20181103

magisk-release

Note:

I figured I may have some problems. Never touched the partitions on this device but, I have gotten odd errors before.

I haven't looked into unified_partition_resize yet. It works better than using twrp to resize system image but, for some reason it nukes my recovery.log file?

Side Note:

The OP is missing the backup steps. ;)

Cheers all. :D
[Nexus 5 Original Android Development] Clamor:
Resize in TWRP needs to be done twice, first one will end with error, second will be ok.

Backup of /crypto and /grow aren't needed, script backups them before repartition and restores after it is done.
[Nexus 5 Original Android Development] philipped346:
hello clamor , i have installed repartition and twrp , ok .

i don't see in twrp system and vendor if i want instal image , only boot and recovery , is it normal ?
[Nexus 5 Original Android Development] Clamor:
[MENTION=2690854]philipped346[/MENTION] yes, it is normal. Installing .img is available only for boot and recovery. If rom is provided as image, than preferable way of installation is fastboot.
[Nexus 5 Original Android Development] h4dd4d:
Thank You :good:

Work for my hammy . . . :)
[Nexus 5 Original Android Development] Mgallo:
every time you installed the aroma gapps, at the moment of starting the system the device enters bootloop and returns to the recovery

I can not resize from the recovery that you put because I get error 1 and solve it with a comment above by putting commands on the terminal
[Nexus 5 Original Android Development] virgilio999:
Hallo to all.

Repartition works fine in my Nexus 7 flo 32GB but doesn't work in my Nexus 5 hammerhead 16GB.

At start it seems to work because in TWRP terminal I write FP and the system partition seems to have 1,5 GB.

But when I installed RR OREO the system partition turned into 1,05 GB.

Where am I wrong?

Thanks!!
[Nexus 5 Original Android Development] kraehetest:
Hello,

flash the resize.zip from the second post, after installing the rom.
[Nexus 5 Original Android Development] virgilio999:
Yes! It works.

Thanks.
[Nexus 5 Original Android Development] kraehetest:
I tried again today after I failed a few months ago. See Post 40.

I tried it with Unlegacy Android Project 9.0 and OpenGapps. This time I formatted Data with F2FS. Then the system partition with ext4.

I don't know why, in any case it works now.
[Nexus 5 Original Android Development] koski.miles:
System Partition still 1GB

I followed steps and system is still 1GB.
[Nexus 5 Original Android Development] yagyaxt1068:
Oreo ROMs reboot straight into recovery.
[Nexus 5 Original Android Development] Clamor:
[MENTION=9478105]koski.miles[/MENTION] check size after /system format

[MENTION=6341846]yagyaxt1068[/MENTION] works ok for me (I'm on UA Oreo). You might flash recovery to boot partition, else there may be problems with rom itself.
[Nexus 5 Original Android Development] Clamor:
Delete, post duplication.
[Nexus 5 Original Android Development] mandayugana:
I'm unable to format /vendor and /data. System partition is already 1.5GB. Any hints, [MENTION=5424240]Clamor[/MENTION]?

Nevermind, I was successully re-partitioned my phone manually.
[Nexus 5 Original Android Development] tibman:
worked exactly as described, thank you!!!!
[Nexus 5 Original Android Development] tibman:
At first I thought it worked, this allowed me to install any oreo rom with the full gapps but now I am finding this as well, boots slowly, loading and then straight into recovery.
[Nexus 5 Original Android Development] solace mukhtar:
Everything works fine. Thanks.

---------- Post added at 07:27 PM ---------- Previous post was at 06:40 PM ----------

Pls am i going to flash the repartition zip every time i dirty flash rom?
[Nexus 5 Original Android Development] philipped346:
No
[Nexus 5 Original Android Development] ScarlettRose:
I always get "/vendor failed to mount" when entering twrp. Is that normal? I use the ua twrp.
[Nexus 5 Original Android Development] thang_legend:
me too, and after flash rom and gapps, everything seem fine
[Nexus 5 Original Android Development] mandayugana:
Does anyone know what /vendor partition is for in Nexus 5? Do we really need that partition?

Does it make sense to do repartitioning with /cache partition still 700MB? Yes, custom ROM with 700MB /cache partition.
[Nexus 5 Original Android Development] Clamor:
[MENTION=4443824]mandayugana[/MENTION] currently no, but we might need it, so let's be prepared. Big /cache has no sense in our current state.
[Nexus 5 Original Android Development] mandayugana:
Well, I get your purpose cutting down cache partition. Thanks
[Nexus 5 Original Android Development] Zachary_Foxx:
Hi,

Sorry, but when I should use the resize.zip: Immediately after resize the partition or after install the rom?
[Nexus 5 Original Android Development] kraehetest:
Please don't quote everything.

You only need to install it with a new ROM
[Nexus 5 Original Android Development] Clamor:
[MENTION=9576460]Zachary_Foxx[/MENTION] Lineage and Unlegacy ROMs don't require it anymore. Other ROMs may require it after install, you should ask developer of ROM. Additional info about resize you can find using search in this thread and my threads for Nexus 7 (2013) and Nexus 4
[Nexus 5 Original Android Development] Zachary_Foxx:
Sorry for that. It won't repeat!
[Nexus 5 Original Android Development] kamild_:
Do you mind expanding on this bit? How do you backup those and how do you restore if anything goes wrong?

Also can we expect a TWRP 3.3.0 that's compatible with this mod?

Much appreciated :)
[Nexus 5 Original Android Development] rogers11:
Hello, does anyone here use the modified recovery on an encrypted device?

I use Lineage 14.1 with the repartitioned system and the modified recovery does not accept the pattern.

The standard v3.2.3 is able to decrypt although it is not compatible anymore regarding the partitions.
[Nexus 5 Original Android Development] jcbcgeerts:
Zip file not recognized

Dear sir,

I tried repartitioning my Nexus 5, however the zipfile is not being recognized when flashing the zip file with twrp. Do you have a solution?

Best regards,

Jack
[Nexus 5 Original Android Development] Poor Grammar:
I don't think this mod if compatible with newest twrp..yet..[[[]]. Did you use twrp on Op
[Nexus 5 Original Android Development] Clamor:
[MENTION=4594947]TheReduxPL[/MENTION] EFS backup can be made in TWRP, about backup in terminal I'll write additionally in second post a bit later. I already have 3.3.x-1 UA TWRP for all supported devices but original TWRP sources have GUI bug, that is why I didn't post new recovery, we are waiting when TeamWin fixes it. Meanwhile, current version is still fine, it can install all ROMs including P.

[MENTION=4391631]rogers11[/MENTION] I did not test encryption/decryption feature so I can't say anything about it work. TWRP flags for hh are based on official TWRP tree for hh. Partition state shouldn't matter.

[MENTION=5376981]WelfareBaby[/MENTION] what do you mean by "compatible with newest twrp"?
[Nexus 5 Original Android Development] kamild_:
Thanks for the heads up [MENTION=5424240]Clamor[/MENTION] - I know the previous version can install Android P fine, it's more about supporting system encryption (which in the previous TWRP version is broken on both Android O and P).
[Nexus 5 Original Android Development] rogers11:
... and N.
[Nexus 5 Original Android Development] lulli1:
Worked perfect thanks a lot! One question: if I want to restore everything to stock format. Is it enough to flash stock IMG from Google for hammy? Will this automatically resize all partitions?
[Nexus 5 Original Android Development] solace mukhtar:
Use the file u used to repartition. And write stock in the terminal, it'll go back to stock.
[Nexus 5 Original Android Development] psydex:
Instructions not clear!

I red this tutorial a dozen times and still can't figure out all the things need to be done.

EDIT: Okay, so I finally pulled the trigger and everything went fine! Flashed ROM, gapps, everything boots but once I go back to TWRP to flash another .zip it pulls up an error:

Failed to mount '/vendor' (Invalid argument)

Should I be worried [MENTION=5424240]Clamor[/MENTION] ?
[Nexus 5 Original Android Development] razzvg:
Cannot download twrp

410 Gone

Edit: works again. Thanks for the mod it worked perfectly!
[Nexus 5 Original Android Development] beekay201:
hey, sorry to bother, would someone just please confirm if i need to do this to my phone if i want to run 9.0+gapps

edit: answer is yes
[Nexus 5 Original Android Development] lulli1:
No, the answer is " it depends on what ROM you want to flash".

Some pie ROMs are good to go with pico gapps and no repartitioning. For example ua.
[Nexus 5 Original Android Development] psydex:
So I've done repartitioning, already running Pie but let's say I decide to switch ROM.

Do I simply flash the next ROM and gapps or do I need to repartition again?
[Nexus 5 Original Android Development] tmihai20:
I had some issues with repartitioning, mostly because of me. At some point I had my Nexus 5 connected to a PC while trying to repartition it. I managed to do it (properly, I would say), but now my /data and /sdcard show way too little space left on it. I tried resizing, it did not do anything. If I try to backup /data, it says it had 1182 MB (it is a fresh install).

/dev/block/mmcblk0p29 12.3G 8.0G 4.3G 65% /data

/dev/block/mmcblk0p29 12.3G 8.0G 4.3G 65% /sdcard

/dev/block/mmcblk0p28 197.0M 4.4M 192.6M 2% /cache

I remember copying the stuff from internal memory back onto my freshly repartioned Nexus 5, but those are somehow gone. Any help is appreciated.
[Nexus 5 Original Android Development] Poor Grammar:
[youtube]aVaK7WJZB4s[/youtube]. Anyone used this YouTube tutorial it seems to be promising :good:...I think we have a winner
[Nexus 5 Original Android Development] Clamor:
[MENTION=4972805]psydex[/MENTION] simply flash new rom, no more repartition is needed

[MENTION=2782481]tmihai20[/MENTION] provide parted log
[Nexus 5 Original Android Development] tmihai20:
[MENTION=5424240]Clamor[/MENTION]: I wiped out everything and reinstalled Rom. I also copied everything. I may have unmounted internal memory and copied the files to /sdcard instead of internal memory (I was in recovery). Now it seems to be ok. I do not know how files could have been copied there.
[Nexus 5 Original Android Development] nleco:
I'm having some issues.

I have the twrp version flashed as my recovery. I ran the hh_clamor_repartition.zip file via (adb sideload "the.zip.file") and it ran fine. I ran it again to undo it and now it seems it can't mount anything. when I try to flash it again, it tells me that i don't have a Nexus 5.

I tried to install these: lineage-16.0-20190427-UNOFFICIAL-hammerhead.zip

I did forget to flash the partition_resize.zip, so maybe that has messed something up?

when you guys say to "flash" files, do you mean a) put the zip file on the device and use twrp "install"? or b) via the adb sideload command?

here are some photos.
[Nexus 5 Original Android Development] Clamor:
[MENTION=4946768]nleco[/MENTION] you just totally ignored all instructions from first post
[Nexus 5 Original Android Development] nleco:
No. I followed them and when I tried to install open apps, it did not work. I then tried to undo it by running the "stock" command, and that's when it crapped out on me.
[Nexus 5 Original Android Development] Clamor:
[MENTION=4946768]nleco[/MENTION] you partition table is totally messed up. It is miracle that your hh boots. Repartition zip for hh couldn't made this.

P.S. PM me
[Nexus 5 Original Android Development] beekay201:
"it depends on what ROM you want to flash" - rom devs should then post it up on their install instructions (i looked at two roms, so two threads, none said i would need to repartition if I wanted to use gapps.)

but thanks for replying
[Nexus 5 Original Android Development] Hugo9191:
Everything worked as intended. Just as a btw, my phone was encrypted and upon using the script, it asked for my password. I tried one (which I believe was correct) and, obviously, it didn't work. Just click cancel, swipe to allow mods and continue the list (aka wipe all that ****) and it'll work.

Gave life to my old Nexus. Спасибо братан!
[Nexus 5 Original Android Development] tmihai20:
You can tell if you would need repartition if the zip is larger than 366-368 MB. That is the size of the last ROM I was able to use with the smallest Gapps packages (nano gapps, if I am not mistaken). By using this script I was able to install pico OpenGapps and have Google Assistant working out of the box.

Edit: I am attaching the log for the time when repartitioning failed. I am leaving it here in case someone else needs it.
[Nexus 5 Original Android Development] nleco:
[MENTION=5424240]Clamor[/MENTION],

I'm not 100% sure how the partition tables were screwed up. But maybe one was previously off and runing the repartitioning flash somehow brought it to light.

Anywho, I wound up following this to restore my partitions:

https://xdaforums.com/google-nexus-5/general/fix-unbrick-nexus-5-stucked-qualcomm-hs-t3043301

I had to remove all C++ libraries from "remove software" and install just this (i'm on windows 10).

https://www.microsoft.com/en-us/download/confirmation.aspx?id=5555

I then went ahead and redid the steps, and things are all good now.

I installed these:

XDA Post (download link)

ARM 9.0 - Pico make sure you select version

I also installed Magisk prior to rebooting.
[Nexus 5 Original Android Development] Rastakhan:
I applyed the resizing, furter I can install the newest version of TWRP?

Thanks for the fixing!
[Nexus 5 Original Android Development] mruibal:
This is perfect! Great job! It worked so fine in my Nexus 5! Now I can install last RR android pie version and gapps. Before this repartition gapps did not have enough space to be installed, even the pico gapps.

Many thanks!
[Nexus 5 Original Android Development] douguluskaien:
thanks this really work

thanks Clamor you are a life saver

This solves my

TWRP Error 70: Insufficient storage space available in the system partition

when installing custom ROM

i think direction is not so clear for people who hasn't done many custom rom flash

WARNING: I did a clean install and WIPE ALL DATA.

a bit details here

1. download

hh_clamor_repartition.zip

&

twrp-3.2.3-1_UA-hh.img

. In addition, download the Open GAPP

ARM

PICO .zip from Open GAPP (depend on which android os version). Nexus 5 is an ARM.

2. go to Recovery via either custom rom restart that can select Recovery, or after shutdown the phone, hold both volume up & down, then power button to force to Recovery.

3. backup data from your phone to PC. copy the

hh_clamor_repartition.zip

to phone

4. In Recovery, select Install, pick hh_clamor_repartition.zip UNCHECK "reboot after installation is complete". if you don't do this, then you wouldn't see the msg tell you to go to Advanced > Terminal and type "modify"

5. once the repartition is done. it will reboot to Recovery, here go to Reboot to Bootloader

6. on your PC, open command prompt in the adb folder. type

Fastboot flash recovery twrp-3.2.3-1_UA-hh.img

. once it is successful. on your phone, the bootloader screen, use volume up or down to find Recovery, and use power button to select it.

7. in Recovery, select Wipe > Format Data > type YES. no need to reboot

8. go back to Wipe > Advanced Wipe > CHECK all boxes, then Swipe to Wipe

9. connect phone to PC (you should already have ADB). make sure you are in TWRP and Mount your phone.

10. copy Custom ROM & Open GAPP

ARM

PICO .zip to phone

11. in Recovery, select Install. Pick the Custom ROM that you want to flash. UNCHECK "reboot after installation is complete" before installation. do not reboot

12. use back arrow, select your OPENGAPP .zip file and install. after this, you can reboot

the initial boot will take a while, but it works.

i flashed RR-P-v7.0.2-20190505-hammerhead-Official.zip & open_gapps-arm-9.0-pico-20190522.zip on my Nexus 5 16GB

Once again, i need to thank

Clamor

for providing this wonderful tool.
[Nexus 5 Original Android Development] sudar0489:
Very Clear Instructions

Very clear instructions, thanks a lot... finally i have flashed AEX 9.0 without any error... :):):):good::good::good:
[Nexus 5 Original Android Development] m.morcielago:
Thank you for your awesome Guiding

I did it very easy and I have 1.5 GB System partition space

And I flashed RR V7 and after that I flashed opengapps micro

I didn't get any error

Everything is fine
[Nexus 5 Original Android Development] sudar0489:
If i jump to another PIE ROMs?

Please inform, if i need to flash some other ROMS, same method have to do, or just flashing the others ROMS & GApps. (Note: I have done partitioning already).
[Nexus 5 Original Android Development] douguluskaien:
i tested this yesterday with AEX 9

i did a clean install, so start from step 7

it will seems just loading custom rom.zip and gapps.zip will work as well. step 10
[Nexus 5 Original Android Development] sudar0489:
Got it,, thanks man:):good:
[Nexus 5 Original Android Development] kaetakara:
So I am 100% new to rooting phones, etc but I do have technical background. What you have said makes sense and I have followed this. Granted, I used a random rom I found for now for the OS. But after doing these steps exactly, the system partition should be 1.5gb now?
[Nexus 5 Original Android Development] douguluskaien:
clamor's 2 files makes partition 1.5GB

if you didn't see any errors when you executed the two, you should have 1.5GB

if you don't have 1.5GB, then after you installed either Oreo or Pie Roms, you won't be able to install any version of GAPPs