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

Search This thread

froilson

Senior Member
Dec 14, 2007
59
157
OnePlus 7 Pro
@froilson resize once more, if fails, change mounting state of system and try once more

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.
 
Last edited:

vikaseth

Senior Member
Mar 1, 2013
107
20
This is fixable! I was a noob and didn't resize my system partition after flashing rom. Flashed the hh repartition to go back to stock in the ua twrp and got a bunch of errors. Then flashed stock recovery and tried again. This is not a Nexus 5 popped up. The backup file is inside the flashable zip. I just used adb shell and parted to execute the commands listed in backup and viola my Nexus 5 is back. So those freaking out that they messed up their phone...don't worry it's fixable just listen to Clamor. Anyone can pm me too if you need help.

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
 

vikaseth

Senior Member
Mar 1, 2013
107
20

Attachments

  • partition.log
    2 KB · Views: 67
  • IMG_20180926_164326.jpg
    IMG_20180926_164326.jpg
    246.6 KB · Views: 994
  • IMG_20180926_164340.jpg
    IMG_20180926_164340.jpg
    241.9 KB · Views: 971
  • IMG_20180926_164346.jpg
    IMG_20180926_164346.jpg
    243.7 KB · Views: 960
Last edited:

Shotg1

Senior Member
Apr 25, 2016
861
106
Manila
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 ----------

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 The unified resize partition?
 

kg2811

Member
Oct 24, 2013
28
11
Gdansk
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.
 

kraehetest

Senior Member
Jan 26, 2009
140
56
Erfurt
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
 

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: