• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[REPARTITION] Nexus 5 Repartition [HAMMERHEAD] [16GB/32GB] [UA TWRP]

Search This thread

sant514

Senior Member
Jun 1, 2014
99
50
For sure I would recommend a return to the stock partition, with this recovery version and then you can flash z3DDr3 TWRP 3.3.1-HH.R.4
The zDD3r's TWRP has an advantage, it can make decryption in Android 8, Android 9, Android 10 and it has NTFS support (read and write) in USB OTG.
 
Last edited:

2020suite

New member
Mar 18, 2020
1
0
Need assistance!

I do hope someone can still help me. I have installed android 10 to my nexus 5 but I can't install the latest gapps (even the pico version) due to lack of space in the partition.
 

dahawthorne

Senior Member
Nov 15, 2014
1,993
1,838
Brighton
Can someone please help this member writing about lack of space in a repartition thread?
Edit: Apparently not...
So, the first and most obvious glaring question - have you repartitioned your Nexus 5?
Edit: After four days, nothing. Yet again. Yet another occasion where I try to help a junior member, to receive only silence. I am disinclined to bother any more.
 
Last edited:
  • Like
Reactions: ipdev

psihopanda

New member
Mar 22, 2020
1
0
Can you please help me? i repartitioned but it broke my partition table i suppose because everything showed 0MB in TWRP and when wiping it said "failed to mount '/everything' (Invalid argument)" when i tried to partition it to stock it spilled out some errors and when i tried again it said "This is not Nexus 5"
 

rhplusa10

Senior Member
Feb 18, 2011
222
61
Los Angeles
@rammazzoti2000 you shouldn't give advises if you aren't 100% sure in it. Flashing pure factory image via fastboot will mess up pt, NOT restore it!
@Linus L send me your partition logs in PM

This is for someone who flash factory image and get stuck.

I did flashing factory image, and I got stuck on the boot.
I could still get into bootloader, so flashed twrp and install other roms but still stuck.

after that, I found this thread and... I found way to recover it.

Have to go through repartition again. this time, it asks revert back to stock.
and then, do it again to modify partition.
after flash twrp, it shows vendor partition error. dont worry. after wipe(format) it, it will be gone.

then, you can install any rom you like, and.. my ancient N5 is back!
 
  • Like
Reactions: ipdev and Clamor

MFritzN

New member
Apr 2, 2020
2
1
Can not extract updater-script / mount '/vendor

Hello, hope there are still some active members who can help someone like me.

I followed the instruction strictly but when I execute the zip I get the output:
Can not extract updater-script. Do you have it in package?
Updating partition details...
Failed to mount '/vendor' (Invalid argument)
...done


I never reach the "Type something into your terminal part" .

Now I get the mount error every time I try to do something in recovery but that doesn't seem to have any effect I was able to get my system back running by loading a backup. I tried to fix the mount error by "formatting data" and wiping everything. Didn't work.

I am just copying the files from my PC to my phone and execute them with TWRP. So I don't get why a file should be missing. My Google/XDA search wasn't really successful so maybe someone of you encountered similar problems and can help with the mount error or the missing updater-script. Thanks.
 

ipdev

Recognized Contributor
Feb 14, 2016
1,619
1
2,176
Google Nexus 10
Nexus 7 (2013)
I do hope someone can still help me. I have installed android 10 to my nexus 5 but I can't install the latest gapps (even the pico version) due to lack of space in the partition.

Assuming you followed the steps and actually completed the (re)partition part.

You now have an 1.5G system partition and this will never change unless you manually partition the device again.

This is different than resizing an image.

If the rom installer does not include automatic resizing, you will be left with only the size the rom was built for. If it was built for a 1G system then, you will only have 1G available to use, .

Do a complete clean flash. (This will erase everything on the device.)
TWRP-> Advanced-> Wipe-> Format (Type Yes) enter.
TWRP-> Advanced-> Wipe-> Check all and Swipe to wipe
Reboot Recovery


Then install the rom
Mount system (either using TWRP or the command below.)
Check the size (use th df command below.)
- If you have 1.5G system then you are maxed out on space do to the rom.
- If you show 1G system size, then you need to expand the image to fill the partition.

To expand the system image, you can try using TWRP
Wipe-> Advanced Wipe-> (select System) Repair or Change File System-> Resize File System

This never worked well for me on hammerhead so, I also included the command below
System needs to be unmounted to run resize2fs

Good luck.

Can someone please help this member writing about lack of space in a repartition thread?
Edit: Apparently not...
So, the first and most obvious glaring question - have you repartitioned your Nexus 5?
Edit: After four days, nothing. Yet again. Yet another occasion where I try to help a junior member, to receive only silence. I am disinclined to bother any more.

Sorry, some of us do not follow older/onetime use threads that well. :(
Just a suggestion, you could have mentioned 2020suite in your edit just incase he/she gave up on a repose from this thread and wasn't watching it.

No criticism.
As a community (we could do better) should still try to help others.

We were all juniors once. Thankfully it was a little different when I was and when I used the search function, I did not get overwhelmed by the same question being asked and repeated responses of use search. Either it was ignored, answered or pointed to a post the guided to the answer. (Now I hate searching on xda, the results in some threads are highly polluted.)

Please do not give up on helping, even if it's a little bit when you can.
Keep up the good fight :D

Can you please help me? i repartitioned but it broke my partition table i suppose because everything showed 0MB in TWRP and when wiping it said "failed to mount '/everything' (Invalid argument)" when i tried to partition it to stock it spilled out some errors and when i tried again it said "This is not Nexus 5"

Did you format the partitions ?

TWRP-> Wipe-> Format Data (type yes) and tap enter
TWRP-> Wipe-> Advanced Wipe (Select all) Swipe to Wipe
TWRP-> Reboot-> Recovery


This is for someone who flash factory image and get stuck.

I did flashing factory image, and I got stuck on the boot.
I could still get into bootloader, so flashed twrp and install other roms but still stuck.

after that, I found this thread and... I found way to recover it.

Have to go through repartition again. this time, it asks revert back to stock.
and then, do it again to modify partition.
after flash twrp, it shows vendor partition error. dont worry. after wipe(format) it, it will be gone.

then, you can install any rom you like, and.. my ancient N5 is back!

If you use fastboot to flash the images manually (boot, system, recovery) you can along as you wipe everything first and then wipe cache and data/factory reset in recovery and reboot.

It will not change anything as far as partitions but, you can run the last factory image this way if you want.

Hello, hope there are still some active members who can help someone like me.

I followed the instruction strictly but when I execute the zip I get the output:
Can not extract updater-script. Do you have it in package?
Updating partition details...
Failed to mount '/vendor' (Invalid argument)
...done


I never reach the "Type something into your terminal part" .

Now I get the mount error every time I try to do something in recovery but that doesn't seem to have any effect I was able to get my system back running by loading a backup. I tried to fix the mount error by "formatting data" and wiping everything. Didn't work.

I am just copying the files from my PC to my phone and execute them with TWRP. So I don't get why a file should be missing. My Google/XDA search wasn't really successful so maybe someone of you encountered similar problems and can help with the mount error or the missing updater-script. Thanks.

I assume you are using twrp-3.3.1-1_UA-hh
The vendor mount error is because without running the script to actually partition the device, you do not have a separate vendor partition.

If you use the regular TWRP and Format then wipe everything, do you still get an error?

I've done it three times now.
Factory to modified | Modified back to stock | Stock back to modified

I do not remember how I did it originally.
Might have pushed the zip to /tmp or /sideload and then used TWRP to install from there.

The last two times I just used adb sideload to run the zip and then TWRP-> Advanced-> Terminal (type the key word) to continue the dark magic.

I did it with the regular TWRP.
Don't need the vendor partition yet so, I'm not that worried about formatting and mounting it.


--------

A few commands.
Noted using adb shell.
If used in TWRP Terminal, ignore the adb shell part.


Mount system
adb shell sbin/mount system

Display file size (a=all mounted h=human readable)
adb shell df -ah

Unmount system
adb shell umount system

Resize system image on Nexus 5 Hammerhead
adb shell resize2fs -f /dev/block/mmcblk0p25

A few links that may help/explain.

The regular official TWRP.
Nexus 5 (Hammerhead) twrp.me - Link

adb/fastboot [Part of platform-tool]
SDK Platform Tools developer.android - Link

Post I made in a different thread that includes a quick explanation of partitioning and resizing images.
xdaThread [ROM][flo|deb][UNOFFICIAL][AospExtended-v7.0] - Link

Cheers all. :cowboy:
 

dahawthorne

Senior Member
Nov 15, 2014
1,993
1,838
Brighton
Thanks, @ipdev. You're a lot more patient than I am. :)
"Just a suggestion, you could have mentioned 2020suite in your edit just incase he/she gave up on a repose from this thread and wasn't watching it.
No criticism.
As a community (we could do better) should still try to help others.
"
No offence taken. I didn't mention the questioner because when I ask a question I'm keen to know the answer and do keep an eye open for an answer.
I'm very happy to share what little I know, but there are too many new users who have the millennial attitude of "Give it to me, free, now!" and I find that attitude rather tiresome.
 
  • Like
Reactions: ipdev

MFritzN

New member
Apr 2, 2020
2
1
I assume you are using twrp-3.3.1-1_UA-hh
The vendor mount error is because without running the script to actually partition the device, you do not have a separate vendor partition.

If you use the regular TWRP and Format then wipe everything, do you still get an error?

I've done it three times now.
Factory to modified | Modified back to stock | Stock back to modified

I do not remember how I did it originally.
Might have pushed the zip to /tmp or /sideload and then used TWRP to install from there.

The last two times I just used adb sideload to run the zip and then TWRP-> Advanced-> Terminal (type the key word) to continue the dark magic.

I did it with the regular TWRP.
Don't need the vendor partition yet so, I'm not that worried about formatting and mounting it.

Everything worked with the official TWRP. I should've read the instruction more carefully. The Script is meant to be installed with the official TWRP...

Thank you wouldn't have found the mistake without you.
 
  • Like
Reactions: ipdev

blairfancy

Senior Member
Jul 8, 2011
55
16
Hi,
I m actualy with twrp 2GO and would like to return to stock. I have tried clamor-repartition procedure but i got error "This is not a Nexus 5"
can someone help me to restore stock partitioning?
regards
 

krazyko

Member
Dec 11, 2015
14
1
Vancouver
No Bluetooth MAC address

Repartition pack should be safe for most devices. Common mistakes, issues and their solution will be published here.

5. To backup persist partition you need PC with installed adb. Boot your hammerhead in TWRP and plug to PC. Than use next commands.
Code:
adb root
adb shell
dd if=/dev/block/mmcblk0p16 of=/sdcard/persist.img
Than copy .img file from root of internal storage to your PC. Although, script doesn't affect that area, backup of this partition may help in case of any problems with mac address etc.

Hi. I have made a backup of the persist.img file on my computer but how do I get the Bluetooth MAC address back on my phone? If I go back to the Stock ROM my Bluetooth is fine but once I get to Android 10 I have no
Bluetooth address. I've checked with the developers and maintainers of the Android 10 ROMs and they all say the Bluetooth works fine on their ROMs. Mine keeps crashing. I'm guessing that is because I have no Bluetooth MAC address. Please help.

Thank you.
 

z3DD3r

Senior Member
Feb 9, 2016
255
1,386
Minsk
Google Nexus 5
OnePlus 9R
@krazyko,
This is not a problem of repartition. Some roms are generating a random BT MAC address if original is missed or can not be read.

First of all check that file /persist/bluetooth/.bdaddr exists and size of this file is 6 bytes.
Then try to restore valid permissions. U need root and terminal. Switch off bluetooth if u can and type next commands one by one in terminal:
Code:
su
chown bluetooth.system /persist/bluetooth
chown bluetooth.system /persist/bluetooth/.bdaddr
chown wifi.system /persist/wifi
chown wifi.system /persist/wifi/.macaddr

After that reboot your phone and check bluetooth once again.
 
  • Like
Reactions: krazyko

krazyko

Member
Dec 11, 2015
14
1
Vancouver
@krazyko if you have bt mac in some roms and do not have in other on same partititon layout, than it is rom related problem, not partition.

OK. Thank you. I'll continue to try different ROMs then.

---------- Post added at 06:31 PM ---------- Previous post was at 06:09 PM ----------

@krazyko,
This is not a problem of repartition. Some roms are generating a random BT MAC address if original is missed or can not be read.

First of all check that file /persist/bluetooth/.bdaddr exists and size of this file is 6 bytes.
Then try to restore valid permissions. U need root and terminal. Switch off bluetooth if u can and type next commands one by one in terminal:
Code:
su
chown bluetooth.system /persist/bluetooth
chown bluetooth.system /persist/bluetooth/.bdaddr
chown wifi.system /persist/wifi
chown wifi.system /persist/wifi/.macaddr

After that reboot your phone and check bluetooth once again.

Hello z3DD3r. My /persist directory is empty. I guess this could be the root of my problem. How do i go about restoring the backup file from my PC?

Thank you.

Edit: Aaargh! I ran the restore command (hung my phone - waited 30 minutes) and now I don't even have a /persist directory. I think my backup didn't work correctly. I guess I'll have to start back at square one. Restore my phone to the original factory image and try again or is there something else I can do?
 
Last edited:

krazyko

Member
Dec 11, 2015
14
1
Vancouver
@krazyko,
This is not a problem of repartition. Some roms are generating a random BT MAC address if original is missed or can not be read.

First of all check that file /persist/bluetooth/.bdaddr exists and size of this file is 6 bytes.
Then try to restore valid permissions. U need root and terminal. Switch off bluetooth if u can and type next commands one by one in terminal:
Code:
su
chown bluetooth.system /persist/bluetooth
chown bluetooth.system /persist/bluetooth/.bdaddr
chown wifi.system /persist/wifi
chown wifi.system /persist/wifi/.macaddr

After that reboot your phone and check bluetooth once again.

Hi @z3DD3r,
I set my phone back to stock and then started the whole process over again. When I was back at stock there was no bluetooth or wifi folders. Is there a way to get these files from somewhere or create them when I'm back at stock?
 

petersaints

Senior Member
Mar 31, 2012
51
20

5. To backup persist partition you need PC with installed adb. Boot your hammerhead in TWRP and plug to PC. Than use next commands.
Code:
adb root
adb shell
dd if=/dev/block/mmcblk0p16 of=/sdcard/persist.img
Than copy .img file from root of internal storage to your PC. Although, script doesn't affect that area, backup of this partition may help in case of any problems with mac address etc.

These are the steps to backup /persist just in case, right? How would I restore it later if needed?
 

ipdev

Recognized Contributor
Feb 14, 2016
1,619
1
2,176
Google Nexus 10
Nexus 7 (2013)
These are the steps to backup /persist just in case, right? How would I restore it later if needed?
Same command.
dd if=A of=B
If A exists B becomes a duplicate of A.

So using the example, to restore it would be.
dd if=/sdcard/persist.img of=/dev/block/mmcblk0p16

Keep in mind there are steps in between.
As noted, you need to copy the image created from the (dump) backup to your computer.
adb pull /sdcard/persist.img for safe keeping.

If you need to restore it later you will most likely have to copy it back to the device.
adb push persist.img /sdcard/

Also it's good practice to name your files clearly.
For example, I use n[Nexus] 5[model] so, mine is named n5-persist.img

Getting slightly OT for this thread but, since backing up critical partition(s) is good practice when (re)partitioning a device.
[GUIDE] Making Dump Files Out of Android Device Partitions xdaThread - Link

Hope it helps.

Cheers all. :cowboy:
 

AayushJ25

Member
Nov 17, 2016
6
0
Vendor error

I'm getting unable to load/locate /vendor. I guess I did something wrong. How can I fix this? Is this even fixable issue?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 54
    Nexus 5 Repartition​

    No one is responsible for your actions except yourself. Everything written further may potentially brick your device, although risk is reduced to minimum.

    This repartition package offers 1.5G /system; a /vendor partition and it is fully backward compatible with any ROM (including stock system.img).

    Known-issues
    HTML:
    - If repartition pack says that device isn't correct,
    than, if partition table wasn't modified before,
    congrats! your device has different memory chip
    that those I worked with. No worry, PM me and
    I'll add support for it.

    DO THE BACKUPs. Repartition will erase all your data
    USB connection to PC is MANDATORY else you will not have opportunity to push ROM to your device


    Installation

    HTML:
    # Before processing further we highly recommend you backup persist using terminal and dd comand and EFS
    # Or you might lose your IMEI/WIFI + BT mac addresses
    
    # This mod is backwards compatible with any ROM so we highly recommend NOT to reverse it if repartition went well.
    # You should use ONLY recovery from this thread since other don't support all benefits of this mod.
    # When installing ROM just after you flashed zip and before installing GAPPs you MUST make a resize in TWRP since all roms are build for ~1G system.
    # To restore stock layout use same zip and steps as for repartition.
    
    1. Boot into recovery (You need to allow system partition modification to be able resize /system in recovery).
    2. Backup your data & Move your files from flash to your PC.
    3. Flash repartition pack zip.
    4. Do the actions asked by repartition pack (go to Terminal in ordinary recovery and input word that pack will tell you. Everything else will be done automatically).
    5. Phone will reboot into recovery.
    6. Install TWRP from below (it is build with support of new partitions layout and sizes. It can be differed from official TWRP by next format 3.x.x-1 UA).
    7. Format everything. (mount errors will not affect formatting!)
        - In TWRP: Wipe > Format data
        - Type yes
        - Once this completes go to: Wipe > Advanced Wipe
        - Tick all the boxes and wipe. There should be no further mount errors.
    8. Install ROM which you like.
    9. Enjoy better flash partition layout.

    If something gone wrong - we recommend you NOT to do anything by yourself. Write here for help, else you may do only worse.

    Downloads:
    Repartitioning package
    : GitHub

    Credits:
    Special thanks to
    - Unlegacy-Android team;
    - Sudokamikaze;
    - surfrock66 for his gide for Nexus 5;

    As usual, feedback is appreciated :)

    XDA:DevDB Information
    Nexus 5 Repartition, Tool/Utility for the Google Nexus 5

    Contributors
    Clamor
    Source Code: https://github.com/clamor95/android_device_unlegacy_recovery


    Version Information
    Status:
    Stable

    Created 2018-09-19
    Last Updated 2019-01-18
    13
    Common issues and F. A. Q.

    Repartition pack should be safe for most devices. Common mistakes, issues and their solution will be published here.

    1. You shouldn't flash any internal parts of repartition pack (*.sh files) only flash whole zip using TWRP. You may use my scripts for personal use or projects but authorship should to be kept.

    2. If something isn't mounting after repartition try to format partitions that don't mount using Wipe -> Advanced Wipe in TWPR. Ideally you should format in that way all partitions in Advanced Wipe menu (see 5-th step of installation guide).

    3. To be sure that repartition went well I enclose loging zip. Flash it after repartition (when device reboots into TWRP). It won't modify anything only generates a partition.log in root of internal storage and outputs your current partition layout to screen. You shoud check if your layout is same as those fragments I provide under spoiler (file systems doesn't matter). If there are any differences you have to discribe what you did and enclose partition.log to your post.

    HAMMERHEAD STOCK
    Code:
    25      192937984B    1266679807B   1073741824B                system
    26      1266679808B   1298137087B   31457280B                  crypto
    27      1298137088B   2032140287B   734003200B                 cache

    HAMMERHEAD MODIFIED
    Code:
    25      192937984B    1803551231B   1610613248B                system
    26      1803551232B   2065695231B   262144000B                 vendor
    27      2065695232B   2097152511B   31457280B                  crypto
    28      2097152512B   2306867711B   209715200B                 cache
    4. Flashable resize zip for ROMs that support addon.d (automatic resize when dirty flashing updates).

    5. To backup persist partition you need PC with installed adb. Boot your hammerhead in TWRP and plug to PC. Than use next commands.
    Code:
    adb root
    adb shell
    dd if=/dev/block/mmcblk0p16 of=/sdcard/persist.img
    Than copy .img file from root of internal storage to your PC. Although, script doesn't affect that area, backup of this partition may help in case of any problems with mac address etc.
    12
    3.3.1-1 UA TWRP is already available in download section.
    10
    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.
    4
    I do hope someone can still help me. I have installed android 10 to my nexus 5 but I can't install the latest gapps (even the pico version) due to lack of space in the partition.

    Assuming you followed the steps and actually completed the (re)partition part.

    You now have an 1.5G system partition and this will never change unless you manually partition the device again.

    This is different than resizing an image.

    If the rom installer does not include automatic resizing, you will be left with only the size the rom was built for. If it was built for a 1G system then, you will only have 1G available to use, .

    Do a complete clean flash. (This will erase everything on the device.)
    TWRP-> Advanced-> Wipe-> Format (Type Yes) enter.
    TWRP-> Advanced-> Wipe-> Check all and Swipe to wipe
    Reboot Recovery


    Then install the rom
    Mount system (either using TWRP or the command below.)
    Check the size (use th df command below.)
    - If you have 1.5G system then you are maxed out on space do to the rom.
    - If you show 1G system size, then you need to expand the image to fill the partition.

    To expand the system image, you can try using TWRP
    Wipe-> Advanced Wipe-> (select System) Repair or Change File System-> Resize File System

    This never worked well for me on hammerhead so, I also included the command below
    System needs to be unmounted to run resize2fs

    Good luck.

    Can someone please help this member writing about lack of space in a repartition thread?
    Edit: Apparently not...
    So, the first and most obvious glaring question - have you repartitioned your Nexus 5?
    Edit: After four days, nothing. Yet again. Yet another occasion where I try to help a junior member, to receive only silence. I am disinclined to bother any more.

    Sorry, some of us do not follow older/onetime use threads that well. :(
    Just a suggestion, you could have mentioned 2020suite in your edit just incase he/she gave up on a repose from this thread and wasn't watching it.

    No criticism.
    As a community (we could do better) should still try to help others.

    We were all juniors once. Thankfully it was a little different when I was and when I used the search function, I did not get overwhelmed by the same question being asked and repeated responses of use search. Either it was ignored, answered or pointed to a post the guided to the answer. (Now I hate searching on xda, the results in some threads are highly polluted.)

    Please do not give up on helping, even if it's a little bit when you can.
    Keep up the good fight :D

    Can you please help me? i repartitioned but it broke my partition table i suppose because everything showed 0MB in TWRP and when wiping it said "failed to mount '/everything' (Invalid argument)" when i tried to partition it to stock it spilled out some errors and when i tried again it said "This is not Nexus 5"

    Did you format the partitions ?

    TWRP-> Wipe-> Format Data (type yes) and tap enter
    TWRP-> Wipe-> Advanced Wipe (Select all) Swipe to Wipe
    TWRP-> Reboot-> Recovery


    This is for someone who flash factory image and get stuck.

    I did flashing factory image, and I got stuck on the boot.
    I could still get into bootloader, so flashed twrp and install other roms but still stuck.

    after that, I found this thread and... I found way to recover it.

    Have to go through repartition again. this time, it asks revert back to stock.
    and then, do it again to modify partition.
    after flash twrp, it shows vendor partition error. dont worry. after wipe(format) it, it will be gone.

    then, you can install any rom you like, and.. my ancient N5 is back!

    If you use fastboot to flash the images manually (boot, system, recovery) you can along as you wipe everything first and then wipe cache and data/factory reset in recovery and reboot.

    It will not change anything as far as partitions but, you can run the last factory image this way if you want.

    Hello, hope there are still some active members who can help someone like me.

    I followed the instruction strictly but when I execute the zip I get the output:
    Can not extract updater-script. Do you have it in package?
    Updating partition details...
    Failed to mount '/vendor' (Invalid argument)
    ...done


    I never reach the "Type something into your terminal part" .

    Now I get the mount error every time I try to do something in recovery but that doesn't seem to have any effect I was able to get my system back running by loading a backup. I tried to fix the mount error by "formatting data" and wiping everything. Didn't work.

    I am just copying the files from my PC to my phone and execute them with TWRP. So I don't get why a file should be missing. My Google/XDA search wasn't really successful so maybe someone of you encountered similar problems and can help with the mount error or the missing updater-script. Thanks.

    I assume you are using twrp-3.3.1-1_UA-hh
    The vendor mount error is because without running the script to actually partition the device, you do not have a separate vendor partition.

    If you use the regular TWRP and Format then wipe everything, do you still get an error?

    I've done it three times now.
    Factory to modified | Modified back to stock | Stock back to modified

    I do not remember how I did it originally.
    Might have pushed the zip to /tmp or /sideload and then used TWRP to install from there.

    The last two times I just used adb sideload to run the zip and then TWRP-> Advanced-> Terminal (type the key word) to continue the dark magic.

    I did it with the regular TWRP.
    Don't need the vendor partition yet so, I'm not that worried about formatting and mounting it.


    --------

    A few commands.
    Noted using adb shell.
    If used in TWRP Terminal, ignore the adb shell part.


    Mount system
    adb shell sbin/mount system

    Display file size (a=all mounted h=human readable)
    adb shell df -ah

    Unmount system
    adb shell umount system

    Resize system image on Nexus 5 Hammerhead
    adb shell resize2fs -f /dev/block/mmcblk0p25

    A few links that may help/explain.

    The regular official TWRP.
    Nexus 5 (Hammerhead) twrp.me - Link

    adb/fastboot [Part of platform-tool]
    SDK Platform Tools developer.android - Link

    Post I made in a different thread that includes a quick explanation of partitioning and resizing images.
    xdaThread [ROM][flo|deb][UNOFFICIAL][AospExtended-v7.0] - Link

    Cheers all. :cowboy: