[REPARTITION] Nexus 4 Repartition [MAKO] [8GB/16GB] [UA TWRP]

Search This thread

Clamor

Senior Member
Sep 4, 2013
388
687
Львів
Nvidia Tegra Note 7
Nexus 4 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 to use our TWRP which has support of EFS/Persist backup
# 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 ~800M 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 using this guide to restore your phone back

Downloads:
Repartitioning package
: GitHub

Credits:
Special thanks to
- Unlegacy-Android team;
- Sudokamikaze;
- ddaggebi for 8GB model layout;
- surfrock66 for his gide for Nexus 5;

As usual, feedback is appreciated :)

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

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


Version Information
Status:
Stable

Created 2018-09-19
Last Updated 2019-01-18
 
Last edited:

Clamor

Senior Member
Sep 4, 2013
388
687
Львів
Nvidia Tegra Note 7
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.

MAKO STOCK
Code:
21      159383552B    1040187391B   880803840B                 system
22      1040187392B   1627389951B   587202560B                 cache

MAKO MODIFIED
Code:
21      159383552B    1732247551B   1572864000B                system
22      1732247552B   1994391551B   262144000B                 vendor
23      1994391552B   2099249151B   104857600B                 cache
4. If you have touchscreen problems use common instructions till you reach entering word. Than plug your phone to PC while you remain in recovery. Enter adb shell from cmd (if you don't know how - google) and enter word that repartition pack asked. Than your phone will reboot automatically into your old TWRP but with new partition layout.

5. Flashable resize zip for ROMs that support addon.d (automatic resize when dirty flashing updates).
 
Last edited:

bgoel4132

Senior Member
actually the lower left corner of my phone screen doesnt work so can you please elaborate what kind of commands are we used to use and terminal and is there any other way to access terminal

mine q,a,z,1 these key are inaccessible in twrp as screen rotation is not supported
 

Clamor

Senior Member
Sep 4, 2013
388
687
Львів
Nvidia Tegra Note 7
actually the lower left corner of my phone screen doesnt work so can you please elaborate what kind of commands are we used to use and terminal and is there any other way to access terminal

mine q,a,z,1 these key are inaccessible in twrp as screen rotation is not supported

Plug your phone to PC while you remain in recovery. Enter adb shell from cmd (if you don't know how - google) and enter word that repartition pack asked. Than your phone will reboot automatically into your old TWRP but with new partition layout.
 
Last edited:

Nathan4923

Senior Member
Apr 25, 2015
108
13
Clinton Twp
OnePlus 8 Pro
OK so my nexus 4 can't transfer files to or from PC at all so if I do this and have the ROM downloaded it will wipe the ROM and the ROM would be gone and my phone would be a nice brick because I can't transfer any files to my PC like it charges with the PC but data transfer doesn't work so again would I be screwed?
 

Mato_xXx

Member
Apr 25, 2012
32
2
Nove Mesto nad Vahom
Hello ho can I do ,,resize /system with TWRP after ROM,,??? I can't find how to do that...
I installed your TWRP > backup > repartition zip > format all partitions > ROM
And now I'm stuck because I can't flash GAPPS...
 

bgoel4132

Senior Member
Hello ho can I do ,,resize /system with TWRP after ROM,,??? I can't find how to do that...
I installed your TWRP > backup > repartition zip > format all partitions > ROM
And now I'm stuck because I can't flash GAPPS...
just read the OP carefully it already mentioned that you had to resize system after installing rom
you can do that by going to advanced wipe in twrp
 

Top Liked Posts

  • There are no posts matching your filters.
  • 44
    Nexus 4 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 to use our TWRP which has support of EFS/Persist backup
    # 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 ~800M 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 using this guide to restore your phone back

    Downloads:
    Repartitioning package
    : GitHub

    Credits:
    Special thanks to
    - Unlegacy-Android team;
    - Sudokamikaze;
    - ddaggebi for 8GB model layout;
    - surfrock66 for his gide for Nexus 5;

    As usual, feedback is appreciated :)

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

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


    Version Information
    Status:
    Stable

    Created 2018-09-19
    Last Updated 2019-01-18
    8
    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.

    MAKO STOCK
    Code:
    21      159383552B    1040187391B   880803840B                 system
    22      1040187392B   1627389951B   587202560B                 cache

    MAKO MODIFIED
    Code:
    21      159383552B    1732247551B   1572864000B                system
    22      1732247552B   1994391551B   262144000B                 vendor
    23      1994391552B   2099249151B   104857600B                 cache
    4. If you have touchscreen problems use common instructions till you reach entering word. Than plug your phone to PC while you remain in recovery. Enter adb shell from cmd (if you don't know how - google) and enter word that repartition pack asked. Than your phone will reboot automatically into your old TWRP but with new partition layout.

    5. Flashable resize zip for ROMs that support addon.d (automatic resize when dirty flashing updates).
    5
    For those who downloaded repartition pack before this message is published, please redownload pack since previous version might have a problems with repartition. If repartition was already made, don't worry everything should be fine. Just use up-to-date pack.
    4
    @jluspo resize /system with TWRP after ROM install before GAPPs because ROMs are designed to use ~800MB system.

    @cqloveqc you had to format all partitions available in advanced wipe after repartition.
    4
    @bgoel4132 @rhmt1210 @Akhilesh S V first of all flashing factory img won't return stock partition table as it doesn't have one included, ONLY my repartition pack has capability to return stock layout (if you don't know how to work with parted of course). Second is that factory img can't be flashed as is, BUT as a img collection it can be flashed with fastboot (excluding cache and data since they won't flash anyway).