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

Search This thread

finaluser

Member
Jan 21, 2010
9
0
Thank you very much to all the work for this incredible ROM, it is installed and working much better than expected on my Nexus 4 8GB, now it is even faster than other firmwares. I'm so excited. Thank you!!
 

PsK2010

Member
May 21, 2010
12
3
Thank you very much Clamor! I just repartitionned my old Nexus 4 (on official Lollipop Stock Rom) to try LineageOS 16 GO Rom and everything works super smooth! :D
 
  • Like
Reactions: nitin.chobhe

Vegeta IV

Member
Sep 23, 2019
7
0
Hi guys and thank u for this work all working good but for now i need to install official google rom so is it safe? Or i need repack it somehow?
 

sellless

Member
Feb 22, 2012
22
2
Hi there,

I have an old Nexus 4 where the screen doesn't work along the right side of it so I can't press enter after I type modify.

I am trying to install a battery friendly rom before handing this off to an friend of mine but I can't becuase of the system partition size.

I tried "adb shell" but it wasn't working, though I can see my device.

I realize that this thread is quite old but I would really appreciate some help as the last offical stock build of Android for mako is the only one I can seem to get to work and we all know that isn't good enough.

Thanks to anyone that can help.
 
Hi there,

I have an old Nexus 4 where the screen doesn't work along the right side of it so I can't press enter after I type modify.

I am trying to install a battery friendly rom before handing this off to an friend of mine but I can't becuase of the system partition size.

I tried "adb shell" but it wasn't working, though I can see my device.

I realize that this thread is quite old but I would really appreciate some help as the last offical stock build of Android for mako is the only one I can seem to get to work and we all know that isn't good enough.

Thanks to anyone that can help.

Here we write about the repartition.
Just a hint, because I see that you do not have much interest in reading the forum
and you would like to have work done without any effort.

Trick with changing the TWRP graphical interface
 

Luis_Viera

New member
May 3, 2020
1
2
Modify the system partition Nexus 4 Mako 16 GB with Mako_clamor_repartition_zip

I want to thank you for the publication of this tutorial, I applied your instructions and followed them to the letter and finally, after several attempts, I managed to modify the system partition and updated my old but useful LG Google Nexus 4 E960 Mako 16 GB with OS Android 10 Lineage 17, the only problem I had was that the Terminal did not work for me and I could not execute the "modify" instruction but I connected the phone to my PC and using ADB and Fastboot I introduced the command "adb shell modify" and it automatically modified the system partition and I was able to flash the ROM and its GAPPS, thanks.
 

dj_s_021

Senior Member
Mar 24, 2011
124
5
tehran
please help please help me
I was the installation when I unfortunately encountered the following error:
Failed to mount '/vendor; ( invalid argument )
What should I do ??
Of course Despite this error I'm ROM and installed! Is it okay for the phone to crash over time?
How do I know if the REPARTITION is working properly?
 
Last edited:

coffee-coffee

New member
May 30, 2020
3
0
Decryption on Android 10 (CarbonRom)

Hey there,

thank you for the guide, all worked well. However, after encrypting my mako on Android 10 (CarbonRom), TWRP is not able to decrypt the data any more. Any thoughts on this? :confused:

Kind regards
coffee
 

llazcanoster

Member
Jun 8, 2018
8
0
Hello!!
I Have the same problem, I wanted to check if anyone has trouble decrypting the storage in TWRP, and if so, is it caused by the rom or by the recovery?

Thanks for the great work!
 
Hello!!
I Have the same problem, I wanted to check if anyone has trouble decrypting the storage in TWRP, and if so, is it caused by the rom or by the recovery?

Thanks for the great work!

Did you use twrp 3.4 for this?
Note! This version has an annoying restart error so you have to do it manually in the terminal, e.g.
twrp reboot recovery
 
  • Like
Reactions: nereis

thangcuoi

Senior Member
My Nexus 4 was running ASOP 6.0.1. In order to flash a more current rom, I needed to resize its partitions.

After flashing mako_clamor_repartition.zip in official TWRP 3.4, my Nexus 4 seems to have lost all partitions.

I managed to flash twrp-3.3.1-1_UA-mako.img after, but it's unable to mount any partition apart from Cache which it reports as zero byte. Trying to wipe/erase partitions does not work as it could not mount them.

When I try reflashing the stock rom, it reported that it can write to Boot and Recovery but not System partition.

I have also tried plugging in a micro usb drive, but TWRP won't mount it either.

Does anyone have any advice on how to rescue my Nexus 4?

Also, I managed to get back into TWRP one time. The rest of the time, it get stuck on the Google logo screen. Holding down Volumes + Power just restart the phone instead of going to the bootloader screen. Alternatively, it would shows the battery charging logo and my Windows computer would play the sound that it has detected a device.

https://photos.app.goo.gl/uaesEAVVwQ6RApaL9
 
Last edited:
My Nexus 4 was running ASOP 6.0.1. In order to flash a more current rom, I needed to resize its partitions.

After flashing mako_clamor_repartition.zip in official TWRP 3.4, my Nexus 4 seems to have lost all partitions.

I managed to flash twrp-3.3.1-1_UA-mako.img after, but it's unable to mount any partition apart from Cache which it reports as zero byte. Trying to wipe/erase partitions does not work as it could not mount them.

When I try reflashing the stock rom, it reported that it can write to Boot and Recovery but not System partition.

I have also tried plugging in a micro usb drive, but TWRP won't mount it either.

Does anyone have any advice on how to rescue my Nexus 4?

Also, I managed to get back into TWRP one time. The rest of the time, it get stuck on the Google logo screen. Holding down Volumes + Power just restart the phone instead of going to the bootloader screen. Alternatively, it would shows the battery charging logo and my Windows computer would play the sound that it has detected a device.

QRs5qDTuyMsEwM2x8


raYFAKMDh31fE1Sz5


3g5qore4B717L3oQ8



Links to your pictures can only be seen after trying to answer the post. What TWRP did you use to make the pictures?

What happens after using mako_clamor_repartition.zip in twrp-3.3.1-1_UA-mako?
 

thangcuoi

Senior Member
Links to your pictures can only be seen after trying to answer the post. What TWRP did you use to make the pictures?



What happens after using mako_clamor_repartition.zip in twrp-3.3.1-1_UA-mako?

https://photos.app.goo.gl/uaesEAVVwQ6RApaL9

I flashed the clamor repartition zip file with the official TWRP 3.4. At this point all partitions (except Cache) could not be mount or wipe. I managed to flash twrp-3.3.1-1_UA-mako to replace the 3.4 version from the computer but that did not help with being able to mount or wipe the partition.

Sent from my PH-1 using Tapatalk
 

LunkHead

New member
Nov 12, 2020
2
0
EDIT: And I'm an idiot and missed the format all partitions step. Leaving the rest of this post as a testament to my shame =)

I'm in the same boat with my 16GB Nexus. Ran the mako_clamor_partition, then went to the terminal and specified 'modify', and now the partitions on the device are in a wonky state.

When inspecting the partitions in twrp in the 'Advanced Wipe' menu, checking a partition, and hitting 'Repair or Change File System' these are the results:

/system is 1476MB
/vendor is 0MB
/data is 0MB
"internal storage" says "Invalid partition selected"
/cache is 98MB
"Dalvik/ART Cache" says "Invalid partition selected"

Because internal storage and data are 0/invalid copying files to the device isn't possible. There is no storage available/detected when connecting via USB to a PC.

I tried the method of unbricking the N4 from this thread:
https://xdaforums.com/nexus-4/general/tutorial-how-to-unbrick-n4-t2347060
However the LGNPST program does not detect the phone when connected in download mode.

Is there any way to restore the partition table from inside TWRP with no access to the internal device storage? It looks like fdisk is installed in /sbin (though running 'sbin/fdisk -ul' reutrns nothing?), does anyone have the proper commands to issue to get the partition table back to stock?

Also, if I attempt to copy the logs, this error is in the output:
'Failed to mount '/data' (Invalid argument)'

Any ideas how to get out of this state?

Thanks!
 
Last edited:
EDIT: And I'm an idiot and missed the format all partitions step. Leaving the rest of this post as a testament to my shame =)

I'm in the same boat with my 16GB Nexus. Ran the mako_clamor_partition, then went to the terminal and specified 'modify', and now the partitions on the device are in a wonky state.

When inspecting the partitions in twrp in the 'Advanced Wipe' menu, checking a partition, and hitting 'Repair or Change File System' these are the results:

/system is 1476MB
/vendor is 0MB
/data is 0MB
"internal storage" says "Invalid partition selected"
/cache is 98MB
"Dalvik/ART Cache" says "Invalid partition selected"

Because internal storage and data are 0/invalid copying files to the device isn't possible. There is no storage available/detected when connecting via USB to a PC.

I tried the method of unbricking the N4 from this thread:
https://xdaforums.com/nexus-4/general/tutorial-how-to-unbrick-n4-t2347060
However the LGNPST program does not detect the phone when connected in download mode.

Is there any way to restore the partition table from inside TWRP with no access to the internal device storage? It looks like fdisk is installed in /sbin (though running 'sbin/fdisk -ul' reutrns nothing?), does anyone have the proper commands to issue to get the partition table back to stock?

Also, if I attempt to copy the logs, this error is in the output:
'Failed to mount '/data' (Invalid argument)'

Any ideas how to get out of this state?

Thanks!

The easiest thing to do is to go back to stock rom and start all over again, but this time in the right way.

.
 

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).