[Q] how to dump recovery.img in asus zenfone 4 a400cg - Asus Zenfone 4

hello devs
From few days, im trying to figure out which is the recovery partition of my phone. But failed to do so. Whenever i type
Code:
cat proc/partitions
I get everything but not the recovery partition.
Plz help me to dump it.
Im not able to create a custom recovery bcoz of this.
My device is an asus zenfone 4 a400cg
X86 with android 4.4.2(stock)

Mmcblk0p3 is factory[WTH is that]
Mmcblk0p9 is system
Mmcblk0p6 is cache
Mmcblk0p5 is config
Mmcblk0p10 is data and
Mmcblk0p8 is ADF ext4
Now which is the recovery partition in these?????[emoji30] [emoji30] [emoji30] [emoji30] [emoji30] [emoji22]

Related

[Q] A little help here plz

When I tried to list the partitions in the adb. There were only two namely mmcblk0 and mmcblk0p1 is this normal? btw my tabs bricked :crying:..So I have run the following commands (attachment) and this is the result.Can someone please tell me how to make new partitions from this command "mkpartfs".Plus here is the structure from leplinar's thread
P# Name Size Type
1 xloader 128K Fastboot Image
2 bootloader 256K Fastboot Image
3 recovery 15MB Fastboot Image
4 boot 16MB Fastboot Image
5 rom 48MB vfat
6 bootdata 48MB vfat
7 factory 448MB ext4
8 system 672MB ext4
9 cache 464MB ext4
10 data varies ext4
cmon guys atleast someone can post their partition structure.

[Dualboot] i9082 {Stock 4.2.2/AOSP 4.4.2 and AOSP 4.4.2} 23032014 V2

Hi guys,
finally I found a way to make dualboot on our beloved i9082 working!!
This way isn't as much easy as on other devices like the desire HD where
you have just to install an app and everything is done by itself, so follow this
guide at your own risk!!
THIS IS WORST RISK YOU TAKE FOR YOUR PHONE>>>>
IT MAY BRICK YOUR PHONE.....
DONT DO IT IF YOU DONT KNOW WHAT YOU DOING...
How to dual boot your I9082...
1. Make a backup of your internal sdcard to your PC!! All your data on the sd card will be gone!
2. Reboot to cwm-recovery
3. connect your phone to your pc.
4, open up cmd or a terminal and type:
PHP:
adb shell
5. type:
PHP:
cd /dev/block
parted mmcblk0
print
This looks like following
Code:
print
Model: MMC M8G1WA (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 14.7MB 15.7MB 1049kB cal
2 15.7MB 16.0MB 262kB sysparm_dep
3 16.0MB 16.3MB 262kB parm-spml_dep
4 16.3MB 16.5MB 262kB RF_CAL_FILE
5 16.5MB 24.9MB 8389kB KERNEL
6 24.9MB 33.3MB 8389kB RECOVERY
7 33.3MB 53.0MB 19.7MB modem
8 53.0MB 86.2MB 33.3MB reserved
9 86.2MB 88.3MB 2097kB SBL1
10 88.3MB 90.4MB 2097kB SBL2
11 90.4MB 98.8MB 8389kB PARAM
12 98.8MB 99.4MB 524kB DTSBK
13 99.4MB 99.9MB 524kB DTS
14 99.9MB 108MB 8389kB VC-FirmwareBK
15 108MB 117MB 8389kB VC-Firmware
16 117MB 117MB 262kB FOTA_SIG
17 117MB 138MB 21.0MB ext4 efs
18 138MB 1212MB 1074MB ext4 CSC
19 1212MB 2822MB 1611MB ext4 system
20 2822MB 3409MB 587MB ext4 HIDDEN
21 3409MB 7813MB 4404MB ext4 data
The last partiton i.e data partion which is our internal SD card to be re partitioned .
6. Type
PHP:
rm 21
7. Note the start and end of the data partiton. In my case its 3409 and 7813
Firstly we have to create data partition. See the size of system partition i.e 1024 MB. So the new partion will be as follows
PHP:
mkpartfs primary ext2 3409 4433
second is system 2 partition
PHP:
mkpartfs primary ext2 4433 6044
next is cache2 partion
PHP:
mkpartfs primary ext2 6044 6744
next is data2 partion
Code:
mkpartfs primary ext2 6744 7813
Code:
quit
It will say
Code:
quit
Information: You may need to update /etc/fstab.
Ignore the warning Reboot into recovery again on pc type
Code:
adb shell
mke2fs /dev/block/mmcblk0p21
tune2fs -j /dev/block/mmcblk0p21
mke2fs /dev/block/mmcblk0p22
tune2fs -j /dev/block/mmcblk0p22
mke2fs /dev/block/mmcblk0p23
tune2fs -j /dev/block/mmcblk0p23
mke2fs /dev/block/mmcblk0p24
tune2fs -j /dev/block/mmcblk0p24
This will create ext3 partition from ext2
Now convert them to ext4
Code:
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p21
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p22
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p23
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p24
Now lets check everything is ok
Code:
cd /dev/block
parted mmcblk0
print
This should look like following
Code:
print
Model: MMC M8G1WA (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 14.7MB 15.7MB 1049kB cal
2 15.7MB 16.0MB 262kB sysparm_dep
3 16.0MB 16.3MB 262kB parm-spml_dep
4 16.3MB 16.5MB 262kB RF_CAL_FILE
5 16.5MB 24.9MB 8389kB KERNEL
6 24.9MB 33.3MB 8389kB RECOVERY
7 33.3MB 53.0MB 19.7MB modem
8 53.0MB 86.2MB 33.3MB reserved
9 86.2MB 88.3MB 2097kB SBL1
10 88.3MB 90.4MB 2097kB SBL2
11 90.4MB 98.8MB 8389kB PARAM
12 98.8MB 99.4MB 524kB DTSBK
13 99.4MB 99.9MB 524kB DTS
14 99.9MB 108MB 8389kB VC-FirmwareBK
15 108MB 117MB 8389kB VC-Firmware
16 117MB 117MB 262kB FOTA_SIG
17 117MB 138MB 21.0MB ext4 efs
18 138MB 1212MB 1074MB ext4 CSC
19 1212MB 2822MB 1611MB ext4 system
20 2822MB 3409MB 587MB ext4 HIDDEN
21 3409MB 4433MB 1024MB ext4
22 4433MB 6044MB 1611MB ext4
23 6044MB 6744MB 700MB ext4
24 6744MB 7813MB 1069MB ext4
Then
Code:
quit
Now flash your first stock ROM..ofcource custom one from recovery.
Now You can flash your desired AOSP rom as primary and dualboot enabled secondary rom.
Scripts to switch roms has been updated.
Download following dualboot enabled AOSP rom by me CosmicCm
http://www.androidfilehost.com/?fid=23329332407579496
Download following tool kit and extract on your External sd card for AOSP rom and in Internal SD for your stock rom.
http://www.androidfilehost.com/?w=files&flid=12981
Install smanager (os.tools.scriptmanager-1.apk) in zip.
Instructions on ROM switching:
1. Go to Play Store and install SManager (or included in dualboot-k2wl-V2.zip)
2. Run SManager, browse to your DualBoot folder and select "StockPrimary.sh/AOSPprimary.sh" or "AOSPSecondary.sh". depending upon which rom you want to boot into.
3. Mark favourite and su options and run the script.
4. Optional - SManager has a homescreen widget system. It lets you add buttons in your homescreens that will directly run the linked script (it has to be put in favourites first).
AGAIN this is a nuclear level risky procedure and is for ADVANCE users only....
DO NOT TRY IF YOU DONT KNOW WHAT YOU ARE DOING.......
Bugs:-
Your data partitions will be small about 1 GB.
External SD card not working in stock rom.
More?>..... You telll me...
HAPPY FLASHING.....
Credits:-
dreccon
berni987654321
51dusty
and for best inspiration and beta tester....
xenon92
Reverting
To revert
Boot into recovery
start
Code:
adb shell
Code:
cd /dev/block
parted mmcblk0
print
rm 24
rm 23
rm 22
rm 21
Code:
mkpartfs primary ext2 3409 7813
Code:
quit
Reboot into recovery again
on pc type
Code:
adb shell
mke2fs /dev/block/mmcblk0p21
tune2fs -j /dev/block/mmcblk0p21
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p21
now you reverted back.
another one
Awesome work bro
Thanks man
Sent from my GT-I9082 using Tapatalk
Awsm work bro..keep up the good wrk..stay blessed..
Sent from my GT-I9082 using Tapatalk 2
Does this method works with only cosmiccm ROM or it works with all aosp based ROM ?
Sent from my GT-I9082 using Tapatalk
Right now only CosmicCm but if developers willing for making their dualboot compatible rom, it wil.
k2wl said:
Right now only CosmicCm but if developers willing for making their dualboot compatible rom, it wil.
Click to expand...
Click to collapse
@k2wl
Please update your signature for awesome Rom "CosmicCm":good:
OMG!! REallyy Superb workk man:angel::angel:
good work mate but how to undo ..these all changes ? any procedure?
himuslg123 said:
good work mate but how to undo ..these all changes ? any procedure?
Click to expand...
Click to collapse
Flashing PIT file probably.
Sent from my GT-I9082 using Tapatalk
himuslg123 said:
good work mate but how to undo ..these all changes ? any procedure?
Click to expand...
Click to collapse
akiratoriyama said:
Flashing PIT file probably.
Sent from my GT-I9082 using Tapatalk
Click to expand...
Click to collapse
@himuslg123 @akiratoriyama
Look into the second post...
reverting changes...
thanks for the tutorials k2wl
but I have a doubt
suppose ..I have installed 2 roms
now if I want to flash a mod zip( i.e pagapps or so) file for a specific rom via CWM recovery ...ll they be installed on a specific partition for a specific rom ?
for second rom its a problem, i.e AOSP.
thats why i included gapps core in CosmicCM dual boot rom.
for original primary rom stock, you can flash any mods you want.
Give me links for the mods and gapps you wanted.
i will change them into dual boot...
aahh ..that's all I want ..you rock \m/
k2wl said:
for second rom its a problem, i.e AOSP.
thats why i included gapps core in CosmicCM dual boot rom.
for original primary rom stock, you can flash any mods you want.
Give me links for the mods and gapps you wanted.
i will change them into dual boot...
Click to expand...
Click to collapse
Well ..first thanks for this procedure..the more i thank u , the less it would be mahn!..
Now, as u say that u will help guys for mods to dual boot too, the only thing i flash after ur roms is ur kernel ... I dont think its already in there in cosmic rom,And cant live without evolution kernel mahn :|..but i think kernel flashing will screw things up right??
yes it might screw things up..
bt dont worry i will add option for evaluation dualboot kernel soon.
this is work in progress.
will add more options...
k2wl said:
yes it might screw things up..
bt dont worry i will add option for evaluation dualboot kernel soon.
this is work in progress.
will add more options...
Click to expand...
Click to collapse
general question plss..y kernel is not put as a default in ROM( I mean ur kernel and ur ROM).
Though it will not allow users of RR and carbon to use this kernel. just of curosity
Any possibility for a GUI apps or flashable zip to do all this procedure of dual boot in future development? What I mean is like GUI apps of EFS backup
wiryawang said:
Any possibility for a GUI apps or flashable zip to do all this procedure of dual boot in future development? What I mean is like GUI apps of EFS backup
Click to expand...
Click to collapse
No...not so soon...
firstly this is risky procedure
and second
i like commandline better.
better control and fast..
so i cant help you with this.

[D405N]Lost IMEI, need help to restore

After trying to install twrp, my phone bricked.
I managed to unbrick it and flash stock 5.0.2 .kdz ! Through the procedure of unbricking, I performed a low level format which erased everything including my /efs partition and everything included in it.
Therefore my IMEI is currently 0 and my IMEI SV is 00.
I have tried to install my IMEI through QPST but it will not connect to my phone as it will not recognize it (No ESN, No Phone Connected).
I have tried to connect to my phone through CDMA and EFS Professional but still the same.
During my search on the forums, I found that Ishould enter DIAG mode in my phone, but I cannot find an option for this.
LG said I am not covered by warranty as the /EFS partition is not something that could be wiped without root or a modification to the system.
The main problem is that I do not have a backup. Please help me,
Thanks in advance!
If you had a backup made by TWRP then you could restore your EFS partition. Unfortunately I don't know any other way to fix it.
Xemidra said:
If you had a backup made by TWRP then you could restore your EFS partition. Unfortunately I don't know any other way to fix it.
Click to expand...
Click to collapse
That's the thing, my whole trouble begun when I tried to install TWRP!
I'm not sure how could you destroy EFS partition with installing TWRP. You should have stick to instructions.
Xemidra said:
I'm not sure how could you destroy EFS partition with installing TWRP. You should have stick to instructions.
Click to expand...
Click to collapse
TWRP didn't kill my partition, unbricking the device did! Plus If you can't offer a solution or any kind of help, don't answer at all! I am not here for judgement!
baldy21 said:
TWRP didn't kill my partition, unbricking the device did! Plus If you can't offer a solution or any kind of help, don't answer at all! I am not here for judgement!
Click to expand...
Click to collapse
I'm not judging xD
I'm trying to understand how did you exactly destroy your EFS partition. You didn't provide enough information about it, except saying that you did some kind of low-level-format (you didn't mention how or why). What surprised me was that installing TWRP doesn't require to perform any low-level-format. That why I wrote about sticking with instructions. Then you wrote that you messed up your phone while trying to install TWRP and got you IMEI lost during unbricking. You didn't wrote what exactly meant bricking and what "procedure" did you performed to fix your phone.
My point is that you should have written exactly what happened, not only how you got there and what did you tried to do to fix it. In my opinion it's hard to propose any solution when we don't know what exactly did you do.
Try to flash a stock KDZ suitable for your L90 variant.
neverdies said:
Try to flash a stock KDZ suitable for your L90 variant.
Click to expand...
Click to collapse
tried, no success!
I couldn't find any EFS partition in L90, I believe it's stored elsewhere:
Code:
parted /dev/block/mmcblk0
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) print
print
Model: MMC 8WMB3R (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 8389kB 75.5MB 67.1MB fat16 modem
2 75.5MB 76.5MB 1049kB sbl1
3 76.5MB 77.1MB 524kB rpm
4 77.1MB 77.6MB 524kB tz
5 77.6MB 78.1MB 524kB sdi
6 78.1MB 80.2MB 2097kB aboot
7 80.2MB 80.7MB 524kB rpmb
8 80.7MB 81.3MB 524kB tzb
9 81.3MB 83.4MB 2097kB abootb
10 83.4MB 85.5MB 2097kB pad
11 85.5MB 88.6MB 3146kB modemst1
12 88.6MB 91.8MB 3146kB modemst2
13 91.8MB 109MB 16.8MB misc
14 109MB 143MB 33.6MB ext4 persist
15 143MB 166MB 23.1MB laf
16 168MB 191MB 23.1MB boot
17 191MB 214MB 23.1MB recovery
18 214MB 217MB 3146kB fsg
19 218MB 219MB 524kB fsc
20 219MB 219MB 524kB ssd
21 226MB 227MB 524kB DDR
22 235MB 235MB 524kB encrypt
23 235MB 236MB 524kB rct
24 243MB 252MB 8389kB ext4 drm
25 252MB 260MB 8389kB ext4 sns
26 260MB 281MB 21.0MB factory
27 281MB 315MB 33.6MB fota
28 319MB 320MB 1049kB sbl1b
29 320MB 353MB 33.6MB ext4 mpt
30 361MB 466MB 105MB ext4 cust
31 470MB 470MB 524kB eksst
32 478MB 2626MB 2147MB ext4 system
33 2626MB 3569MB 944MB ext4 cache
34 3569MB 7795MB 4225MB ext4 userdata
35 7801MB 7818MB 16.8MB grow
Also, unbricking your phone with other variant image will destroy your radio info and I don't know if there is a way to recover it in L90. Even if you use your variant image, but from other phone, it will probably overwrite your unique info, that's why it's wise to make a backup of your phone after rooting with dd if=/dev/block/mmcblk0 of=/storage/external_SD/unbrick.img bs=1024 count=168960 - this will be YOUR phone backup, don't share with anyone and store it in a safe place.
Back in time when I had the Optimus 2x, it was possible using Tutty (debug mode ON) and accessing LG debug (in our L90 it's 3845#*VARIANT# e.g. 3845#*410#), of course you must use the IMEI printed in the sticker in the back cover (this is not possible anymore FYI).
Actually, there is not EFS partition in L90 indeed, instead, the IMEI and other radio info are stored in modemst1 and modemst1 partitions. As I suspected before, unbrick images takes some NAND blocks and writes to an image file - it takes the partition 1 to 15, which includes modemst1 and modemst2 partitions (11 and 12). These partitions are also not flasheable via KDZ (these partitions are absent), so before doing any modification after rooting your phone, do yourself a favor and backup modemst1 and modemst2 partitions, because if anything goes wrong, unless someone find a way to inject the right IMEI data in modemst1 and modemst1 image files for further flashing, you will end with a "radio brick".
Found a tutorial here at xda how to backup and restore modemst partitions : http://forum.xda-developers.com/lg-g3/development/efs-lg-g3-efs-backup-restore-t2907329
I had the same problem.. I unbricked my phone by low-level format tool .but now I don't have mobile network signal.but I have an twrp recovery .did they help me..
Sent from my LG-D410 using XDA Forums

Text partition d415

Hopefully someone here could possibly pull their partition file from their L90 D415 and upload it here, it seems I need it for a possible way to unbrick my d415. The way I found seems to work for all other variants, though from what i've read others with the d415 model have no success, and it is probably due to a different partition table. So please, if one could, post a link or something for the partition text file. I really need it a long with others I assure you. It would be greatly appreciated. Thank you, and have a nice day.
You can find lots of info about partition table here:
http://forum.xda-developers.com/lg-...ck-partition-table-tool-lg-l90really-t2946323
Probably it includes info for D415 as well. Hope it helps.
mattandhimself said:
Hopefully someone here could possibly pull their partition file from their L90 D415 and upload it here, it seems I need it for a possible way to unbrick my d415. The way I found seems to work for all other variants, though from what i've read others with the d415 model have no success, and it is probably due to a different partition table. So please, if one could, post a link or something for the partition text file. I really need it a long with others I assure you. It would be greatly appreciated. Thank you, and have a nice day.
Click to expand...
Click to collapse
If you can get it to boot to recovery, there's a partition tool (executes from recovery) that will fix it up for you. U might be able to get the table from the app itself. Otherwise I have d415 and will get u what u want from mine. Lmk if u still need the help with that
This is from my stock D410HN. Please note the unit.
Code:
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
unit s
(parted) print
print
Model: MMC 8WMB3R (sd/mmc)
Disk /dev/block/mmcblk0: 15269888s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 16384s 147455s 131072s fat16 modem
2 147456s 149503s 2048s sbl1
3 149504s 150527s 1024s rpm
4 150528s 151551s 1024s tz
5 151552s 152575s 1024s sdi
6 152576s 156671s 4096s aboot
7 156672s 157695s 1024s rpmb
8 157696s 158719s 1024s tzb
9 158720s 162815s 4096s abootb
10 162816s 166911s 4096s pad
11 166912s 173055s 6144s modemst1
12 173056s 179199s 6144s modemst2
13 179200s 211967s 32768s misc
14 212992s 278527s 65536s ext4 persist
15 278528s 323583s 45056s laf
16 327680s 372735s 45056s boot
17 372736s 417791s 45056s recovery
18 417792s 423935s 6144s fsg
19 425984s 427007s 1024s fsc
20 427008s 428031s 1024s ssd
21 442368s 443391s 1024s DDR
22 458752s 459775s 1024s encrypt
23 459776s 460799s 1024s rct
24 475136s 491519s 16384s ext4 drm
25 491520s 507903s 16384s ext4 sns
26 507904s 548863s 40960s factory
27 548864s 614399s 65536s fota
28 622592s 624639s 2048s sbl1b
29 624640s 690175s 65536s ext4 mpt
30 704512s 909311s 204800s ext4 cust
31 917504s 918527s 1024s eksst
32 933888s 5128191s 4194304s ext4 system
33 5128192s 6971391s 1843200s ext4 cache
34 6971392s 15223807s 8252416s ext4 userdata
35 15237120s 15269854s 32735s grow
If you mean the partition table, it can be retrieved from the stock KDZ using LGFirmwareExtract. Download your KDZ and extract it, extract DZ, extract PrimaryGPT_0.BIN.
mattandhimself said:
Hopefully someone here could possibly pull their partition file from their L90 D415 and upload it here, it seems I need it for a possible way to unbrick my d415. The way I found seems to work for all other variants, though from what i've read others with the d415 model have no success, and it is probably due to a different partition table. So please, if one could, post a link or something for the partition text file. I really need it a long with others I assure you. It would be greatly appreciated. Thank you, and have a nice day.
Click to expand...
Click to collapse
so does this mean that if we found what do we need we weill be able to ubrick our harbricked lg l90 d415
i have my bricked for 2 yeras
lgl90 said:
so does this mean that if we found what do we need we weill be able to ubrick our harbricked lg l90 d415
i have my bricked for 2 yeras
Click to expand...
Click to collapse
Yes, i will post the method now, but it uses another method.
F. Gacrux said:
This is from my stock D410HN. Please note the unit.
Code:
GNU Parted 1.8.8.1.179-aef3
Using /dev/block/mmcblk0
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted) unit s
unit s
(parted) print
print
Model: MMC 8WMB3R (sd/mmc)
Disk /dev/block/mmcblk0: 15269888s
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Number Start End Size File system Name Flags
1 16384s 147455s 131072s fat16 modem
2 147456s 149503s 2048s sbl1
3 149504s 150527s 1024s rpm
4 150528s 151551s 1024s tz
5 151552s 152575s 1024s sdi
6 152576s 156671s 4096s aboot
7 156672s 157695s 1024s rpmb
8 157696s 158719s 1024s tzb
9 158720s 162815s 4096s abootb
10 162816s 166911s 4096s pad
11 166912s 173055s 6144s modemst1
12 173056s 179199s 6144s modemst2
13 179200s 211967s 32768s misc
14 212992s 278527s 65536s ext4 persist
15 278528s 323583s 45056s laf
16 327680s 372735s 45056s boot
17 372736s 417791s 45056s recovery
18 417792s 423935s 6144s fsg
19 425984s 427007s 1024s fsc
20 427008s 428031s 1024s ssd
21 442368s 443391s 1024s DDR
22 458752s 459775s 1024s encrypt
23 459776s 460799s 1024s rct
24 475136s 491519s 16384s ext4 drm
25 491520s 507903s 16384s ext4 sns
26 507904s 548863s 40960s factory
27 548864s 614399s 65536s fota
28 622592s 624639s 2048s sbl1b
29 624640s 690175s 65536s ext4 mpt
30 704512s 909311s 204800s ext4 cust
31 917504s 918527s 1024s eksst
32 933888s 5128191s 4194304s ext4 system
33 5128192s 6971391s 1843200s ext4 cache
34 6971392s 15223807s 8252416s ext4 userdata
35 15237120s 15269854s 32735s grow
If you mean the partition table, it can be retrieved from the stock KDZ using LGFirmwareExtract. Download your KDZ and extract it, extract DZ, extract PrimaryGPT_0.BIN.
Click to expand...
Click to collapse
Thank you, i will post the method to unbrick the d415, now that you gave the way to get it unbricked. sadly i got rid of it, but now others can be fixed.
mattandhimself said:
Yes, i will post the method now, but it uses another method.
Click to expand...
Click to collapse
OMMMGG HOW CAN I THANK YOU CAN I DONATE TO YOU PLEEAS
OOOMMGG SORRY IM ANNOYING BUT IM SOO HAPPY
ohh yeah and will this unbrick the qhusb 9008
if yes omg i will donate 50 dollars
lgl90 said:
OMMMGG HOW CAN I THANK YOU CAN I DONATE TO YOU PLEEAS
OOOMMGG SORRY IM ANNOYING BUT IM SOO HAPPY
ohh yeah and will this unbrick the qhusb 9008
if yes omg i will donate 50 dollars
Click to expand...
Click to collapse
im sorry. but I'm having issues at the moment, but I will try to fix it. But there is a method for the lg l90 already, but its for all the models BUT the d415. like i said, im making the fix right now
mattandhimself said:
im sorry. but I'm having issues at the moment, but I will try to fix it. But there is a method for the lg l90 already, but its for all the models BUT the d415. like i said, im making the fix right now
Click to expand...
Click to collapse
No luck?? Or did you just say f*** it?

[GUIDE] Increase your Nexus 4's system partition for more space!

I got tired of installing amazing ROMs created by the talented folks here on XDA, but being held back on things like Google Apps because of the tiny /system partition we have on the Nexus 4. I looked around and found guides to increase the system space in the Nexus 5 and Nexus 7 2013, so I basically just adapted them to work on our beloved Nexus 4.
As always, do this at your OWN risk. I am not responsible for bricking your Nexus 4. I will simply list the process which I used to increase my Nexus 4's system partition (by taking a big ol' chunk from the cache partition). Remember, any sort of modification to your device of this caliber WILL void any warranty you might still have.
REQUIREMENTS:
parted (Uploaded to my Google Drive. If it downloads as a .txt, rename it to remove the extension and make it a plain file)
adb and fastboot, and preferably knowledge on how they work
Step 1: Install TWRP onto your Nexus 4 and reboot into it.
Step 2: Open up command prompt / terminal and check to see if your Nexus 4 is connected properly with "adb devices".
Step 3: Once you've confirmed that adb is fully working and your Nexus 4 is properly connected to your PC, download parted and use adb to push it to your Nexus 4 using the command:
Code:
adb push parted /
Step 4: Now enter the following command:
Code:
adb shell
and then the command:
Code:
chmod +x parted
This will enter adb shell and make the "parted" binary you pushed to your device earlier executable.
Step 5:
Now run the command
Code:
./parted /dev/block/mmcblk0 p
You should see a long list with a bunch of numbers and names in your terminal. These are the partitions on your device. parted will give you the partition number, the "start" and "end" of the partition, the size, and the name.
This is the partition layout on my device. It will probably be the same on your device, though the size of userdata may vary depending on whether you have the 8gb or 16gb Nexus 4.
Code:
~ # ./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 ext2 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 15.8GB 14.1GB ext4 userdata
24 15.8GB 15.8GB 524kB DDR
25 15.8GB 15.8GB 507kB grow
Step 6:
Now run the following three commands:
Code:
umount /data
umount /sdcard
umount /cache
Step 7: So, on my Nexus 4, the system partition is number 21, and cache is 22. We're kinda lucky in the fact that system and cache are right next to each other, meaning we don't have to touch any other partition.
You'll want to run these two next commands. These commands will essentially "remove" the two partitions.
Code:
./parted /dev/block/mmcblk0 rm 21
./parted /dev/block/mmcblk0 rm 22
Step 8: Now it is time to recreate these two partitions, however, when recreating them, we will make system bigger and the cache smaller. From the partitions list we got in Step 5, we can see that system starts at 159 and ends at 1040, while cache starts at 1040 and ends at 1627. The following two commands will rebuild /system starting at 159, but ending at 1590, while rebuilding cache at 1590, and ending at 1627. We are essentially stealing a large chunk from cache, since we don't really need that anymore on newer ROMs.
Code:
./parted /dev/block/mmcblk0 mkpart primary 159 1590
./parted /dev/block/mmcblk0 mkpart primary 1590 1627
Step 9: Now run this command:
Code:
./parted /dev/block/mmcblk0 p
This will bring up the partitions list, or table, again. This time, however, we'll see the new partitions where system and cache were, however, they have no names! The following two commands will name the two partitions again.
Code:
./parted /dev/block/mmcblk0 name 21 system
./parted /dev/block/mmcblk0 name 22 cache
Step 10: Great! Now the partitions should be named again! Now, we still have to format the partitions as ext4 so that we can actually use them. The following two commands will do that for you.
Code:
mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p21
mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p22
Step 11: At this point, feel free to run the command from Step 5 to take one more look at the partition table and make sure everything looks good. Now run the command
Code:
mount -a
and then type in
Code:
exit
.
Step 12: Now we are pretty much done. We've extended the system partition from approx. 881mb to 1431mb, which is a nice large chunk of memory. In the future, we could always mess with the partitions more to add even more space by stealing from userdata, but until we reach that point, I think we are pretty well set for now!
Now...
You'll want to reboot TWRP, and flash a new ROM. You can now use a much bigger Google Apps package, without any worries.
Do note, however, that flashing a ROM will "resize" system to be smaller, but this isn't a huge deal. After flashing a ROM, while still in TWRP, you'll want to go to Wipe > Advanced Wipe > check "system" then head to "Repair or Change File System", > then tap on "Resize File System." If you encounter any errors while trying to resize, try remounting system or rebooting TWRP. Afterwards, you should be able to flash your Google Apps package. I'm not sure if you need to repeat these steps after flashing things other than ROMs, but repeating this process within TWRP should work just as well.
I hope I helped y'all out and feel free to post if this guide worked for you or if you have any other comments!
CREDITS:
@surfrock66 for his Nexus 5 guide here.
@rkhat for his Nexus 7 2013 guide here.
RESERVED
Worked Thanx
It worked here on my 8 Gb mako. Here are the original parted output:
Code:
Model: MMC 008G92 (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
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 ext2 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 7817MB 6190MB ext4 userdata
24 7817MB 7818MB 524kB DDR
25 7818MB 7818MB 507kB grow
I'm using Nitrogen OS 8.1 with GZR Gapps
jfsobreira said:
It worked here on my 8 Gb mako. Here are the original parted output:
Code:
Model: MMC 008G92 (sd/mmc)
Disk /dev/block/mmcblk0: 7818MB
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 ext2 system
22 1040MB 1627MB 587MB ext4 cache
23 1627MB 7817MB 6190MB ext4 userdata
24 7817MB 7818MB 524kB DDR
25 7818MB 7818MB 507kB grow
I'm using Nitrogen OS 8.1 with GZR Gapps
Click to expand...
Click to collapse
Awesome! Thanks for letting me know. Glad it worked for you. :good:
thank you very much !
Thx !
Thx !
Great guide works perfectly.. has anyone tried to reverse the process and go back to stock to reflash a factory image?
I just tried it on my old Nexus 4, and after resettting the partitions, and reflashing the factory image, its just a permanent bootloop. I've cleared all the cache, tried a wipe from the stock recovery, tried flashing TWRP and wiping there.. nothing seems to work. Im not too worried, but it'd be nice if it could boot again.
Thanks for your guide. It worked like a charm for my Nexus 4.
Just a small addition: To resize the system partition automatically I placed a script in /system/addon.d:
Code:
#!/sbin/sh
#
# /system/addon.d/10-resize-system.sh
#
. /tmp/backuptool.functions
case "$1" in
backup)
# Stub
;;
restore)
# Stub
;;
pre-backup)
# Stub
;;
post-backup)
# Stub
;;
pre-restore)
/sbin/resize2fs /dev/block/platform/msm_sdcc.1/by-name/system
;;
post-restore)
# Stub
;;
esac
If it doesn't work for you
Thanks for this great guide!
Decided to breath some new life into an old N4 in my family and now it's going (very) strong again with LineageOS 15.1. Still had to clear a bit over 100 MB with .gapps-config from Stock-OpenGapps, but that's no biggie. I always liked to start with the big package and then remove everything that I don't need from it.
Second issue gave me some headaches at first.
"Resize File System" in TWRP apparently worked and Gapps-Install went through (~100 MB free at the end), but boot would fail and crash back to recovery.
(I'm using the daily LOS-nightlies by Milaq and Stock-Package from OpenGapps, maybe it's no problem with other ROMs and/or Gapps-Packages.)
Turns out the fix in TWRP wasn't really working, nevermind what partition size it shows for /system afterwards. It's somehow corrupted and still has the original size -> most of the gapps stuff get's written to nirvana, thus the failing boot.
I found the solution over in the Nexus5-Thread:
JekaPinsk said:
Hello guys!
Try this:
1) Install ROM
2) Backup ROM
3) Enable "Use 'rm -rf' instead of formatting" in TWRP settings
4) Format /system
4.1) Unmount /system and use 'resize2fs -f /dev/block/mmcblk0p21' in terminal (TWRP)
5) Reboot TWRP
5.1) Uncheck "Use 'rm -rf' instead of formatting" in TWRP settings
6) Restore backup
7) Install Stock OpenGapps
8) Done!
The idea behind it is that ROM installation somehow corrupt /system partition thus any write operations above normal data region silently fail.
Click to expand...
Click to collapse
at step 4.1 I already changed the partition number to 21 for Nexus4. In the original post it says mmcblk0p25, because on the Nexus 5 that's /system.
Now it works.
In theory this procedure should also work for updating the ROM without losing data, but haven't tested it yet. (Maybe throw in a wipe of /system as step 0...?)
To be clear: This isn't the fault of the guide to resize system-partition.
Problem is (at least certain) ROMs resetting size of file system to original and then TWRP failing to fix that doing it the easy way as described in OP (-> bug in TWRP?).
EDIT:
Above procedure also works for an update without data loss. Only difference was I did a normal wipe of /system first, "step 0" so to say.
No idea if all this is still necessary with TWRP 3.2.3-0, I'm not willing to risk a full wipe at this point. ^^
i need this...can't even install the smallest gapps package after oreo.... word!! thanks!
Really wanted to thank-you for this!
Two questions:
1. When you printed the partitions, system (21) was ext2. When you recreated it after resizing, you created it as ext4. Was that intentional?
2. You also made the claim that modern ROMs don't need such a big cache partition (your new one was 37MB, I wasn't so brave). Can you justify that claim or provide some technical details? It's not that I don't believe you (I trusted you enough to do this on my device!), just merely curious as to why/how this would be.
Thanks!
X:\xxx\xxx\xxx\xxx\adb>adb push parted /
487 KB/s (346680 bytes in 0.695s)
X:\xxx\xxx\xxx\xxx\adb>adb shell
~ # chmod +x parted
chmod +x parted
~ # ./parted /dev/block/mmcblk0 p
./parted /dev/block/mmcblk0 p
Error: Can't have overlapping partitions.
~ # 
Please Help!!!!!!!!!!!!!!!!!!!
caliban2 said:
Thanks for this great guide!
Decided to breath some new life into an old N4 in my family and now it's going (very) strong again with LineageOS 15.1. Still had to clear a bit over 100 MB with .gapps-config from Stock-OpenGapps, but that's no biggie. I always liked to start with the big package and then remove everything that I don't need from it.
Second issue gave me some headaches at first.
"Resize File System" in TWRP apparently worked and Gapps-Install went through (~100 MB free at the end), but boot would fail and crash back to recovery.
(I'm using the daily LOS-nightlies by Milaq and Stock-Package from OpenGapps, maybe it's no problem with other ROMs and/or Gapps-Packages.)
Turns out the fix in TWRP wasn't really working, nevermind what partition size it shows for /system afterwards. It's somehow corrupted and still has the original size -> most of the gapps stuff get's written to nirvana, thus the failing boot.
I found the solution over in the Nexus5-Thread:
at step 4.1 I already changed the partition number to 21 for Nexus4. In the original post it says mmcblk0p25, because on the Nexus 5 that's /system.
Now it works.
In theory this procedure should also work for updating the ROM without losing data, but haven't tested it yet. (Maybe throw in a wipe of /system as step 0...?)
To be clear: This isn't the fault of the guide to resize system-partition.
Problem is (at least certain) ROMs resetting size of file system to original and then TWRP failing to fix that doing it the easy way as described in OP (-> bug in TWRP?).
EDIT:
Above procedure also works for an update without data loss. Only difference was I did a normal wipe of /system first, "step 0" so to say.
No idea if all this is still necessary with TWRP 3.2.3-0, I'm not willing to risk a full wipe at this point. ^^
Click to expand...
Click to collapse
I'm using TWRP 3.2.3-0 and it has this bug, too. After I followed your steps I was able to install Nitrogen OS and Open Gapps Micro in my phone without erros.
Thanks!
I believe that resize2fs step can be packaged as a flashable zip so we can batch flashing without manual intervention to it (i.e. manually resize fs on system after each rom flash) .
ivanich said:
I believe that resize2fs step can be packaged as a flashable zip so we can batch flashing without manual intervention to it (i.e. manually resize fs on system after each rom flash) .
Click to expand...
Click to collapse
Maybe then more users would dare to use this solution and could calmly install gapps on Pie.
You have a lot of experience. What do you suggest?
Hi all. I only discovered this thread after independently figuring out the partitioning scheme (plain GPT) and process.
Sadly, even after this effort, it seems L-OS upgrades won't work unless L-OS devs modify their upgrade script to make use of resize2fs. Here's what happens as of package 2018-09-11:
L-OS runs backup procedure for all addons found in the existing /system/addon.d/
The above creates files (I guess) in /tmp
The /system is unmounted
The partition is overwritten with the image in the upgrade package
The script in addon.d/ are then run to restore the addons from /tmp
The problem is, the partition image in the upgrade package is for the old partition size, and therefore step 5 fails when the free space runs out. It seems the install or restore scripts don't detect this failure, and just exit without reporting an error, with 0B free space on /system.
I'm guessing the problem can be "solved" by formatting the system partition and installing LOS and all addons from scratch, but that's ridiculous. has anyone tried to raise this issue with devs? I'm about to report this in L-OS's JIRA, as I haven't seen any relevant report there.
EDIT: If anyone wants to track: https://jira.lineageos.org/browse/BUGBASH-2306
myxal said:
Hi all. I only discovered this thread after independently figuring out the partitioning scheme (plain GPT) and process.
Sadly, even after this effort, it seems L-OS upgrades won't work unless L-OS devs modify their upgrade script to make use of resize2fs. Here's what happens as of package 2018-09-11:
L-OS runs backup procedure for all addons found in the existing /system/addon.d/
The above creates files (I guess) in /tmp
The /system is unmounted
The partition is overwritten with the image in the upgrade package
The script in addon.d/ are then run to restore the addons from /tmp
The problem is, the partition image in the upgrade package is for the old partition size, and therefore step 5 fails when the free space runs out. It seems the install or restore scripts don't detect this failure, and just exit without reporting an error, with 0B free space on /system.
I'm guessing the problem can be "solved" by formatting the system partition and installing LOS and all addons from scratch, but that's ridiculous. has anyone tried to raise this issue with devs? I'm about to report this in L-OS's JIRA, as I haven't seen any relevant report there.
EDIT: If anyone wants to track: https://jira.lineageos.org/browse/BUGBASH-2306
Click to expand...
Click to collapse
You may be able to fix that on your own by adding an add-on.d named 00-resize-system (so that's it's ran first) that just does "resize2fs /dev/block/.../system", with maybe an unmount before and a mount after. This way, LOS can just flash the full image when upgrading and the system is resized before the other addons.d scripts run.
Fif_ said:
You may be able to fix that on your own by adding an add-on.d named 00-resize-system (so that's it's ran first) that just does "resize2fs /dev/block/.../system", with maybe an unmount before and a mount after. This way, LOS can just flash the full image when upgrading and the system is resized before the other addons.d scripts run.
Click to expand...
Click to collapse
Thanks for the tip, will give that a try. Any idea where I could find an "authoritative" docs/guide to those scripts? Just looked at the one supplied by open g-apps, and I don't really see the difference between the various commands that the script is supposed to handle (which is executed when?). Also what list_file() is supposed to provide.
backup
restore
pre-backup
pre-restore
post-backup
post-restore
myxal said:
Thanks for the tip, will give that a try. Any idea where I could find an "authoritative" docs/guide to those scripts? Just looked at the one supplied by open g-apps, and I don't really see the difference between the various commands that the script is supposed to handle (which is executed when?). Also what list_file() is supposed to provide.
backup
restore
pre-backup
pre-restore
post-backup
post-restore
Click to expand...
Click to collapse
You want to put the resize2fs call in the pre-restore section.
It should look like this:
Code:
pre-restore)
unmount /system
resize2fs /dev/block/platform/.../system
mount /system
;;
This includes unmounting and remounting /system which I think are needed, but YMMV. You'll need to fill in the full path to system under /dev.
There is no authoritative resource for backup scripts that I know of, but the gapps script is a good example.
P.S.: If you make it work, please post the script for others...

Categories

Resources