yashsingh1/xdaforums huggingface dataset:
[Nexus 5 Original Android Development] mscuttari:
Here is the log. The internal storage is also seen as of 0 MB size.

I also PMed you on Telegram (many thanks for your availability)

Model: MMC SEM16G (sd/mmc)
Disk /dev/block/mmcblk0: 15758000128B
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 524288B 67633151B 67108864B fat16 modem
2 67633152B 68681727B 1048576B sbl1
3 68681728B 69206015B 524288B rpm
4 69206016B 69730303B 524288B tz
5 69730304B 70254591B 524288B sdi
6 70254592B 70778879B 524288B aboot
7 70778880B 72876031B 2097152B pad
8 72876032B 73924607B 1048576B sbl1b
9 73924608B 74448895B 524288B tzb
10 74448896B 74973183B 524288B rpmb
11 74973184B 75497471B 524288B abootb
12 75497472B 78643199B 3145728B modemst1
13 78643200B 81788927B 3145728B modemst2
14 81788928B 82313215B 524288B metadata
15 82313216B 99090431B 16777216B misc
16 99090432B 115867647B 16777216B ext4 persist
17 115867648B 119013375B 3145728B imgdata
18 119013376B 142082047B 23068672B laf
19 142082048B 165150719B 23068672B boot
20 165150720B 188219391B 23068672B recovery
21 188219392B 191365119B 3145728B fsg
22 191365120B 191889407B 524288B fsc
23 191889408B 192413695B 524288B ssd
24 192413696B 192937983B 524288B DDR
25 192937984B 1803551231B 1610613248B ext4 system
26 1803551232B 2065695231B 262144000B vendor
27 2065695232B 2097152511B 31457280B crypto
28 2097152512B 2306867711B 209715200B cache
29 2306867712B 15757977599B 13451109888B userdata
30 15757977600B 15757983231B 5632B grow

EDIT: solved thanks to Clamor. Solution: format data (I also had to format cache)
[Nexus 5 Original Android Development] pochutkova.smotana:
Big thank you Clamor for this.

Repartition tool works, but many of us mess up the partition table before using it so it results in missing partitions errors. I also had the problem, but after manually re-partitioning the phone I was successful (thanks to repartition.sh script in your tool).

For all those searching for partition allocation list after using this tool it's the one in the mcuttari's post above.
[Nexus 5 Original Android Development] quest2012:
Need help

Hi Clamor , need help , I am in the same boat as Linus , all my partitions have gone for a toss. Will appreciate your help .

---------- Post added at 03:34 PM ---------- Previous post was at 03:09 PM ----------

I too have messed it up , and I cannot format data - same errors come up i.e. failed to mount XXXX ., unable to mount storage . Probably I need some attention from Clamor .
[Nexus 5 Original Android Development] mscuttari:
Check if the partitions are the same as mine (if you have the 16GB version, otherwise check 2nd post). If they are, it means that partitioning went well and you have to format data (in the wipe section, but be sure to go for the format option and not the wipe one). Then wipe the partitions that fail to mount.
[Nexus 5 Original Android Development] quest2012:
I am not able to format -

It does say on the top that data format successful, however with a whole bunch of errors

Failed to mount '/data' invalid argument

unable to recreate /data/media folder

And then updating partition details -

failed to mount '/system'( (invalid argument)

Failed to mount "/vendor" (invalid argument) .....

unable to mount storage .

So this is the status , completely messed up partitions .
[Nexus 5 Original Android Development] Clamor:
[MENTION=4906151]quest2012[/MENTION] first of all, partition log! Second, format partition despite errors.

I don't understand why people are stopped when this errors appear... Almost every second post of this thread refers to this issue.
[Nexus 5 Original Android Development] quest2012:
Thanks Clamor for the reply -

I did the following , searching alot , nothing happens.

1. Formatted using twrp , however when I go back I still cannot mount cache and vendor . I also changed to the orginal twrp , and found that data and vendor were the only partitions I could not mount .

2. I tried the changing file system trick did not help me , only for system the file system changes, but for data and cache did not let me do .

3. I tried to factory reset i.e. extracted Google images and did a flash-all , when I saw the boot animation I was excited but I was into a boot loop .

4. I am looking for any new ways

This is my current state

/dev/block/mmcblk0p25 /system ext4 rw 0 0

/dev/block/mmcblk0p28 /data ext4 rw 0 0

/cache ext4 rw 0 0

/dev/block/mmcblk0p16 /persist ext4 rw 0 0

/dev/block/mmcblk0p1 /firmware vfat rw 0 0

/usb-otg vfat rw 0 0

partition

179 0 30535680 mmcblk0

179 1 65536 mmcblk0p1

179 2 1024 mmcblk0p2

179 3 512 mmcblk0p3

179 4 512 mmcblk0p4

179 5 512 mmcblk0p5

179 6 512 mmcblk0p6

179 7 2048 mmcblk0p7

179 8 1024 mmcblk0p8

179 9 512 mmcblk0p9

179 10 512 mmcblk0p10

179 11 512 mmcblk0p11

179 12 3072 mmcblk0p12

179 13 3072 mmcblk0p13

179 14 512 mmcblk0p14

179 15 16384 mmcblk0p15

179 16 16384 mmcblk0p16

179 17 3072 mmcblk0p17

179 18 22528 mmcblk0p18

179 19 22528 mmcblk0p19

179 20 22528 mmcblk0p20

179 21 3072 mmcblk0p21

179 22 512 mmcblk0p22

179 23 512 mmcblk0p23

179 24 512 mmcblk0p24

179 25 1048576 mmcblk0p25

179 26 30720 mmcblk0p26

179 28 28551146 mmcblk0p28

179 29 5 mmcblk0p29

179 32 4096 mmcblk0rpmb

Thanks for looking into this.
[Nexus 5 Original Android Development] Clamor:
[MENTION=4906151]quest2012[/MENTION] oh well, looks like you really messed up your partition table. I'll write script to fix it tomorrow. Till then don't do anything with your phone
[Nexus 5 Original Android Development] SergeiAK:
need help

Hey. Can you help me?

Here is my partition log.

Model: MMC SEM16G (sd/mmc)

Disk /dev/block/mmcblk0: 15758000128B

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number Start End Size File system Name Flags

1 524288B 67633151B 67108864B fat16 modem

2 67633152B 68681727B 1048576B sbl1

3 68681728B 69206015B 524288B rpm

4 69206016B 69730303B 524288B tz

5 69730304B 70254591B 524288B sdi

6 70254592B 70778879B 524288B aboot

7 70778880B 72876031B 2097152B pad

8 72876032B 73924607B 1048576B sbl1b

9 73924608B 74448895B 524288B tzb

10 74448896B 74973183B 524288B rpmb

11 74973184B 75497471B 524288B abootb

12 75497472B 78643199B 3145728B modemst1

13 78643200B 81788927B 3145728B modemst2

14 81788928B 82313215B 524288B metadata

15 82313216B 99090431B 16777216B misc

16 99090432B 115867647B 16777216B ext4 persist

17 115867648B 119013375B 3145728B imgdata

18 119013376B 142082047B 23068672B laf

19 142082048B 165150719B 23068672B boot

20 165150720B 188219391B 23068672B recovery

21 188219392B 191365119B 3145728B fsg

22 191365120B 191889407B 524288B fsc

23 191889408B 192413695B 524288B ssd

24 192413696B 192937983B 524288B DDR

25 192937984B 1803551231B 1610613248B ext4 system

26 1803551232B 2065695231B 262144000B vendor

27 2065695232B 2097152511B 31457280B crypto

28 2097152512B 2306867711B 209715200B ext4 cache

29 2306867712B 15757977599B 13451109888B ext4 userdata

30 15757977600B 15757983231B 5632B grow
[Nexus 5 Original Android Development] zambara:
i need help please

after i did the repartition action all phone's memory got wiped ( as expected).

Now i need to push to phone some files, TWRP, custom rom, gapps

But i cant mount memory to my pc...

Thanks
[Nexus 5 Original Android Development] Az Biker:
* * * REMINDER * * *

Please keep comments directly related to the development in this thread.

Off-topic, unrelated, and comments in violation of Forum Rules will be deleted.

If your comment isn't helpful, directly related to this development, or respectful, please don't post it.

The unpopular need to moderate certain comments was born out of the inability or refusal of members to follow the rules.

Ironically, when the rules are followed, the need for moderation drastically drops.

Thanks for everyone's help.
[Nexus 5 Original Android Development] Clamor:
You should be able to enter recovery mode anyway. Format partitions and you r good to go. At least you should have access to fastboot and flash recovery image.
[Nexus 5 Original Android Development] Rianon:
Big thanks for such a great work. Is it possible to make a script for 2GB (or even 4) system? Cause just now I can use only pico gapps.
[Nexus 5 Original Android Development] Noro42:
hh_repart: Too many symbolic links encountered

Hi, I've problem using hh_repart on my Nexus 5.

Using hh_repart on TWRP 3.3.1 I got:

------

hh_repart -m

sh: hh_repart: Too many symbolic links encountered

------

And now the partition log is:

Model: MMC SEM16G (sd/mmc)

Disk /dev/block/mmcblk0: 15758000128B

Sector size (logical/physical): 512B/512B

Partition Table: gpt

Number Start End Size File system Name Flags

1 524288B 67633151B 67108864B fat16 modem

2 67633152B 68681727B 1048576B sbl1

3 68681728B 69206015B 524288B rpm

4 69206016B 69730303B 524288B tz

5 69730304B 70254591B 524288B sdi

6 70254592B 70778879B 524288B aboot

7 70778880B 72876031B 2097152B pad

8 72876032B 73924607B 1048576B sbl1b

9 73924608B 74448895B 524288B tzb

10 74448896B 74973183B 524288B rpmb

11 74973184B 75497471B 524288B abootb

12 75497472B 78643199B 3145728B modemst1

13 78643200B 81788927B 3145728B modemst2

14 81788928B 82313215B 524288B metadata

15 82313216B 99090431B 16777216B misc

16 99090432B 115867647B 16777216B ext4 persist

17 115867648B 119013375B 3145728B imgdata

18 119013376B 142082047B 23068672B laf

19 142082048B 165150719B 23068672B boot

20 165150720B 188219391B 23068672B recovery

21 188219392B 191365119B 3145728B fsg

22 191365120B 191889407B 524288B fsc

23 191889408B 192413695B 524288B ssd

24 192413696B 192937983B 524288B DDR

25 192937984B 1266679807B 1073741824B ext2 system

26 1266679808B 1298137087B 31457280B crypto

27 1298137088B 2032140287B 734003200B ext4 cache

28 2032140288B 15757977599B 13725837312B ext4 userdata

29 15757977600B 15757983231B 5632B grow

----------

To me that sounds as nothing had happend.

May I use hh_repart -m or hh_repart modify?

Thanks in advance
[Nexus 5 Original Android Development] calaver4:
I agree, should be very appreciated to have a system partition of 2 or 3 GB, unfortunately 1,5 GB is too small for recent Android distros.

Please update the script to get a bigger system partition.

Thanks in adavance
[Nexus 5 Original Android Development] Xemanth:
Unfortunately, first post links are not working. Where I can dl these for my D821 Hammerhead?

Kindly asking.

Thanks.
[Nexus 5 Original Android Development] Xemanth:
Can somebody send me those files? Thx!
[Nexus 5 Original Android Development] gimel3830:
It looks like somebody backed it up on AndroidFileHost
[Nexus 5 Original Android Development] Clamor:
It is possible I think, but needs further investigation. Find me in telegram.
[Nexus 5 Original Android Development] Clamor:
I'll add all zip's to my github repo. You may use the most resent twrp, it should work just fine.
[Nexus 5 Original Android Development] Clamor:
It is possible, but only manually. Applying repartition on repartition will be risky.
[Nexus 5 Original Android Development] tmihai20:
Can we get a script that increases the system partition to 2 GB? Of course after going back to stock layout.
[Nexus 5 Original Android Development] Xemanth:
Link?
[Nexus 5 Original Android Development] Xemanth:
Excelllent, downloaded! Thank you.
[Nexus 5 Original Android Development] Clamor:
Use manual guide
[Nexus 5 Original Android Development] sappounet:
Hi,

I'm about to upgrade from LOS 14 to LOS 17.1 on my Nexus 5, and I'm assuming that I would need to increase the partition size, so that's why I'm looking at this thread.

Can someone confirm that we need to increase the partition size when we want to upgrade to the newest versions of Android, like LOS 17.1 ?

Thanks
[Nexus 5 Original Android Development] gimel3830:
Yeah you have to do it and you can do it by using this tool
[Nexus 5 Original Android Development] Karsteski:
This messed up my device partitions...

I reflashed TWRP and I can use it, but any time I try to flash anything or repair my filesystem I get the following errors:

Failed to mount '/system' (Invalid argument)

Failed to mount '/cache' (Invalid argument)

...done

E:Error creating fstab

Does anyone have any advice on fixing this?

Additionally, following this SO advice to flash a factory image does not work either, as when the batch file is writing the `system.img` it gives the following error:

Sending 'system' (1021620 KB) OKAY [ 32.225s]

Writing 'system' FAILED (remote: 'partition table doesn't exist')
[Nexus 5 Original Android Development] Clamor:
I have uploaded all needed binaries into my GH account. Links are updated. Sorry for delay.
[Nexus 5 Original Android Development] Rootmaster906:
how do you recommend flashing a11 roms? thanks
[Nexus 5 Original Android Development] Rootmaster906:
This doesn't work at all
[Nexus 5 Original Android Development] Rootmaster906:
Coming from stock a6... unlocked bootloader..what recovery do I initially flash to use this partitioning zip? Thanks

edit: went ahead and just flashed this recovery and then did the partition zip.
[Nexus 5 Original Android Development] Clamor:
I don't recommend flashing a11 roms
[Nexus 5 Original Android Development] Rootmaster906:
may i ask why? thanks
[Nexus 5 Original Android Development] Clamor:
It is too heavy for N5
[Nexus 5 Original Android Development] Rootmaster906:
which do you recommend?
[Nexus 5 Original Android Development] Clamor:
8.1 Oreo
[Nexus 5 Original Android Development] tmihai20:
I have a 32 GB Nexus 5 and I am getting this error when formatting userdata "bogus size sparse and chunk header". I did try flashing the latest 6.0.1 factory image, but it did not help. What can I do?

Later edit: I somehow managed to fix it. It looks like the latest Platform Tools are not quite suited for our Nexus 5. I downloaded NRT_v2.1.9 that has an older version of the Platform Tools, I flashed the latest available factory image, I flashed the regular TWRP and then the repartition script a few times (it was successful every time) and now I have a functional 32 GB Nexus 5 again. It helped that NRT could not get connectivity so it could not update any of its tools. I don't know which Platform tools version that is.

c:\Downloads\NRT\data>adb --version

Android Debug Bridge version 1.0.36

Revision e02fe72a18c3-android
[Nexus 5 Original Android Development] Rootmaster906:
I can flash a11 roms, gapps and magisk.. but can only flash a8.1 with no gapps. Error 70. Flashes RRO
[Nexus 5 Original Android Development] Rootmaster906:
Is it just me or does it seem that the system partition seems to go away after every flash?
[Nexus 5 Original Android Development] geokilla:
Is the repartition zip in OP outdated? I tried flashing the hammerhead one but still don't have a /vendor filesystem. I'm back to Google stock right now so I should be on original partitions.

Edit: Got it working.
[Nexus 5 Original Android Development] Rootmaster906:
How u fix? Plz share
[Nexus 5 Original Android Development] geokilla:
I followed the instructions in OP. Apparently I misunderstood them. Instead of booting into whatever Recovery is installed on the Nexus 5, boot into the Recovery on the Github page. Then follow the rest of the instructions.
[Nexus 5 Original Android Development] Driv:
I am receiving the error: "It is not Nexus 5"

Edit: I have modified the partiton layout before but i can Stock-Recovery ROM (i tried these steps before... https://xdaforums.com/t/guide-repar...-partition-space-for-rom-stock-gapps.3509880/)
[Nexus 5 Original Android Development] Ngbhat:
After installing zip file ended with this is not nexus 5 device and installation is filed
[Nexus 5 Original Android Development] Ngbhat:
Am unable to flash even stock rom also

While formatting data it shows error partition table doesn't exist. Unable to mount System/data/cache (invalid argument) anyone plz help me to get original partition table
[Nexus 5 Original Android Development] Ngbhat:
Am unable to install zip file. Internal memory 0mb and /data invalid argument. Formatting is also failed. Unable to mount storage also showing partition table doesn't exist plz help me
[Nexus 5 Original Android Development] froilson:
I try mounting, unmounting an nothing makes a difference, always the same error, I've gone back to my previous version of recovey twrp-3.2.3-0-hammerhead and with terminal I run this commands:

e2fsck -f /dev/block/mmcblk0p25

resize2fs /dev/block/mmcblk0p25

This works, the resize was made good and now I go back to the new TWRP version, the one in this thread, and all is working well.
[Nexus 5 Original Android Development] Clamor:
[MENTION=6476406]M Asad Khilji[/MENTION] No, or at least it is very unlikely. Although, /vendor partition makes it a bit more realistic.

[MENTION=736532]froilson[/MENTION] I had same strange resize errors with both official and UA TWRP from time to time. I suppose it is a TWRP source code problem.
[Nexus 5 Original Android Development] vikaseth:
bro i have same problem as u face and not know how to use commond in terminal ..please help asap........system partition 1 gb data 0 rom flashed with adb sideload but after reboot it ask for decription key becoz data is null
[Nexus 5 Original Android Development] Clamor:
[MENTION=5151115]vikaseth[/MENTION] use partition log zip and provide your current partition table state by taking a picture of log after zip is flashed (not a screenshot!).
[Nexus 5 Original Android Development] vikaseth:
i created successfully partition.log in internal storage but it is unaccesable from pc so how i uploaded it here

thanks for your quick reply
[Nexus 5 Original Android Development] Clamor:
[MENTION=5151115]vikaseth[/MENTION] looks like you can't so use this guide till step 5 including. It is model independent till that step.
[Nexus 5 Original Android Development] vikaseth:
do u want this one ...bro please help
[Nexus 5 Original Android Development] Shotg1:
Is there anyone successfully repartition your hh?
[Nexus 5 Original Android Development] M Asad Khilji:
Yes!
[Nexus 5 Original Android Development] Shotg1:
How did you do?
[Nexus 5 Original Android Development] M Asad Khilji:
Just followed the OP's instructions
[Nexus 5 Original Android Development] Shotg1:
What did u input in terminal emulator in recovery?
[Nexus 5 Original Android Development] Clamor:
[MENTION=7432075]Shotg1[/MENTION] flash repartition pack, and you will know.
[Nexus 5 Original Android Development] M Asad Khilji:
Just follow op instructions
[Nexus 5 Original Android Development] Shotg1:
Thanks working verywell to my hh
[Nexus 5 Original Android Development] Shotg1:
Question, im going to flash the latest ua build over the previous build i plan to dirty flash do i need to flash the zip again?

---------- Post added at 10:58 AM ---------- Previous post was at 10:53 AM ----------
[Nexus 5 Original Android Development] Clamor:
[MENTION=7432075]Shotg1[/MENTION] you have to flash rom, make resize and then gapps and any package you used. UA roms are pure AOSP so they don't support addon.d scripts
[Nexus 5 Original Android Development] kg2811:
Hello, I did all the following steps to repartition(from 1st post), no error messages appeared until i tried to install the system(official LOS 14.1). I checked the partition layout with a log file provided in the 2nd post and it says that its modified. Now to the errors that appeared:

Patching system image unconditionally...

E1001: Failed to update system image.

Updater process ended with Error: 7

Error installing zip file '/sdcard/linage...zip'

Updating partition details...

Failed to mount '/vendor' (invalid argument)

Failed to mount '/cache' (invalid argument)

...done

After that i tried to repair the partitions using Advanced Wipe but another error message appeared:

Repairing Vendor using e2fsck...

/sbin/e2fsck -fp /dev/block/mmcblk0p26 process ended with ERROR: 8

Unable to repair Vendor

I didn't tried to fix it in any other way yet. Thanks in advance for your help.
[Nexus 5 Original Android Development] Clamor:
[MENTION=5504884]kg2811[/MENTION] try to format all available partitions in advanced wipe menu.
[Nexus 5 Original Android Development] kraehetest:
Hello,

thanks for the work and the instructions. For me it only works in theory.

The partitions with the new sizes are created. After that I formatted them successfully. (Advanced Wipe)

I installed LineageOS and did the resize. After that it shows the 1.5GB again.

Problems are caused by the Google Apps (OpenGapps). I can now install the larger packages as well. But it seems like after 1 GB the partition will be overwritten again. It doesn't boot up anymore, but goes back to recovery. If I install a smaller package, it starts, but there are things missing that should be installed.

Davik/Cache were wiped.

I tried this several times. Also back to the stock layout and then System 1.5GB again. I am helpless.

Are such problems known?

With the stick layout and the aroma installer everything worked well.

Thanks
[Nexus 5 Original Android Development] Clamor:
[MENTION=1521412]kraehetest[/MENTION] fascinating, PM me and we will fix this if you are interested ;)
[Nexus 5 Original Android Development] sjrmac:
Hey guys! I'm doing this for a friend and i cannot fit stock GAPPS in his 16GB Nexus 5... Using the zip and special TWRP already and flashed the most popular unofficial LOS 15.1 build. I personally don't have much experience messing with partitioning and GPTs, and i do not want to mess up my buddies phone. Would it be possible to give the /system partion 3GB of space instead of 2 or 2000MB? I feel that would be useful to most users in my opinion but i could be wrong. Thanks for the work on this though, it's awesome :)
[Nexus 5 Original Android Development] Clamor:
[MENTION=7864014]sjrmac[/MENTION] No, making /system 2 or 3GB is pointless same as using big gapps package. It is simple wasting of space. Main goal of this reparition scheme is to fit increasing size of system.img as long as possible. I advice to use pico, nano or micro gapps.
[Nexus 5 Original Android Development] Nezorflame:
[MENTION=5424240]Clamor[/MENTION] thanks for your mod, worked on my device without any issues.

Flash sequence after the resize (if someone's interested): latest UA Pie -> auto-resize ZIP from the second post -> nano OpenGApps -> Magisk 17.2 -> reboot -> PROFIT.
[Nexus 5 Original Android Development] sjrmac:
I wanted to do stock GAPPs because I wanted to simply keep the phone as close to stock as possible. Before the phone was wiped, almost every stock app and Google service was used so I'm trying to retain that. Even if you don't want to make a zip for this, could you maybe send me a modified file that I could input into a current zip? It's unfortunate that I have different use cases than others.
[Nexus 5 Original Android Development] Clamor:
[MENTION=7864014]sjrmac[/MENTION] creating new script will involve recalculation sizes of 5 partitions and it won't be compatible with current stock partition restore mechanism. If you are so interested in creating 2GB system partition use this guide. Sorry.
[Nexus 5 Original Android Development] kraehetest:
You can try Aroma Gapps. And select the Apps you want and uninstall Lineage Apps and Lineage wallpapers. It could/should fit in 1.5 GB.
[Nexus 5 Original Android Development] froilson:
Why is the vendor partition created, if in the original configuration this partition has not exist? What's its purpose? My current ROM doesn't mount the partition in /vendor however it makes a symlink to /system/vendor. I think this partition is waste of space in practically all ROMs, at least until a clarification.

Enviado desde mi Nexus 5 mediante Tapatalk
[Nexus 5 Original Android Development] Clamor:
[MENTION=736532]froilson[/MENTION] /vendor partition is:

- additional storage that can be added to main /system partition if there would be such need;

- additional partition that can be used for different proposes;

250MB isn't so big loss comparing with possibilities it may give.
[Nexus 5 Original Android Development] JekaPinsk:
MTP seems to be broken in this recovery.