yashsingh1/xdaforums huggingface dataset:
[Nexus 4 General] Sam Nakamura:
You decided to use the script on another phone, one which this script wasn't intended for, therefore you have accepted the risks involved and you're probably on your own now and actually shouldn't expect anyone to chime in and fix your mess, another member even warned you about it just before your attempt!

You should hope that the method to reverse the re-partition given in the first post works for you or at least gives you some pointers on where to start.

A better approach would have been to have a look at the script and to port it according to the partition table of your actual device... or if help is needed to discuss it in your device specific thread (a working solution to use bigger GApps on small /System partitions is the use of Magisk & a module called "Magic GApps", this way you're not "forced" to use other device's mods, if that's why you wanted to re-partition in first place)

This place however is not the right place to discuss your off topic request or to get support for a different device!
[Nexus 4 General] AbsoluteGhost:
messed up with partition

I have tried to increase my old nexus 4 partition. I have completed all instruction,But i could not flash any rom or zip.I think i have done mistake while trying to increasing partition.Can some one help me from this situation..??The problem is about when i tried to flash any zip it says cannot mount vendor and cannot mount cache.Sorry for my bad English.

[IMG="image 1"]https://drive.google.com/open?id=1ZmOC0m6wjQYodEGStSd0InBh1DSzCLx8[/IMG]

[IMG="image 2"]https://drive.google.com/open?id=1MJTDqvgksf7Z0knm041tV0q2KWPisWDC[/IMG]
[Nexus 4 General] bgoel4132:
Actually we can't see your screenshots

but i can confirm there is some issue with unable to mount vendor in the modified kernel if your repartition process went without any error go to bootloader and flash latest twrp.from twrp.site and then flash the rom.and resize the system it will not show any error of unable to mount vendor.
[Nexus 4 General] DNA2018995621:
I messed it up.

Hey. Worked for me to resize and install Lineage OS with GApps Aroma. Nice guide.

While changing the partition sizes back to stock I fat fingered a command and deleted partition 2 "sbl1". I recreated it and renamed it but obviously all the data contained in it is gone.

It's something to do with the bootloader I guess. My phone will no longer boot.

Any hope for me? Do I own a fancy paperweight now?

Any help would be appreciated.

Thanks.
[Nexus 4 General] DNA2018995621:
I was able to restore the bootloader using this guide:

https://xdaforums.com/nexus-4/general/solution-nexus-4-hard-brick-restore-t3274690

I then flashed the official Nexus 4 images back to stock, excepting the recovery partition so I can keep TWRP.

Hope this helps if someone screws up like I did.
[Nexus 4 General] prasoonvarshney:
Worked like a charm!

Thanks!
[Nexus 4 General] echan101:
Fix: Could not load library "libext2_quota.so"

During the format to EXT4, I got the following error:

CANNOT LINK EXECUTABLE: could not load library "libext2_quota.so" needed by "mke2fs"; caused by library "libext2_quota.so" not found

I fixed this by googling libext2_quota.so (I can't post the link here because I'm new).

https: //github. com/ Motorola-CyanogenMod/XT1521_vendor/blob/master/lib/libext2_quota.so[/url]

Then sent it to my Nexus 4:

adb push libext2_quota.so /sbin/

After this the mke2fs commands worked fine.
[Nexus 4 General] karsondang:
After changed the size of /system and /cache I'd changed the size of those to default and mount all partition ok but I can't flash ROM cuz TWRP said can't mount system. When checking with e2fsck it said super-block is not correct
[Nexus 4 General] belialmg:
I need your help, I'm a beginner. After the adb shell command does not do anything the command window
[Nexus 4 General] jumpifzero:
After adb shell you enter another shell, on your phone,. The commands given need to be typed in it.

Just wanted to say thanks to the OP for the clear guide! Worked fine for me as well :)
[Nexus 4 General] nAFutro:
1. Probably because mke2fs doesn't do ext2 properly. I got the error "Warning: the fs_type ext2 is not defined in mke2fs.conf" trying to format it with ext2. I'm not sure if anything got formatted or not. I rebooted to the bootloader and used "fastboot format system" to do a error free format.

2. The cache partition system isn't used anymore with Nougat so this shouldn't be a problem.
[Nexus 4 General] PojntFX:
/system/

First of all, thanks for the guide! Worked quite nicely!

With the newest TWRP version (3.3.1-0) I did however also have to

umount /system

for it to work.
[Nexus 4 General] tinynja98:
This worked perfectly for my Nexus 4, great guide, easy to follow and modify to my own taste!

I just have a question though, could there be problems related to the fact that the cache partition now only has 37MB? Thanks a lot!
[Nexus 4 General] tinynja98:
For some reason, after installing NitrogenOS, the df command (which is used by OpenGApps to check for system space) returned the original size of the system partition, rather than the new size of the system partition. I had to run these commands AFTER installing NitrogenOS to fix this...

To mount the system partition (it needs to be mounted for the df command to see it):

mount /system

To see the current size of the system partition:

df /system

This is what my Nexus 4 returns:

Filesystem	1K-blocks	Used	Available	Use%	Mounted on
/dev/block/mmcblk0p21
846632	644624	202008	76%	/system

To unmount the system partition (for the following commands to work):

umount /system

This checks some things about the partition:

e2fsck -f /dev/block/mmcblk0p21

This resizes the filesystem inside the /system partition:

resize2fs /dev/block/mmcblk0p21

Now remount the system partition:

mount /system

And we see that df shows the full size of the system partition:

df /system

This is what my Nexus 4 returns:

Filesystem	1K-blocks	Used	Available	Use%	Mounted on
/dev/block/mmcblk0p21
1238960	645064	593896	52%	/system

After running these commands, I could install Aroma GApps without any problem. I hope this could help someone out! :)
[Nexus 4 General] ghosalc01:
not working

hiya mate ive tried to unmount sdcard, cache and data but it says they are not found which is annoying if you could help out it would be much appreicatedView attachment 4813216
[Nexus 4 General] Richy0s:
After typing in ./parted /dev/block/mmcblk0 p i get "line 1: syntax error: unexpected "(" any help? think im screwed
[Nexus 4 General] munkeylabs:
Worked on my Nexus 10 manta for LineageOS 16 with open-gapps 9 pico (edit: also had a .gapps-config set up to basically only deploy the play store). Reduced cache to increase system by 150MB. All appears to work well. Many thanks!
[Nexus 4 General] sam10000:
Hi

I used the OP method to repartition my Nexus 4, with TWRP 3.3.1.

It was successful. However, it wasn't possible to install a new ROM due to Error: 7. Since the previous ROM was deleted, the phone is now in a bootloop, stuck on "Google".

UPDATE: I managed to enter TWRP after connected the phone to the computer.

Is WugFresh still usable to unbrick the phone, now that the partitions (system and cache) have been resized?

Thanks in advance.
[Nexus 4 General] ze7zez:
Since you have TWRP, you have full access to everything.

You are no longer using WugFresh.
[Nexus 4 General] cchaos:
Hi there,

I have a Nexus 4 16gb with SuperSU (v2.82) and TWRP 2.8.7.0 and Xposed Installer 3.0 alpha 4, and I'm looking to install this ROM: https://xdaforums.com/nexus-4/orig-development/7-x-x-carbonrom-cr-5-1-t3533873 which advises that I need to increase the system partition.

I can see other users in this thread have used newer TWRP recoveries than what I currently have.

Will I need to flash factory image etc or do I just need to flash latest TWRP to my phone before commencing?
[Nexus 4 General] nitin.chobhe:
It might work with just updating the twrp. But it's always better to start afresh to avoid any chances of messing with the phone.

Nitin
[Nexus 4 General] cchaos:
Right, so go fresh start. I'll probably do this tomorrow (need to fire up my Linux laptop and see what I have; pretty certain I have LMY48T already on it)

Ok, will I need root for recovery and partitioning work?

If so, any particular rooting method/software?
[Nexus 4 General] nitin.chobhe:
Everything is present in this general section - just search and follow instructions.

Nitin
[Nexus 4 General] cchaos:
Well, this guide doesn't say anything about needing root :fingers-crossed:

With what is needing to be done should "needs must", I suspect it needs root :confused:

Can someone please confirm if root is required or not?
[Nexus 4 General] TNSMANI:
I can understand the need for this question if you are unrooted. But you are already rooted and know how to root. So what is the harm/difficulty in proceeding with the assumption that root is needed?
[Nexus 4 General] cchaos:
You decide to post that when you have also seen:

I wouldn't of expected that kind of response from a "moderator" :rolleyes: I certainly wouldn't of replied with that in my days of being a moderator on a similar site to here.

Instead I would of been a little more clearer; it's obvious I need help, and quite frankly, that's not helpful to the person asking the question.

Also, I "know how to root"? I done that 2 to 3 YEARS ago MINIMUM (as mentioned in another topic if you bothered to read my recent posts). Do you SERIOUSLY expect me to remember how to root? As FYI from what I recall its: flash TWRP (or CM which came out first I seem to recall back in the day), reboot phone and make sure you boot into TWRP to make it "stick", reboot normally, then back into TWRP to then flash su.zip (is this still hosted anywhere, bearing in mind I suspect I need ChainFire's SuperSU since it will be Android 5.1.1? Point 2; not sure if Mako is Magisk compatible) to the phone. Reboot normally and volia: one rooted Mako with TWRP.

Apologies to nitin.chobhe for requoting them, but it illustrates my point, even though it is on the same page as where you have just quoted me. How you have missed that but questioning my question is beyond me :rolleyes:

Anyway, to answer your question:

To me "start afresh" means: factory image with no root and stock recovery.

The guide mentions nothing about root, and since I'm going to put a different ROM on it I would rather skip rooting if I don't have to since the battery in my Mako isn't as great as it once was (it starts dropping battery percentage from the moment I turn it on - most likely cos I don't keep it up to date as I have obvously have more phones since 2012 when I purchased it). Example it has been a week since I last looked at everything on it for typing up the posts I did, and the phone now won't turn on due to empty battery (despite being turned off all week). If I have a oportunity to "skip" a step I will take it.
[Nexus 4 General] namnoops:
I get the error:

./parted: line 1: syntax error: unexpected redirection

Definitely something related to the shell, but I can't figure out how to get around this. Can anyone help here?
[Nexus 4 General] ze7zez:
Change TWRP to another one. In twrp-3.3.1-1_UA-mako.img by [MENTION=5424240]Clamor[/MENTION], the command works correctly.
[Nexus 4 General] namnoops:
Thanks, but same result as with TWRP 3.3.1-1...
[Nexus 4 General] ze7zez:
In order not to drag on the discussion, just go back to stock rom and start all over again. It will be the easiest and fastest way.
[Nexus 4 General] namnoops:
I didn't see why that would make a difference but I went back to stock 5.1.1 (from Lineage android 8.1.0) and I'm still getting the same error when I try to invoke parted...
[Nexus 4 General] ze7zez:
Return to stock (How to flash a factory image / return to stock...) causes total reconstruction of partitions and errors or entries on them. This is not possible with the help of TWRP.

Describe exactly what you do along with the results of the action, maybe someone will see something special.

The parted file has md5sum = 7755afef1c88cf006dc274e125c6bbf7
[Nexus 4 General] namnoops:
That was the issue. I don't know what made my browser save the file wrong. First opening it and then saving it resulted in the correct md5sum. Thanks for the tip! All worked out in the end!
[Nexus 4 General] blackmonk19:
Thank a lot [MENTION=4550123]bmg1001[/MENTION] for the detailed guide .... Everything worked well all the way till Step 12 in your guide... :D

However I ran into an issue when booting into the ROM... But thank you [MENTION=1625514]caliban2[/MENTION] for linking [MENTION=5042498]JekaPinsk[/MENTION] steps, as this worked! :good:

Thanks again guys for the amazing work, God bless! :highfive:
[Nexus 4 General] Willthor:
Brilliant, just started reviving my Nexus 10 and this just saved me!

Now I can run LineageOS17 with no problems :)
[Nexus 4 General] Gibson295:
will this work with Clockword recover mod v6.0 cause thats what i have ;o

I keep receiving an error when trying to do the step

./parted /dev/block/mmcblk0 p

it just gives me ./parted: line 1: syntax error: unexpected "("

~ #

no clue what to do here next.

Nexus 4
[Nexus 4 General] soor-si:
I couldn't find an answer on the forum, so I hope someone can help me with something...

I have increased the system partition on my Nexus 4 16Gb, but now I would like to flash an Ubuntu Touch ROM, but I can't.

The problem is that the partition size has to be like it was. How to make the reverse procedure, to get old partition sizes back?
[Nexus 4 General] simodepa97:
I used this guide to recreate system and data partition after they were accidentally canceled by a script. Only thing that doesn't work is mounting the new partitions, because there are no such /system nor /data directories. So I tried to create them but there's a conflict with /system and /data files that are already in place. What to do? Thanks.
[Nexus 4 General] derern:
Hi all,

tried to breathe some new life into my N4 which required the repartition. N4 sports TWRP 3.4.0-0. Managed to work along the script just fine and also can see that the GPT seems to be fine afterwards indicating the intended sizes and names for /system and /cache.

Trouble now is that I can't mount /system anymore - neither in shell nor in TWRP (after a restart as well).

Any ideas what could be the culprit here?

Edit: Okay, this is rather embarassing. Turns out I didn't restart TWRP properly after the process. Classic "Did you try to switch it off and on again did it"

Maybe for anybody else to avoid the culprit: If you click on Reboot --> Recovery in TWRP and are instantly greeted with the TWRP homescreen, it didn't restart. Forcing a shutdown via Power and then going to TWRP helped for me.
[Nexus 4 General] Luihart:
I have the same Problem. It cant mount system. I cant wipe anything, even restore failed. Need Help. How can I Reset it now? In ADB Shell it still Shows ext4 21 System with 880mb
[Nexus 4 General] Tractor555:
@Luihart and @derern I had a similar problem with my N4 (I increased the partition size as per the instructions on the first page, and was able to install Lineage OS17.1 and Gapps OK. However the phone was really unstable and the System UI kept crashing) so I reverted the N4 to how it was. I basically revered the key resizing steps on the first page restoring the size and format of partitions 21 and 22. That seemed OK (with plenty of cache & data wipes and reboots). However, I was still having problems with running the stock OS or UBPorts. I then stumbled on a post which mentioned that the reformat to ext2 of the parted tool used on this instructionisn't very good so the N4 needs to have this redone using fastboot format system .Note that this also initially failed (connected on Linux computer) until I replaced the android-developer-tools form Ubuntu repository with the ones downloaded from https://developer.android.com/studio/releases/platform-tools. There is hope to restore Nexus 4 to how it was and my phone is now happily running UBPorts Touch again.
[Nexus 4 General] Malk4ever:
Thank you very much!

This is exactly what I was looking for, and it worked like a charm. Still I need to use nano GAPPS on Lineage 17.1, but without change i wasnt able to install it at all (not even when excluding most things).
[Nexus 4 General] Makxie:
Hi, everything worked fine but after flashing Lineage 17.1 and rebooting to system it takes me back to recovery. Even when selecting reboot to system it just restarts TRWP. Any ideas why?

update: nvm, switch it off with the power button and booted up instantly.

thank you thank you thank you thank you thank you thank you you're a Nexus god
[Nexus 4 General] Zelych:
Hi, i have problem, lost internal storage on position 23

~ # ←[6nchmod +x parted
chmod +x parted
~ # ←[6n./parted /dev/block/mmcblk0 p
./parted /dev/block/mmcblk0 p
Model: MMC 016G92 (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext4 system
22 1040MB 1627MB 587MB ext4 cache
27 2099MB 15.8GB 13.7GB
24 15.8GB 15.8GB 524kB DDR
25 15.8GB 15.8GB 507kB grow

~ # ←[6n

EDIT:

After trying to solve the problem, I came to the conclusion that I was missing section 23 completely! :-(

Can someone please advise me how to recover partitions?

~ # ←[6nchmod +x parted
chmod +x parted
~ # ←[6n./parted /dev/block/mmcblk0 p
./parted /dev/block/mmcblk0 p
Model: MMC 016G92 (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt

Number Start End Size File system Name Flags
1 524kB 67.6MB 67.1MB fat16 modem
2 67.6MB 68.2MB 524kB sbl1
3 68.2MB 68.7MB 524kB sbl2
4 68.7MB 70.8MB 2097kB sbl3
5 70.8MB 71.3MB 524kB tz
6 71.3MB 94.4MB 23.1MB boot
7 94.4MB 117MB 23.1MB recovery
8 117MB 118MB 799kB m9kefs1
9 118MB 119MB 799kB m9kefs2
10 119MB 120MB 799kB m9kefs3
11 120MB 121MB 524kB rpm
12 121MB 121MB 524kB aboot
13 121MB 122MB 524kB sbl2b
14 122MB 124MB 2097kB sbl3b
15 124MB 124MB 524kB abootb
16 124MB 125MB 524kB rpmb
17 125MB 125MB 524kB tzb
18 125MB 126MB 524kB metadata
19 126MB 143MB 16.8MB misc
20 143MB 159MB 16.8MB ext4 persist
21 159MB 1040MB 881MB ext4 system
22 1040MB 1627MB 587MB ext4 cache
24 15.8GB 15.8GB 524kB DDR
25 15.8GB 15.8GB 507kB grow

~ # ←[6n
[Nexus 4 General] myxal:
Has anyone managed to get/make an addon.d script (for growing the system partition) that would work for updating?

I'm on TWRP 3.5.2_9-0 and at first glance, the simple script by @franz.s should work (ext filesystems are online-growable), but trying to resize a mounted /system in TWRP fails with "device busy".

In my old script, unmounting doesn't work, probably because the ROM installation process runs the addon scripts from the system partition.

EDIT: After testing with my own scripts it seems both assumptions are wrong - I got it working with a very verbose script, and it seems that when installing CarbonROM:

the script is actually called from /tmp/

the system partition is unmounted when it starts

No idea why the scripts weren't working before, then. 🤷‍♂️
[Nexus 4 General] lukeprokopec:
The parted download link doesn't work anymore. Can you please reupload?
[Nexus 4 General] comatoseEnigma:
i get this error

~ # ←[6n./parted /dev/block/mmcb1k0 p

Error: Could not stat device /dev/block/mmcb1k0 - No such file or directory.

would appreciate any help i can get. Thank you
[Nexus 4 General] unmesh59:
I came here from the LineageOS 18 thread since I need to increase partition sizes on my N4 running TWRP 3.4.0.0 and LineageOS 17.

Borrowing from the cache partition wasn't sufficient so I decided to borrow from userdata by blowing away the userdata partition as well and recreating all three.

This is probably a trivial thing for people familiar with Android but how do I flash the OS and gapps files on my PC using fastboot?

I have TWRP and can run fastboot in bootloader mode but have no adb access in recovery mode. And the LOS-18 is in a zip file which fastboot says is missing a android-info.txt file
[Nexus 4 General] unmesh59:
Answers available starting with the following post

https://xdaforums.com/t/rom-unofficial-lineageos-18-1-mako.3758779/post-88236179
[Samsung Galaxy S8 Questions and Answers] MU24R:
Hi about a week ago my usb(charging port) began to acts weird when i was triying to fasr charge it doesnt work so i decided to restore to default but actually got worst now i cant fast charge or connect to the conputer i tried on a windows 10 with usb drivers installed and on a mac nothing works now im triying to update from update.zip otas from stock recovery but that didnt work too it throws an error any help? The usb port looks fine it isnt broken or something like that i can xharge the phone but slow always with the cable charger could it be a software issue? any fix plis?
[LG G7 ThinQ  Themes, Apps, and Mods] 20degrees:
Anybody seen this app? Just found it by accident. Works like the built-in one should. It's free and ad free.

https://play.google.com/store/apps/details?id=com.xda.nachonotch
[LG G7 ThinQ  Themes, Apps, and Mods] clninja:
I like the notch and will not be hiding it
[LG G7 ThinQ  Themes, Apps, and Mods] WaxysDargle:
only problem with that app is it produces 2 persistent notifications. not a good trade-off in my book.
[LG G7 ThinQ  Themes, Apps, and Mods] 20degrees:
Hold the notification. You can hide them.
[LG G7 ThinQ  Themes, Apps, and Mods] WaxysDargle:
the notifications are there to keep the app running all the time. if you block the notifications the app likely will quit working at times.
[LG G7 ThinQ  Themes, Apps, and Mods] 20degrees:
Hasn't for me. Been running since I posted this.
[LG G7 ThinQ  Themes, Apps, and Mods] AwesomeFabe:
20degrees method worked for me. No persistent notification. Now I can have the notch always hidden like I wanted
[LG G7 ThinQ  Themes, Apps, and Mods] id3alistic:
Works nicely. Now when you go into other apps, the top stays black and the notch stays hidden.

Only minor issue if you have OCD, is say you use something like FB Messenger, part of the chat head will be hidden under the blacked out part of the top.
[LG G7 ThinQ  Themes, Apps, and Mods] 20degrees:
I've been running it for 3 days and no issues yet. Still stays persistent too!
[LG G7 ThinQ  Themes, Apps, and Mods] Talius:
Can't you do the same thing without installing an extra app?

Settings -> Display -> Second Screen

Pick "Custom" and it should change it to be black around the edge of the notch by default.
[LG G7 ThinQ  Themes, Apps, and Mods] 20degrees:
Nope. This stays all the time.
[LG G7 ThinQ  Themes, Apps, and Mods] id3alistic:
That stops when u go into apps where the notification bar is a different color. This app keeps it black all the time.
[LG G7 ThinQ  Themes, Apps, and Mods] 20degrees:
Yup. I actually just donated to the guy. It's worth a few $$ to me.
[LG G7 ThinQ  Themes, Apps, and Mods] mingaldrichgan:
Does anyone know of a way to get Google Photos to "respect" the notch and not stretch all the way to the top? Otherwise the close and menu icons are cut off (when Natcho Notch) when you're editing a photo.

Conversely, for full-screen apps that do respect the notch but hide the status bar, like Acrobat Reader and Google Play Books, is there a way to force the status bar to show? Otherwise, we have wasted space on both sides of the notch.
[LG G7 ThinQ  Themes, Apps, and Mods] praveen6585:
My only concern is that unlike amoled screens, lcd screens stay lit when the screen needs to display black. Would it cause burn in by any chance?
[LG G7 ThinQ  Themes, Apps, and Mods] mingaldrichgan:
My understanding is that LCD screens are not susceptible to burn-in the way AMOLED screens are.