Sorry for this perhaps dumb question and I'm sure it was answered anywhere but searching for "mount root recovery" lists everything to root the device. Last time I need to do this was on my HTC Desire with that S-ON
Ok, but for the backgrounds:
I am running CM13 (rooted of cource) and I need to tweak /init.cm.rc startup script.
When doing this while running CM13 (/ filesystem mounted rw) any changes are gone after reboot.
So how can I do this?
My first thought was: Edit while in recovery. But in TWRP (3.0) the root filesystem isn't mounted - so how can I mount it?
Or on which partition is it located?
Thanks in advance!
Code:
Found valid GPT with protective MBR; using GPT
Disk /dev/block/mmcblk0: 61071360 sectors, 1148M
Logical sector size: 512
Disk identifier (GUID): 98101b32-bbe2-4bf2-a06e-2bb33d000c20
Partition table holds up to 44 entries
First usable sector is 34, last usable sector is 61071326
Number Start (sector) End (sector) Size Code Name
1 16384 180223 80.0M 0700 modem
2 180224 182271 1024K 0700 sbl1
3 182272 182463 98304 0700 sdi
4 182464 184511 1024K 0700 tz
5 184512 185511 500K 0700 rpm
6 185512 186535 512K 0700 hyp
7 186536 186791 128K 0700 pmic
8 186792 188839 1024K 0700 DDR
9 188840 189095 128K 0700 sec
10 189096 197855 4380K 0700 aboot
11 197856 198111 128K 0700 pmicbak
12 198112 200159 1024K 0700 sbl1bak
13 200160 202207 1024K 0700 tzbak
14 202208 203207 500K 0700 rpmbak
15 203208 204231 512K 0700 hypbak
16 204232 212991 4380K 0700 abootbak
17 212992 212993 1024 0700 devinfo
18 229376 237567 4096K 0700 fsg
19 245760 245761 1024 0700 limits
20 262144 270335 4096K 0700 modemst1
21 270336 278527 4096K 0700 modemst2
22 278528 279039 256K 0700 apdp
23 279040 279551 256K 0700 msadp
24 279552 280063 256K 0700 keymaster
25 280064 280575 256K 0700 cmnlib
26 280576 281087 256K 0700 keymasterbak
27 281088 281599 256K 0700 cmnlibbak
28 281600 281601 1024 0700 dpo
29 281602 281603 1024 0700 fsc
30 281604 281619 8192 0700 ssd
31 281620 294911 6646K 0700 oeminfo
32 294912 311295 8192K 0700 persist
33 311296 344063 16.0M 0700 metadata
34 344064 409599 32.0M 0700 boot
35 409600 475135 32.0M 0700 recovery
36 475136 606207 64.0M 0700 oem
37 606208 1015807 200M 0700 vendor
38 1015808 1220607 100M 0700 cache
39 1220608 1222655 1024K 0700 misc
40 1222656 1223679 512K 0700 keystore
41 1223680 1224703 512K 0700 frp
42 1224704 1225703 500K 0700 persistent
43 1225704 7517159 3072M 0700 system
44 7517160 61071326 25.5G 0700 userdata
markusmuster said:
Sorry for this perhaps dumb question and I'm sure it was answered anywhere but searching for "mount root recovery" lists everything to root the device. Last time I need to do this was on my HTC Desire with that S-ON
Ok, but for the backgrounds:
I am running CM13 (rooted of cource) and I need to tweak /init.cm.rc startup script.
When doing this while running CM13 (/ filesystem mounted rw) any changes are gone after reboot.
So how can I do this?
My first thought was: Edit while in recovery. But in TWRP (3.0) the root filesystem isn't mounted - so how can I mount it?
Or on which partition is it located?
Thanks in advance!
Code:
Found valid GPT with protective MBR; using GPT
Disk /dev/block/mmcblk0: 61071360 sectors, 1148M
Logical sector size: 512
Disk identifier (GUID): 98101b32-bbe2-4bf2-a06e-2bb33d000c20
Partition table holds up to 44 entries
First usable sector is 34, last usable sector is 61071326
Click to expand...
Click to collapse
sorry but init.cm.rc is a RAMDISK file... that means you need to change it in the boot.img .... so you will need to compile a new boot.img with your changes or use android image kitchen... but i warn you... playing with boot.img is for devs so dont do mistakes in there!
Sent from my Xperia T using XDA Free mobile app
Thanks for the information. Already guesses that.
Yesterday I saw somewhere in the init scripts that there was a Cyan-test for a user script. I will investigate this.
About
This is just a reference of all GPTs of any G4 model compared to LS991 made for me but maybe useful for others, too.
I have choosen the LS991 as the main GPT here bc I needed all this for my unofficial unlock.
The comparison was made on every single column and so I list only the differences for the other models.
If you miss one lemme know and I will add it here.
Big thanks to: https://www.diffchecker.com/diff
LS991
Code:
Number Start (sector) End (sector) Size Code Name
1 32768 208895 86.0 MiB 0700 modem
2 229376 230399 512.0 KiB FFFF pmic
3 230400 232447 1024.0 KiB FFFF sbl1
4 232448 234495 1024.0 KiB FFFF tz
5 234496 235519 512.0 KiB FFFF sdi
6 235520 236543 512.0 KiB FFFF hyp
7 236544 237567 512.0 KiB FFFF rpm
8 237568 241663 2.0 MiB FFFF aboot
9 241664 243711 1024.0 KiB FFFF sbl1bak
10 243712 244735 512.0 KiB FFFF pmicbak
11 244736 246783 1024.0 KiB FFFF tzbak
12 246784 247807 512.0 KiB FFFF hypbak
13 247808 248831 512.0 KiB FFFF rpmbak
14 248832 252927 2.0 MiB FFFF abootbak
15 252928 253951 512.0 KiB FFFF sdibak
16 253952 254975 512.0 KiB FFFF limits
17 254976 255999 512.0 KiB FFFF devinfo
18 256000 257023 512.0 KiB FFFF apdp
19 257024 258047 512.0 KiB FFFF msadp
20 258048 259071 512.0 KiB FFFF dpo
21 259072 262143 1.5 MiB FFFF spare1
22 262144 294911 16.0 MiB FFFF misc
23 294912 360447 32.0 MiB FFFF persist
24 360448 363519 1.5 MiB FFFF modemst1
25 363520 366591 1.5 MiB FFFF modemst2
26 366592 369663 1.5 MiB FFFF fsg
27 369664 370687 512.0 KiB FFFF fsc
28 370688 371711 512.0 KiB FFFF ssd
29 371712 372735 512.0 KiB FFFF keystore
30 372736 376831 2.0 MiB FFFF DDR
31 376832 377855 512.0 KiB FFFF sec
32 377856 378879 512.0 KiB FFFF encrypt
33 378880 379903 512.0 KiB FFFF eksst
34 379904 380927 512.0 KiB FFFF rct
35 380928 385023 2.0 MiB 0700 persistent
36 385024 393215 4.0 MiB FFFF spare2
37 393216 491519 48.0 MiB FFFF laf
38 491520 573439 40.0 MiB FFFF boot
39 573440 655359 40.0 MiB FFFF recovery
40 655360 671743 8.0 MiB 0700 drm
41 671744 688127 8.0 MiB 0700 sns
42 688128 753663 32.0 MiB 0700 mpt
43 753664 770047 8.0 MiB 0700 eri
44 770048 778239 4.0 MiB FFFF raw_resources
45 778240 786431 4.0 MiB FFFF raw_resourcesbak
46 786432 819199 16.0 MiB 0700 operatorlogging
47 819200 901119 40.0 MiB 0700 carrier
48 901120 917503 8.0 MiB 0700 felica
49 917504 1011711 46.0 MiB FFFF factory
50 1011712 1015807 2.0 MiB FFFF spare3
51 1015808 1036287 10.0 MiB FFFF fota
52 1036288 1048575 6.0 MiB FFFF spare4
53 1048576 9965567 4.3 GiB FFFF system
54 9965568 12488703 1.2 GiB FFFF cache
55 12488704 61046783 23.2 GiB FFFF userdata
56 61046784 61071326 12.0 MiB 0700 grow
F500
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
H810 PR <-- !!! (not "regular" H810)
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
<same as for [I][B]H815[/B][/I]>
H810
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 10321919 4.4 GiB FFFF system
54 10321920 12845055 1.2 GiB FFFF cache
55 12845056 61046783 23.0 GiB FFFF userdata
H811
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
H812
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
H815
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
LS991: p43 753664 770047 8.0 MiB 0700 eri
H815: p43 753664 847871 46.0 MiB FFFF factory
LS991: p44 770048 778239 4.0 MiB FFFF raw_resources
H815: p44 847872 868351 10.0 MiB FFFF fota
LS991: p45 778240 786431 4.0 MiB FFFF raw_resourcesbak
H815: p45 868352 876543 4.0 MiB FFFF raw_resources
LS991: p46 786432 819199 16.0 MiB 0700 operatorlogging
H815: p46 876544 884735 4.0 MiB FFFF raw_resourcesbak
LS991: p47 819200 901119 40.0 MiB 0700 carrier
H815: p47 884736 9363455 4.0 GiB FFFF system
LS991: p48 901120 917503 8.0 MiB 0700 felica
H815: p48 9363456 9887743 256.0 MiB 0700 cust
LS991: p49 917504 1011711 46.0 MiB FFFF factory
H815: p49 9895936 12419071 1.2 GiB FFFF cache
LS991: p50 1011712 1015807 2.0 MiB FFFF spare3
H815: p50 12419072 61046783 23.2 GiB FFFF userdata
LS991: p51 1015808 1036287 10.0 MiB FFFF fota
H815: p51 61046784 61071326 12.0 MiB 0700 grow
LS991: p52 1036288 1048575 6.0 MiB FFFF spare4
LS991: p53 1048576 9965567 4.3 GiB FFFF system
LS991: p54 9965568 12488703 1.2 GiB FFFF cache
LS991: p55 12488704 61046783 23.2 GiB FFFF userdata
LS991: p56 61046784 61071326 12.0 MiB 0700 grow
H818 (LP firmware)
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
H818 (MM fimware)
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
43 753664 847871 46.0 MiB FFFF factory
44 847872 868351 10.0 MiB FFFF fota
45 868352 876543 4.0 MiB FFFF raw_resources
46 876544 884735 4.0 MiB FFFF raw_resourcesbak
47 884736 9363455 4.0 GiB FFFF system
48 9363456 9887743 256.0 MiB 0700 cust
49 9895936 12419071 1.2 GiB FFFF cache
50 12419072 61046783 23.2 GiB FFFF userdata
51 61046784 61071326 12.0 MiB 0700 grow
H819
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
US991
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
VS986
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
TL;DR
Basically this means:
H810-PR (not regular H810) and H815 have the same GPT and that one is very different from the others
F500, H810, H811, H812, H815, H818, H819, US991, VS986 have the same GPT and near the same as the LS991 (which differs just in a slightly bigger system partition and slightly smaller cache one which results in 3 partition changes due to the sector change). This means you could handle all these models as the same when it comes to custom ROM flashing.
reserved.
Great information! Thanks for taking the time to put it together!
Educate me about this command. dd if=/data/media/0/system002.img bs=8192 seek=65536 c
steadfasterX said:
About
This is just a reference of all GPTs of any G4 model compared to LS991 made for me but maybe useful for others, too.
I have choosen the LS991 as the main GPT here bc I needed all this for my unofficial unlock.
The comparison was made on every single column and so I list only the differences for the other models.
If you miss one lemme know and I will add it here.
Big thanks to: https://www.diffchecker.com/diff
LS991
Code:
Number Start (sector) End (sector) Size Code Name
1 32768 208895 86.0 MiB 0700 modem
2 229376 230399 512.0 KiB FFFF pmic
3 230400 232447 1024.0 KiB FFFF sbl1
4 232448 234495 1024.0 KiB FFFF tz
5 234496 235519 512.0 KiB FFFF sdi
6 235520 236543 512.0 KiB FFFF hyp
7 236544 237567 512.0 KiB FFFF rpm
8 237568 241663 2.0 MiB FFFF aboot
9 241664 243711 1024.0 KiB FFFF sbl1bak
10 243712 244735 512.0 KiB FFFF pmicbak
11 244736 246783 1024.0 KiB FFFF tzbak
12 246784 247807 512.0 KiB FFFF hypbak
13 247808 248831 512.0 KiB FFFF rpmbak
14 248832 252927 2.0 MiB FFFF abootbak
15 252928 253951 512.0 KiB FFFF sdibak
16 253952 254975 512.0 KiB FFFF limits
17 254976 255999 512.0 KiB FFFF devinfo
18 256000 257023 512.0 KiB FFFF apdp
19 257024 258047 512.0 KiB FFFF msadp
20 258048 259071 512.0 KiB FFFF dpo
21 259072 262143 1.5 MiB FFFF spare1
22 262144 294911 16.0 MiB FFFF misc
23 294912 360447 32.0 MiB FFFF persist
24 360448 363519 1.5 MiB FFFF modemst1
25 363520 366591 1.5 MiB FFFF modemst2
26 366592 369663 1.5 MiB FFFF fsg
27 369664 370687 512.0 KiB FFFF fsc
28 370688 371711 512.0 KiB FFFF ssd
29 371712 372735 512.0 KiB FFFF keystore
30 372736 376831 2.0 MiB FFFF DDR
31 376832 377855 512.0 KiB FFFF sec
32 377856 378879 512.0 KiB FFFF encrypt
33 378880 379903 512.0 KiB FFFF eksst
34 379904 380927 512.0 KiB FFFF rct
35 380928 385023 2.0 MiB 0700 persistent
36 385024 393215 4.0 MiB FFFF spare2
37 393216 491519 48.0 MiB FFFF laf
38 491520 573439 40.0 MiB FFFF boot
39 573440 655359 40.0 MiB FFFF recovery
40 655360 671743 8.0 MiB 0700 drm
41 671744 688127 8.0 MiB 0700 sns
42 688128 753663 32.0 MiB 0700 mpt
43 753664 770047 8.0 MiB 0700 eri
44 770048 778239 4.0 MiB FFFF raw_resources
45 778240 786431 4.0 MiB FFFF raw_resourcesbak
46 786432 819199 16.0 MiB 0700 operatorlogging
47 819200 901119 40.0 MiB 0700 carrier
48 901120 917503 8.0 MiB 0700 felica
49 917504 1011711 46.0 MiB FFFF factory
50 1011712 1015807 2.0 MiB FFFF spare3
51 1015808 1036287 10.0 MiB FFFF fota
52 1036288 1048575 6.0 MiB FFFF spare4
53 1048576 9965567 4.3 GiB FFFF system
54 9965568 12488703 1.2 GiB FFFF cache
55 12488704 61046783 23.2 GiB FFFF userdata
56 61046784 61071326 12.0 MiB 0700 grow
F500
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
H810 PR <-- !!! (not "regular" H810)
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
<same as for [I][B]H815[/B][/I]>
H810
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 10321919 4.4 GiB FFFF system
54 10321920 12845055 1.2 GiB FFFF cache
55 12845056 61046783 23.0 GiB FFFF userdata
H811
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
H812
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
H815
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
LS991: p43 753664 770047 8.0 MiB 0700 eri
H815: p43 753664 847871 46.0 MiB FFFF factory
LS991: p44 770048 778239 4.0 MiB FFFF raw_resources
H815: p44 847872 868351 10.0 MiB FFFF fota
LS991: p45 778240 786431 4.0 MiB FFFF raw_resourcesbak
H815: p45 868352 876543 4.0 MiB FFFF raw_resources
LS991: p46 786432 819199 16.0 MiB 0700 operatorlogging
H815: p46 876544 884735 4.0 MiB FFFF raw_resourcesbak
LS991: p47 819200 901119 40.0 MiB 0700 carrier
H815: p47 884736 9363455 4.0 GiB FFFF system
LS991: p48 901120 917503 8.0 MiB 0700 felica
H815: p48 9363456 9887743 256.0 MiB 0700 cust
LS991: p49 917504 1011711 46.0 MiB FFFF factory
H815: p49 9895936 12419071 1.2 GiB FFFF cache
LS991: p50 1011712 1015807 2.0 MiB FFFF spare3
H815: p50 12419072 61046783 23.2 GiB FFFF userdata
LS991: p51 1015808 1036287 10.0 MiB FFFF fota
H815: p51 61046784 61071326 12.0 MiB 0700 grow
LS991: p52 1036288 1048575 6.0 MiB FFFF spare4
LS991: p53 1048576 9965567 4.3 GiB FFFF system
LS991: p54 9965568 12488703 1.2 GiB FFFF cache
LS991: p55 12488704 61046783 23.2 GiB FFFF userdata
LS991: p56 61046784 61071326 12.0 MiB 0700 grow
H818 (LP firmware)
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
H818 (MM fimware)
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
43 753664 847871 46.0 MiB FFFF factory
44 847872 868351 10.0 MiB FFFF fota
45 868352 876543 4.0 MiB FFFF raw_resources
46 876544 884735 4.0 MiB FFFF raw_resourcesbak
47 884736 9363455 4.0 GiB FFFF system
48 9363456 9887743 256.0 MiB 0700 cust
49 9895936 12419071 1.2 GiB FFFF cache
50 12419072 61046783 23.2 GiB FFFF userdata
51 61046784 61071326 12.0 MiB 0700 grow
H819
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
US991
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
VS986
DIFFERENCE (compared: number, start, end, size, name) TO LS991:
Code:
Number Start (sector) End (sector) Size Code Name
53 1048576 9822207 4.2 GiB FFFF system
54 9822208 12345343 1.2 GiB FFFF cache
55 12345344 61046783 23.2 GiB FFFF userdata
TL;DR
Basically this means:
H810-PR (not regular H810) and H815 have the same GPT and that one is very different from the others
F500, H810, H811, H812, H815, H818, H819, US991, VS986 have the same GPT and near the same as the LS991 (which differs just in a slightly bigger system partition and slightly smaller cache one which results in 3 partition changes due to the sector change). This means you could handle all these models as the same when it comes to custom ROM flashing.
Click to expand...
Click to collapse
Sorry my text is quite long but please read on, :silly:
Hello dev, you probably have another device by now but, i believe you are still the expert when it comes to the numerous models of the g4. I have been following your work closely and have benefitted from it.
Background
I got an h811 which turned out to be an Ls991 upon disassembly, with ARB=4 confirmed by SALT+FWUL combo. With that disadvantageous ARB in mind, i never attempted to USU it. The only thing i could do with SALT at this point was to backup all partitions.... and that went well, in fact easy peesy using the built in salt backup option.
Having backed up my .imgs, i now wondered how to please the playful monkey in me :laugh: so i grabbed a ZVD.tot file from google because because SALT was able to tell me ZVD was the original firmware this frankenstein was running. The lgup flash went butter smooth and booted with no problems.... well almost. The sprint g4 conjured a network lock which proved non-removable even with gsm boxes. (i think this is why someone had installed an h811 system on this device) So i remembered i had my salt backup of the "h811 system.img" . I looked for all possible ways of restoring the network unlocked h811.img but non seemed to work. There has never been a fastboot mode on this device even during in its frankenstein days (even before i De-frankenstein-ed it :laugh no root, and bootloader is locked i guess. But i kept wondering how did they install that h811 system image with a locked bootloader? i tried developer modes of LGUP, uppercut, to flash a specific system partition of the h811 on my ls991 but always failed at at the very start the invalid dll or unknown device but mostly the invalid dlls. Then finally i landed on this command dd if=/data/media/0/system.rooted.LS991ZV5.img bs=8192 seek=65536 count=557312 of=/dev/block/mmcblk0 from this post https://forum.xda-developers.com/g4/orig-development/root-tmo-vzw-intl-variants-soon-root-lg-t3164765 but replaced the rooted.LS991ZV5.img with my system.img i had backed up with salt (because i was scared of bricking ZVD firmware with a ZV6 system image) and boom my device booted t-mobile without network lock. That was the background now here is the main reason i need guidance,
Actual querry
am not an expert developer, help me understand what the numbers in that command represent on the ls991 model as the linked post clearely warns that those numbers in the code are model specific. I am thinking of using the same trick to push my own modified images such as patched boot images , and maybe recoverys since i have no way of USUing this ARB=4 frankenstein. At first i thought those figures represent partition sectors but while doing my research, i landed on this g4 partition sector comparison post of yours and my theory got debunked.! Am confused what those numbers represent? Help me generate a command or modify the above comand to push boot, and recovery.
My frankenstein is working properly, though i still dont have root or bootloader acces. My download mode is working well and fortunately accepts commands from SALT>advanced menu>shell. Its the only way i figured out to send commands since my fastboot is disabled and my BL is locked. THANKS ONCE AGAIN.
AGABAJOSHUA said:
Sorry my text is quite long but please read on, :silly:
Hello dev, you probably have another device by now but, i believe you are still the expert when it comes to the numerous models of the g4. I have been following your work closely and have benefitted from it.
Background
I got an h811 which turned out to be an Ls991 upon disassembly, with ARB=4 confirmed by SALT+FWUL combo. With that disadvantageous ARB in mind, i never attempted to USU it. The only thing i could do with SALT at this point was to backup all partitions.... and that went well, in fact easy peesy using the built in salt backup option.
Having backed up my .imgs, i now wondered how to please the playful monkey in me :laugh: so i grabbed a ZVD.tot file from google because because SALT was able to tell me ZVD was the original firmware this frankenstein was running. The lgup flash went butter smooth and booted with no problems.... well almost. The sprint g4 conjured a network lock which proved non-removable even with gsm boxes. (i think this is why someone had installed an h811 system on this device) So i remembered i had my salt backup of the "h811 system.img" . I looked for all possible ways of restoring the network unlocked h811.img but non seemed to work. There has never been a fastboot mode on this device even during in its frankenstein days (even before i De-frankenstein-ed it :laugh no root, and bootloader is locked i guess. But i kept wondering how did they install that h811 system image with a locked bootloader? i tried developer modes of LGUP, uppercut, to flash a specific system partition of the h811 on my ls991 but always failed at at the very start the invalid dll or unknown device but mostly the invalid dlls. Then finally i landed on this command dd if=/data/media/0/system.rooted.LS991ZV5.img bs=8192 seek=65536 count=557312 of=/dev/block/mmcblk0 from this post https://forum.xda-developers.com/g4/orig-development/root-tmo-vzw-intl-variants-soon-root-lg-t3164765 but replaced the rooted.LS991ZV5.img with my system.img i had backed up with salt (because i was scared of bricking ZVD firmware with a ZV6 system image) and boom my device booted t-mobile without network lock. That was the background now here is the main reason i need guidance,
Actual querry
am not an expert developer, help me understand what the numbers in that command represent on the ls991 model as the linked post clearely warns that those numbers in the code are model specific. I am thinking of using the same trick to push my own modified images such as patched boot images , and maybe recoverys since i have no way of USUing this ARB=4 frankenstein. At first i thought those figures represent partition sectors but while doing my research, i landed on this g4 partition sector comparison post of yours and my theory got debunked.! Am confused what those numbers represent? Help me generate a command or modify the above comand to push boot, and recovery.
My frankenstein is working properly, though i still dont have root or bootloader acces. My download mode is working well and fortunately accepts commands from SALT>advanced menu>shell. Its the only way i figured out to send commands since my fastboot is disabled and my BL is locked. THANKS ONCE AGAIN.
Click to expand...
Click to collapse
oh well. first of all: it is bad practice to quote an OP or other posts which are like long a book. this makes this forum slow and unreadable.
back to your questions you should consider to read the dd manpage first: http://man7.org/linux/man-pages/man1/dd.1.html
of course you need a good understanding about filesystems as well.
so to sum up:
Code:
dd if=/data/media/0/system.rooted.LS991ZV5.img bs=8192 seek=65536 count=557312 of=/dev/block/mmcblk0
means:
Code:
skip the first 65536 * 8192 bytes of /dev/block/mmcblk0 and write system.rooted.LS991ZV5.img there
How does this comes together? To understand that above you must first understand how the REGULAR calculation would be:
EMMC devices (i.e. the LG G4) have a block size of 512 bytes and as you can see in the partition listing for the ls911 the start and end sectors are 1048576 and 9965567.
Calculate the block counts: 9965567−1048576 = 8916991 but that will not include the first sector itself as well so + 1 = 8916992
As you know that the block size is 512 bytes you can now calculate / verify the size as well: (8916992 * 512) / 1024 / 1024 = 4354 MB (i.e. 4.3 GB)
but you also got the block "count" so now you have all you need to create your own dd command depending on your specific partition table.
So in order to write at the start sector 1048576 you have to use the dd command like that:
Code:
dd if=/data/media/0/system.rooted.LS991ZV5.img bs=512 seek=1048576 count=8916992 of=/dev/block/mmcblk0
bs: default bs for EMMC devices (can also be read from the device)
seek: start sector
count: calculates as described above
so why does this command differs in bs, seek and count ? bs defines how many bytes should be written at one bunch and you can use what you like as long as it fits into the block size of the partition table.
ok but why? the answer is simple: speed. if you write bigger chunks of data it will finish faster but choosing too big ones can cause trouble and at one stage you will not have performance benefits anymore.
a good practice is to use 10 times bigger then the block size. in this case it is 16 times (8192 / 512 = 16) but that is just fine tuning and ok as well.
so back to the above example. when you change the bs value you have to change everything else as well because it influences the others. A higher bs means you need to lower the rest and the other way around.
the calculation of that choosen factor 16 would be like that:
bs=512, increasing to 8192 (512 * 16)
seek=1048576, decreasing to 65536 (1048576 / 16)
count=8916992, decreasing to 557312 (8916992 / 16)
one warning: using wrong values can even HARD brick your device. so ensure you do it right and first of all get the partition listing (SALT -> advanced menu) of your device.
have fun
.-
Thank you. It now makes sense. I now get the math.
Am happily pushing system images.
Twrp however doesn't seem to like this route. As in always end up with stock rec.
Can i just be stubborn and USU my ls991 having arb=4 ? I know this is very stupid of me and certainly guarantees me a hard brick according to what i have read on the SALT thread and FAQs.
Would you please modify SALT to be able to safely Unlock my device or have i been living under the rock and salt already does this ?
Thanks once again for your time. I know this work is hecktic. I value your time sir.
---------- Post added at 11:35 AM ---------- Previous post was at 11:32 AM ----------
AGABAJOSHUA said:
Thank you. It now makes sense. I now get the math.
Am happily pushing system images.
Twrp however doesn't seem to like this route. As in always end up with stock rec.
Can i just be stubborn and USU my ls991 having arb=4 ? I know this is very stupid of me and certainly guarantees me a hard brick according to what i have read on the SALT thread and FAQs.
Would you please modify SALT to be able to safely Unlock my device or have i been living under the rock and salt already does this ?
Thanks once again for your time. I know this work is hecktic. I value your time sir.
Click to expand...
Click to collapse
As of recent, Can i USU my device having arb=4 ? Am attracted by the liberty it brings becaise my device doesnt do fastboot either.
AGABAJOSHUA said:
Thank you. It now makes sense. I now get the math.
Am happily pushing system images.
Twrp however doesn't seem to like this route. As in always end up with stock rec.
Can i just be stubborn and USU my ls991 having arb=4 ? I know this is very stupid of me and certainly guarantees me a hard brick according to what i have read on the SALT thread and FAQs.
Would you please modify SALT to be able to safely Unlock my device or have i been living under the rock and salt already does this ?
Thanks once again for your time. I know this work is hecktic. I value your time sir.
---------- Post added at 11:35 AM ---------- Previous post was at 11:32 AM ----------
As of recent, Can i USU my device having arb=4 ? Am attracted by the liberty it brings becaise my device doesnt do fastboot either.
Click to expand...
Click to collapse
no UsU for ARB 4. it is IMPOSSIBLE.
the only tiny little chance you have (0.1%) is that you are lucky and having a non-fusing device (see http://bit.do/antirollg4 to check the ARB and if you see "nonfusing" in that menu you are one of these 0.1% and can even downgrade to lower ARB versions).
reg. TWRP: once flashed you HAVE to boot to it DIRECTLY as otherwise it will be overwritten by the system.
.-
Understood.
Update:
Somehow, the phone came back, sort of (battery low?!), and I was able to see all partitions again.
So I tried fixing the problem by copying boot.img and laf.img to the respective partitions ... I guess you shouldn't try these things at 1:30 am after already getting yourself in a horrible mess, but here I am. Now the phone is stuck at the LG logo screen, the LED flashes green and blue, and nothing happens. All I can do is to push the power button, and the process repeats.
Naturally, I cannot see any partitions any longer. Now the device seems to be REALLY dead.
Anything I can still try?!
Original problem description
I have tried, after somehow messing things up when following the guide to install LineageOS on the LG G2 (d802, international version with 32 GB), to resurrect my phone using this guide.
However, it failed to solve my problem, and when I tried to boot, the phone still showed only the LG logo, the secure booting error, and then the screen went black, just as before. I guess I should have used dd as well to copy the boot, dbi and laf partitions.
Instead, I figured maybe I should try the TWRP Recovery v2.6.3.2 instead of either TWRP v2.8.7.3 or the LineageOS Recovery image, and that probably has been my (final) mistake. Because, before, the output from gdisk looked liked this:
Code:
Found valid GPT with protective MBR; using GPT.
Disk /dev/sdb: 61071360 sectors, 29.1 GiB
Model: MMC Storage
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
Partition table holds up to 36 entries
Main partition table begins at sector 2 and ends at sector 10
First usable sector is 34, last usable sector is 61071326
Partitions will be aligned on 2-sector boundaries
Total free space is 257992 sectors (126.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 32768 163839 64.0 MiB 0700 modem
2 163840 165887 1024.0 KiB FFFF sbl1
3 165888 166911 512.0 KiB FFFF dbi
4 196608 197631 512.0 KiB FFFF DDR
5 229376 231423 1024.0 KiB FFFF aboot
6 231424 233471 1024.0 KiB FFFF rpm
7 262144 294911 16.0 MiB FFFF boot
8 294912 296959 1024.0 KiB FFFF tz
9 296960 296961 1024 bytes 0700 pad
10 327680 333823 3.0 MiB FFFF modemst1
11 333824 339967 3.0 MiB FFFF modemst2
12 339968 339969 1024 bytes FFFF pad1
13 360448 393215 16.0 MiB FFFF misc
14 393216 458751 32.0 MiB 0700 persist
15 458752 491519 16.0 MiB FFFF recovery
16 491520 497663 3.0 MiB FFFF fsg
17 524288 525311 512.0 KiB FFFF fsc
18 525312 526335 512.0 KiB FFFF ssd
19 526336 526337 1024 bytes FFFF pad2
20 526338 527361 512.0 KiB FFFF encrypt
21 557056 573439 8.0 MiB 0700 drm
22 573440 589823 8.0 MiB 0700 sns
23 589824 655359 32.0 MiB FFFF laf
24 655360 720895 32.0 MiB FFFF fota
25 720896 786431 32.0 MiB 0700 mpt
26 786432 787455 512.0 KiB FFFF dbibak
27 787456 789503 1024.0 KiB FFFF rpmbak
28 789504 791551 1024.0 KiB FFFF tzbak
29 791552 791567 8.0 KiB FFFF rct
30 819200 6488063 2.7 GiB 0700 system
31 6488064 7733247 608.0 MiB 0700 cache
32 7733248 7897087 80.0 MiB 0700 tombstones
33 7897088 7929855 16.0 MiB 0700 spare
34 7929856 8028159 48.0 MiB 0700 cust
35 8028160 60948479 25.2 GiB 0700 userdata
36 60948480 61071326 60.0 MiB 0700 grow
Now, it looks like this, so I am unable to use dd to copy any files to the (now apparently deleted or at least unavailable) partitions of the LG G2:
Code:
***************************************************************
Found invalid GPT and valid MBR; converting MBR to GPT format
in memory.
***************************************************************
Warning! Main partition table overlaps the first partition by 32 blocks!
You will need to delete this partition or resize it in another utility.
Warning! Secondary partition table overlaps the last partition by
33 blocks!
You will need to delete this partition or resize it in another utility.
Disk /dev/sdb: 2014208 sectors, 983.5 MiB
Model: Mighty Drive
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): DEF7EA8F-7D62-49A1-8F27-4F59EF0FDF29
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 2014174
Partitions will be aligned on 2-sector boundaries
Total free space is 0 sectors (0 bytes)
Number Start (sector) End (sector) Size Code Name
1 2 2014207 983.5 MiB 0700 Microsoft basic data
I am afraid I have no backup of the partition table other than the output above, because I only learned of this feature of gdisk when looking for solutions of this (last) issue.
Is there any way I can restore the partition table of my device?
Any help in unbricking my phone is, of course, GREATLY appreciated. :fingers-crossed:
Hello to all.
I am trying to resize the partition /system using the parted and gdisk commands. But none of these commands succeed in changing mmcblk0 partitions after execution.
The things I do are as follows:
- install adb and fastboot and put them to the system variables.
- enable Settings>developer options>USB debugging and Root debugging
- install TWRP recovery.
- run cmd in adminitsrator permission.
- write these command in CMD :
adb root
adb reboot recovery
adb push gdisk /sbin
adb push parted /sbin
adb shell chmod 777 /sbin/gdisk
adb shell chmod 777 /sbin/parted
adb shell
~#> cd /dev/block
dev/block> gdisk mmcblk0
Partition table scan:
MBR: protective
BSD: not present
APM: not present
GPT: present
Found valid GPT with protective MBR; using GPT.
Command (? for help): p
Disk /dev/block/mmcblk0: 61071360 sectors, 29.1 GiB
Sector size (logical/physical): 512/512 bytes
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
Partition table holds up to 128 entries
Main partition table begins at sector 2 and ends at sector 33
First usable sector is 34, last usable sector is 61071326
Partitions will be aligned on 2-sector boundaries
Total free space is 8158 sectors (4.0 MiB)
Number Start (sector) End (sector) Size Code Name
1 8192 38911 15.0 MiB 8300 apnhlos
2 38912 156543 57.4 MiB 0700 modem
3 156544 157567 512.0 KiB FFFF sbl1
4 157568 157631 32.0 KiB FFFF dbi
5 157632 157695 32.0 KiB FFFF ddr
6 157696 161791 2.0 MiB FFFF aboot
7 161792 162815 512.0 KiB FFFF rpm
8 162816 163839 512.0 KiB FFFF tz
9 163840 184319 10.0 MiB FFFF pad
10 184320 204799 10.0 MiB 8300 param
11 204800 233471 14.0 MiB 8300 efs
12 233472 239615 3.0 MiB FFFF modemst1
13 239616 245759 3.0 MiB FFFF modemst2
14 245760 268287 11.0 MiB FFFF boot
15 268288 294911 13.0 MiB FFFF recovery
16 294912 321535 13.0 MiB FFFF fota
17 321536 335853 7.0 MiB 8300 backup
18 335854 341997 3.0 MiB FFFF fsg
19 341998 341999 1024 bytes FFFF fsc
20 342000 342015 8.0 KiB FFFF ssd
21 342016 358399 8.0 MiB 8300 persist
22 358400 376831 9.0 MiB 8300 persdata
23 376832 5095423 2.3 GiB 8300 system
24 5095424 5709823 300.0 MiB 8300 cache
25 5709824 5730303 10.0 MiB 8300 hidden
26 5730304 61071326 26.4 GiB 8300 userdata
Command (? for help): d
Partition number (1-26): 26
Command (? for help):w
(curser blinking) and device goes to hang!!!!!
anyone can help me? I do this in parted command. It is like above.
after restarting the device, all of the partition are there, like before...
I also used PIT file with different partition sizes, but nothing change. Odin shown : RQT_CLOSE!!
Hello community,
I bought once an Axon 7 mini, installed TWRP and LineageOS (android 9). It was with Stock Rom 6.01, single SIM. As far I remember I had troubles, crashed several times a day. Then I flashed a dual SIM Version of the stock Rom, Android version was I think was 7.1 much better (update via stock recovery). Then I was able to install TWRP, install Lineage, root it.
Now that b2017g died, couldn't see any net.
I bought the same with a defective USB port cheaply, took out the motherboard, build it in in my old - works perfectly with Android version 6.01.
But I can't find a stock rom to upgrade to 7.1 that I need to install TWRP, all downloads have been deleted.
Now I have a backup from all partitions - what to I have to flash to the new MB? Boot, recovery, System?
The Partitions I have from the old b2017g (working beside of a hardware defect on the MB):
Disk /dev/block/mmcblk0: 61071360 sectors, 29.1 GiB
Logical sector size: 512 bytes
Disk identifier (GUID): 98101B32-BBE2-4BF2-A06E-2BB33D000C20
Partition table holds up to 40 entries
First usable sector is 34, last usable sector is 61071326
Partitions will be aligned on 2-sector boundaries
Total free space is 1330412 sectors (649.6 MiB)
Number Start (sector) End (sector) Size Code Name
1 131072 303103 84.0 MiB 0700 modem
2 393216 393217 1024 bytes FFFF fsc
3 393218 393233 8.0 KiB FFFF ssd
4 393234 394257 512.0 KiB FFFF sbl1
5 394258 395281 512.0 KiB FFFF rpm
6 395282 399377 2.0 MiB FFFF tz
7 399378 400401 512.0 KiB FFFF hyp
8 400402 433169 16.0 MiB 0700 dsp
9 524288 527359 1.5 MiB FFFF fsg
10 655360 658431 1.5 MiB FFFF modemst1
11 658432 661503 1.5 MiB FFFF modemst2
12 786432 786495 32.0 KiB FFFF DDR
13 786496 786527 16.0 KiB FFFF sec
14 917504 958463 20.0 MiB FFFF splash
15 1048576 1050623 1024.0 KiB FFFF aboot
16 1050624 1181695 64.0 MiB FFFF boot
17 1181696 1312767 64.0 MiB FFFF recovery
18 1312768 1314815 1024.0 KiB FFFF devinfo
19 1314816 9703423 4.0 GiB FFFF system
20 9830400 10444799 300.0 MiB FFFF cache
21 10444800 10510335 32.0 MiB FFFF persist
22 10510336 10512383 1024.0 KiB FFFF misc
23 10512384 10513407 512.0 KiB FFFF keystore
24 10513408 10513471 32.0 KiB FFFF config
25 10513472 10644543 64.0 MiB FFFF oem
26 10747904 10747967 32.0 KiB FFFF limits
27 10878976 10879999 512.0 KiB FFFF mota
28 10880000 10880511 256.0 KiB FFFF devcfg
29 10880512 10882559 1024.0 KiB FFFF dip
30 10882560 10948095 32.0 MiB FFFF mdtp
31 10948096 10949119 512.0 KiB FFFF syscfg
32 10949120 10957311 4.0 MiB FFFF mcfg
33 11010048 11010559 256.0 KiB FFFF cmnlib
34 11010560 11011071 256.0 KiB FFFF keymaster
35 11141120 11141631 256.0 KiB FFFF apdp
36 11141632 11142143 256.0 KiB FFFF msadp
37 11142144 11142159 8.0 KiB FFFF dpo
38 11142160 11404303 128.0 MiB FFFF logs
39 11404304 61071326 23.7 GiB FFFF userdata
Without having a stock rom, what should I flash to the new MB? Recovery, boot, system?
Have you any valid link to an update from Android V6.01 to 7.1 or 7.11 just using stock ROM?
I use Linux Mint and own no Windows (except maybe WinXP).
regards, any help is welcome...