[GUIDE] Expansion system partition, flashing in a larger GSI mirror tutorial。 - Asus Zenfone 5Z Guides, News, & Discussion

The following operations are dangerous, and improper operations require 9008 recovery. Please backup the data you need before the next step
I come from China, my English is not good, these words come from Google Translate
Download the file I provided without suffix 0,Remove the attachment suffix APK and change it to 0 without any text and suffix.O file, use the REC file manager to move to the SBIN folder, then use the REC file manager to find the SBIN folder, open it, find the 0 file, and change the 0 file permission to 775.
The red below is the text I entered. You can expand the 5G system partition by pressing the red input.
--------------------------------------
C:\AutumnBox\file\Resources\AdbExecutable>fastboot --set-active=b
Setting current slot to 'b' OKAY [ 0.032s]
Finished. Total time: 0.035s
C:\AutumnBox\file\Resources\AdbExecutable>fastboot reboot bootloader
rebooting into bootloader OKAY [ 0.003s]
Finished. Total time: 0.004s
C:\AutumnBox\file\Resources\AdbExecutable>fastboot flash boot twrp-3.4.0-0-Z01RD.img
Sending 'boot_b' (35064 KB) OKAY [ 0.814s]
Writing 'boot_b' OKAY [ 0.135s]
Finished. Total time: 0.960s
C:\AutumnBox\file\Resources\AdbExecutable>adb shell
* daemon not running; starting now at tcp:5037
* daemon started successfully
127|ASUS_Z01R_1:/ # 0 /dev/block/sda
GNU Parted 3.2
Using /dev/block/sda
Welcome to GNU Parted! Type 'help' to view a list of commands.
(parted)
(parted) p
Warning: Not all of the space available to /dev/block/sda appears to be used,
you can fix the GPT to use all of the space (an extra 28 blocks) or continue
with the current setting?
Fix/Ignore? ignore
Model: SAMSUNG KLUDG4U1EA-B0C1 (scsi)
Disk /dev/block/sda: 124GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 32.8kB 8192B ssd
2 32.8kB 1081kB 1049kB misc
3 1081kB 1606kB 524kB keystore
4 1606kB 2130kB 524kB frp
5 2130kB 35.7MB 33.6MB ext4 asdf
6 35.7MB 46.2MB 10.5MB flashlog
7 46.2MB 62.9MB 16.8MB absolute
8 62.9MB 96.5MB 33.6MB ADF
9 96.5MB 130MB 33.6MB ext4 persist
10 130MB 466MB 336MB APD
11 466MB 533MB 67.1MB asusfw
12 533MB 1070MB 537MB ext2 xrom_a
13 1070MB 1606MB 537MB ext2 xrom_b
14 1606MB 4593MB 2986MB ext2 system_a
15 4593MB 7579MB 2986MB ext2 system_b
16 7579MB 124GB 117GB userdata
(parted) rm 14
(parted) rm 15
(parted) rm 16
Error: Partition(s) 16 on /dev/block/sda have been written, but we have been
unable to inform the kernel of the change, probably because it/they are in use.
As a result, the old partition(s) will remain in use. You should reboot now
before making further changes.
Ignore/Cancel? ingnore
0: invalid token: ingnore
Ignore/Cancel? ignore
(parted) ignore
align-check TYPE N check partition N for TYPE(min|opt)
alignment
help [COMMAND] print general help, or help on
COMMAND
mklabel,mktable LABEL-TYPE create a new disklabel (partition
table)
mkpart PART-TYPE [FS-TYPE] START END make a partition
name NUMBER NAME name partition NUMBER as NAME
print [devices|free|list,all|NUMBER] display the partition table,
available devices, free space, all found partitions, or a particular
partition
quit exit program
rescue START END rescue a lost partition near START
and END
resizepart NUMBER END resize partition NUMBER
rm NUMBER delete partition NUMBER
select DEVICE choose the device to edit
disk_set FLAG STATE change the FLAG on selected device
disk_toggle [FLAG] toggle the state of FLAG on selected
device
set NUMBER FLAG STATE change the FLAG on partition NUMBER
toggle [NUMBER [FLAG]] toggle the state of FLAG on partition
NUMBER
unit UNIT set the default unit to UNIT
version display the version number and
copyright information of GNU Parted
(parted)
(parted) p
Model: SAMSUNG KLUDG4U1EA-B0C1 (scsi)
Disk /dev/block/sda: 124GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 32.8kB 8192B ssd
2 32.8kB 1081kB 1049kB misc
3 1081kB 1606kB 524kB keystore
4 1606kB 2130kB 524kB frp
5 2130kB 35.7MB 33.6MB ext4 asdf
6 35.7MB 46.2MB 10.5MB flashlog
7 46.2MB 62.9MB 16.8MB absolute
8 62.9MB 96.5MB 33.6MB ADF
9 96.5MB 130MB 33.6MB ext4 persist
10 130MB 466MB 336MB APD
11 466MB 533MB 67.1MB asusfw
12 533MB 1070MB 537MB ext2 xrom_a
13 1070MB 1606MB 537MB ext2 xrom_b
(parted) mkpart
Partition name? []? system_a
File system type? [ext2]? ext2
Start? 1606
End? 7gb
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? ignore
Error: Partition(s) 16 on /dev/block/sda have been written, but we have been
unable to inform the kernel of the change, probably because it/they are in use.
As a result, the old partition(s) will remain in use. You should reboot now
before making further changes.
Ignore/Cancel? ignore
(parted) p
Model: SAMSUNG KLUDG4U1EA-B0C1 (scsi)
Disk /dev/block/sda: 124GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 32.8kB 8192B ssd
2 32.8kB 1081kB 1049kB misc
3 1081kB 1606kB 524kB keystore
4 1606kB 2130kB 524kB frp
5 2130kB 35.7MB 33.6MB ext4 asdf
6 35.7MB 46.2MB 10.5MB flashlog
7 46.2MB 62.9MB 16.8MB absolute
8 62.9MB 96.5MB 33.6MB ADF
9 96.5MB 130MB 33.6MB ext4 persist
10 130MB 466MB 336MB APD
11 466MB 533MB 67.1MB asusfw
12 533MB 1070MB 537MB ext2 xrom_a
13 1070MB 1606MB 537MB ext2 xrom_b
14 1606MB 7000MB 5394MB ext4 system_a
(parted) mkpart
Partition name? []? system_b
File system type? [ext2]? ext2
Start? 7gb
End? 12gb
Error: Partition(s) 15, 16 on /dev/block/sda have been written, but we have been
unable to inform the kernel of the change, probably because it/they are in use.
As a result, the old partition(s) will remain in use. You should reboot now
before making further changes.
Ignore/Cancel? ignore
(parted) p
Model: SAMSUNG KLUDG4U1EA-B0C1 (scsi)
Disk /dev/block/sda: 124GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 32.8kB 8192B ssd
2 32.8kB 1081kB 1049kB misc
3 1081kB 1606kB 524kB keystore
4 1606kB 2130kB 524kB frp
5 2130kB 35.7MB 33.6MB ext4 asdf
6 35.7MB 46.2MB 10.5MB flashlog
7 46.2MB 62.9MB 16.8MB absolute
8 62.9MB 96.5MB 33.6MB ADF
9 96.5MB 130MB 33.6MB ext4 persist
10 130MB 466MB 336MB APD
11 466MB 533MB 67.1MB asusfw
12 533MB 1070MB 537MB ext2 xrom_a
13 1070MB 1606MB 537MB ext2 xrom_b
14 1606MB 7000MB 5394MB ext4 system_a
15 7000MB 12.0GB 5000MB ext4 system_b
(parted) mkpart
Partition name? []? userdata
File system type? [ext2]? ext2
Start? 12gb
End? 124gb
Error: Partition(s) 15, 16 on /dev/block/sda have been written, but we have been
unable to inform the kernel of the change, probably because it/they are in use.
As a result, the old partition(s) will remain in use. You should reboot now
before making further changes.
Ignore/Cancel? ignore
(parted) p
Model: SAMSUNG KLUDG4U1EA-B0C1 (scsi)
Disk /dev/block/sda: 124GB
Sector size (logical/physical): 4096B/4096B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 24.6kB 32.8kB 8192B ssd
2 32.8kB 1081kB 1049kB misc
3 1081kB 1606kB 524kB keystore
4 1606kB 2130kB 524kB frp
5 2130kB 35.7MB 33.6MB ext4 asdf
6 35.7MB 46.2MB 10.5MB flashlog
7 46.2MB 62.9MB 16.8MB absolute
8 62.9MB 96.5MB 33.6MB ADF
9 96.5MB 130MB 33.6MB ext4 persist
10 130MB 466MB 336MB APD
11 466MB 533MB 67.1MB asusfw
12 533MB 1070MB 537MB ext2 xrom_a
13 1070MB 1606MB 537MB ext2 xrom_b
14 1606MB 7000MB 5394MB ext4 system_a
15 7000MB 12.0GB 5000MB ext4 system_b
16 12.0GB 124GB 117GB ext4 userdata
-------------------------------
The expansion is now complete,But you need to verify the system,Without verification, unlimited FB mode
fastboot flash vbmeta vbmeta.img
-------------------------------------------
The attachment is below
-----------------
View attachment 5100723
View attachment 5100729
View attachment 5100731
View attachment vbmeta.img

xbe28 said:
Download the file I provided without suffix 0
Click to expand...
Click to collapse
I can't find the file

Related

[RQ] Partitionlayout i9305

hey m8´s,
for some reason i need a picture of the partitions from your s3lte. Would be very nice if someone can provide me one
go like this:
You need: ADB & Java SDK installed
1 Reboot to recovery
2 open cmd and start adb
- adb devices
- adb shell
- parted /dev/block/mmcblk0
- (parted) print
the last input should provide you something like:
Number Start End Size File system Name Flags
1 4194kB 8389kB 4194kB ext4 BOTA0
2 8389kB 12.6MB 4194kB BOTA1
3 12.6MB 33.6MB 21.0MB ext4 EFS
4 33.6MB 37.7MB 4194kB m9kefs1
5 37.7MB 41.9MB 4194kB m9kefs2
6 41.9MB 46.1MB 4194kB m9kefs3
7 46.1MB 54.5MB 8389kB PARAM
8 54.5MB 62.9MB 8389kB BOOT
9 62.9MB 71.3MB 8389kB RECOVERY
10 71.3MB 164MB 92.3MB fat16 RADIO
11 164MB 432MB 268MB TOMBSTONES
12 432MB 1506MB 1074MB ext4 CACHE
13 1506MB 3116MB 1611MB ext4 SYSTEM
14 3116MB 3704MB 587MB ext4 HIDDEN
15 3704MB 3712MB 8389kB OTA
16 3712MB 15.8GB 12.0GB ext4 USERDATA
thank you for the help
best regards
F1tty

Need help to wipe internal memory

So ivee tried lots of things to get my xt1063 running again, but it looks that dont mater what it always comes to the same point, so the las thing i want to try, as i took the phone to a shop and they couldnt fix it , i would like to wipe all of the internal memory.
Is this even posible? i know i will probably kill the phone and its ok, so i boot ir in TWRP , im using a computer with ubuntu, installed the latest adb and fastboot, got into adb shell and issue the parted print command i got this
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 SEM08G (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 131kB 67.2MB 67.1MB ext4 modem
2 67.2MB 67.8MB 524kB sbl1
3 67.8MB 67.8MB 32.8kB DDR
4 67.9MB 68.9MB 1036kB aboot
5 69.4MB 69.6MB 205kB rpm
6 69.9MB 70.4MB 410kB tz
7 70.5MB 70.5MB 32.8kB sdi
8 70.5MB 71.0MB 524kB utags
9 71.0MB 73.1MB 2097kB logs
10 73.1MB 75.5MB 2388kB padA
11 75.5MB 76.5MB 1036kB abootBackup
12 77.0MB 77.2MB 205kB rpmBackup
13 77.5MB 78.0MB 410kB tzBackup
14 78.1MB 78.1MB 32.8kB sdiBackup
15 78.1MB 78.6MB 524kB utagsBackup
16 78.6MB 79.7MB 1077kB padB
17 79.7MB 81.3MB 1573kB modemst1
18 81.3MB 82.8MB 1573kB modemst2
19 82.8MB 83.3MB 500kB hob
20 83.3MB 83.4MB 32.8kB dhob
21 83.5MB 85.1MB 1573kB ext2 fsg
22 85.1MB 85.1MB 1024B fsc
23 85.1MB 85.1MB 8192B ssd
24 85.1MB 86.1MB 1049kB sp
25 86.1MB 86.3MB 131kB cid
26 86.3MB 89.4MB 3146kB ext3 pds
27 89.4MB 93.6MB 4194kB logo
28 93.6MB 97.8MB 4194kB clogo
29 97.9MB 106MB 8389kB ext4 persist
30 106MB 107MB 524kB misc
31 107MB 117MB 10.4MB boot
32 117MB 128MB 10.5MB recovery
33 128MB 129MB 1049kB deviceinfo
34 129MB 146MB 16.8MB ext4 ftmlog
35 146MB 706MB 560MB ext4 cache
36 706MB 1863MB 1158MB ext4 system
37 1863MB 1872MB 8389kB kpan
38 1872MB 7784MB 5913MB userdata
So can anyone help to wipe, format or whatever needs to be done to wipe the internal memory. Also, do you guys see any weird partitions taht might not belong there? thanks for any help.
abispac said:
So ivee tried lots of things to get my xt1063 running again, but it looks that dont mater what it always comes to the same point, so the las thing i want to try, as i took the phone to a shop and they couldnt fix it , i would like to wipe all of the internal memory.
Is this even posible? i know i will probably kill the phone and its ok, so i boot ir in TWRP , im using a computer with ubuntu, installed the latest adb and fastboot, got into adb shell and issue the parted print command i got this
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 SEM08G (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 131kB 67.2MB 67.1MB ext4 modem
2 67.2MB 67.8MB 524kB sbl1
3 67.8MB 67.8MB 32.8kB DDR
4 67.9MB 68.9MB 1036kB aboot
5 69.4MB 69.6MB 205kB rpm
6 69.9MB 70.4MB 410kB tz
7 70.5MB 70.5MB 32.8kB sdi
8 70.5MB 71.0MB 524kB utags
9 71.0MB 73.1MB 2097kB logs
10 73.1MB 75.5MB 2388kB padA
11 75.5MB 76.5MB 1036kB abootBackup
12 77.0MB 77.2MB 205kB rpmBackup
13 77.5MB 78.0MB 410kB tzBackup
14 78.1MB 78.1MB 32.8kB sdiBackup
15 78.1MB 78.6MB 524kB utagsBackup
16 78.6MB 79.7MB 1077kB padB
17 79.7MB 81.3MB 1573kB modemst1
18 81.3MB 82.8MB 1573kB modemst2
19 82.8MB 83.3MB 500kB hob
20 83.3MB 83.4MB 32.8kB dhob
21 83.5MB 85.1MB 1573kB ext2 fsg
22 85.1MB 85.1MB 1024B fsc
23 85.1MB 85.1MB 8192B ssd
24 85.1MB 86.1MB 1049kB sp
25 86.1MB 86.3MB 131kB cid
26 86.3MB 89.4MB 3146kB ext3 pds
27 89.4MB 93.6MB 4194kB logo
28 93.6MB 97.8MB 4194kB clogo
29 97.9MB 106MB 8389kB ext4 persist
30 106MB 107MB 524kB misc
31 107MB 117MB 10.4MB boot
32 117MB 128MB 10.5MB recovery
33 128MB 129MB 1049kB deviceinfo
34 129MB 146MB 16.8MB ext4 ftmlog
35 146MB 706MB 560MB ext4 cache
36 706MB 1863MB 1158MB ext4 system
37 1863MB 1872MB 8389kB kpan
38 1872MB 7784MB 5913MB userdata
So can anyone help to wipe, format or whatever needs to be done to wipe the internal memory. Also, do you guys see any weird partitions taht might not belong there? thanks for any help.
Click to expand...
Click to collapse
my suggestion is to wipe 38 userdata and 35 cache if it doesn't reboot after that then try system (36) but only if you believe you will be able to reflash .... I still think its a corrupt userdata (38) (missing ext 3/4? ) if you can find the correct dd= (linux command ) to wipe / format / repartition this , think HTC and samsungs sometimes suffer this
http://forum.xda-developers.com/google-nexus-5/general/howto-repairing-corrupted-data-partition-t2577447 reading / maybe adaptable to fix?
http://android.stackexchange.com/questions/88277/corrupted-data-partition again more info but need to check file system etc
Thanks for the help, so acording to those links i tried
Code:
e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata
and it returned
Code:
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/platform/msm_sdcc.1/by-name/userdata
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
any idea why?
I think this would not wor either, i formated every single partition or file with this comand
mke2fs /dev/block/platform/msm_sdcc.1/by-name/*****
where ****** i aded the name of the all 38 partition parted tells me i have, everything seems ok i dont get erros, but at the end, same result, reboot the phone to the same state.
Please tell me a simple command ,if theres any, to format the whole internal card....please i dont care about the phone anymore, i just want to know if the internal memory can be erased
abispac said:
Thanks for the help, so acording to those links i tried
Code:
e2fsck /dev/block/platform/msm_sdcc.1/by-name/userdata
and it returned
Code:
e2fsck: Superblock invalid, trying backup blocks...
e2fsck: Bad magic number in super-block while trying to open /dev/block/platform/msm_sdcc.1/by-name/userdata
The superblock could not be read or does not describe a correct ext2
filesystem. If the device is valid and it really contains an ext2
filesystem (and not swap or ufs or something else), then the superblock
is corrupt, and you might try running e2fsck with an alternate superblock:
e2fsck -b 8193 <device>
any idea why?
I think this would not wor either, i formated every single partition or file with this comand
mke2fs /dev/block/platform/msm_sdcc.1/by-name/*****
where ****** i aded the name of the all 38 partition parted tells me i have, everything seems ok i dont get erros, but at the end, same result, reboot the phone to the same state.
Please tell me a simple command ,if theres any, to format the whole internal card....please i dont care about the phone anymore, i just want to know if the internal memory can be erased
Click to expand...
Click to collapse
i dont know linux that well, i said ideas - expected you to learn commands are not for your phone , you really need to ask in moto g 1st gen and or linux forum for help as now one here has had this problem , blindly formattting every partiton will kill phone and like I said i think your userdata (data) partition should be ext4 - guessing its just lost its partition table / lable
I believe if you fix 38 userdata partition and only this you will be able to boot or reflash phone
http://forum.xda-developers.com/showthread.php?t=2557781 more ideas but adapt do NOT blindly copy
---------- Post added at 11:30 PM ---------- Previous post was at 11:10 PM ----------
http://androidforums.com/threads/cant-wipe-corrupt-data-bootloop.645860/ READ THIS
---------- Post added 21st February 2015 at 12:07 AM ---------- Previous post was 20th February 2015 at 11:30 PM ----------
Apparently if you relock boot loader then unlock again it formats data and has been used to fix this as a work around.....
http://forum.xda-developers.com/showthread.php?t=2542219&page=136
see posts 1352 and 1353 same problem
reefuge said:
http://forum.xda-developers.com/showthread.php?t=2542219&page=136
see posts 1352 and 1353 same problem
Click to expand...
Click to collapse
thank you ,will take a loo before sending it to motorola tomorrow
delete please, my mistake
im done, sending this to motocare.... thanks again for the help

[HELP] What happened here? Hardbrick after partitioning?

My device: MotoX (ghost)
Hey guys,
Today i pushed "parted" to my /sbin, chmodded 0755 and removed/recreated my userdata partition removing 5mb of total.. (to try to solve a known encryption bug of CM). Then, i reboot.
Now MY PHONE LOOKS HARD BRICKED!
How it is possible? i just deleted/recreated the userdata partition,
yes parted create on format ext2, but the next step is to convert to ext4 > f2fs..
but my phone does not start!
Black screen
No fastboot
lsusb does not list the usb connection..
Pressing the ON = doesn't boot
Pressing vol down + power = doesn't boot
Inserting charger = doesn't boot
No Lights on.
Battery is ok (i think), i started working w/ 100%.
full log of my actions here:
Code:
$ adb push sdparted/parted /sbin
3067 KB/s (346680 bytes in 0.110s)
~/droid $ adb shell
~ # ls
boot init.qcom.sh sepolicy
cache init.rc sideload
charger init.recovery.qcom.rc supersu
data license sys
default.prop proc system
dev property_contexts tmp
etc recovery twres
file_contexts res ueventd.qcom.rc
fstab.qcom root ueventd.rc
init sbin usb-otg
init.mmi.boot.sh sdcard
init.mmi.touch.sh seapp_contexts
~ # chmod 0755 /sbin/parted
~ # 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 SEM16G (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 131kB 105MB 105MB ext4 modem
2 105MB 107MB 1536kB sbl1
3 107MB 108MB 1536kB sbl2
4 108MB 109MB 526kB sbl3
5 110MB 111MB 524kB aboot
6 112MB 112MB 145kB rpm
7 112MB 112MB 215kB tz
8 113MB 113MB 524kB utags
9 113MB 114MB 1049kB logs
10 114MB 117MB 3150kB padA
11 117MB 119MB 1536kB sbl2Backup
12 119MB 121MB 2097kB sbl3Backup
13 121MB 123MB 1536kB abootBackup
14 123MB 123MB 512kB rpmBackup
15 123MB 124MB 512kB tzBackup
16 124MB 124MB 524kB utagsBackup
17 124MB 126MB 1671kB padB
18 126MB 129MB 3146kB modemst1
19 129MB 132MB 3146kB modemst2
20 132MB 134MB 2097kB mbl
21 134MB 135MB 655kB hob
22 135MB 135MB 8192B dhob
23 135MB 143MB 8389kB ext4 persist
24 143MB 143MB 8192B ssd
25 143MB 147MB 3146kB ext2 fsg
26 147MB 148MB 1049kB sp
27 148MB 148MB 524kB misc
28 148MB 151MB 3146kB ext3 pds
29 151MB 151MB 131kB cid
30 151MB 156MB 4194kB logo
31 156MB 160MB 4194kB clogo
32 160MB 161MB 1049kB devtree
33 161MB 171MB 10.5MB boot
34 171MB 182MB 10.5MB recovery
35 182MB 190MB 8389kB kpan
36 190MB 1257MB 1067MB cache
37 1257MB 1258MB 1049kB padC
38 1258MB 2869MB 1611MB ext4 system
39 2869MB 2982MB 113MB customize
40 2982MB 15.8GB 12.8GB userdata
(parted) rm 40
rm 40
(parted) mkpartfs primary ext2 2982MB 15695MB
mkpartfs primary ext2 2982MB 15695MB
(parted) name 40 userdata
name 40 userdata
(parted) quit
quit
Information: You may need to update /etc/fstab.
.. and rebooted using twrp reboot/system button.
Wtf is happened?
any ideas how to solve this?
thanks.
Umm, gpt.bin corrupted.. Head towards the unbrick thread..

[Guide] Repartition Nexus5 to increase system partition - Space for Rom & Stock Gapps

[Guide] Repartition Nexus5 to increase system partition - Space for Rom & Stock Gapps
Before I begin...don't do this if you don't know what you're doing. If you know what you're doing still don't do this. This is dangerous, and in general people don't even make good guides for this likely because it's SUCH a stupid thing to do. Samsung phones support PIT re partitioning, but for something like a Nexus, there is no easy guide. You can and likely will brick your phone...at best you will certainly wipe all data.
I wanted to install a nougat rom on my cracked-screen Nexus5, but in flashing it AND stock gapps would error out since there isn't enough room on the /system partition for both. The Nexus5 comes with a 1GB system partition which was fine way back in the day, but isn't really fine anymore. In order to pull space from the large userdata partition, we need to do some linux trickery. I chose to make /system 2GB, which may be overkill, but this phone is going to be a baby monitor/white noise machine for a 5 month old so who cares.
The prerequisite for this process is a TWRP recovery, and that's pretty much it. Ideally, fdisk would be baked in with busybox or the parted utility would be on the phone and you could use the resize function...every time I tried to use busybox's fdisk led to errors or commands wouldn't work, and parted's resize command can't deal with ext4.
The high-level procedure here is, since filesystems must be contiguous and in order so they can be addressed properly, we need to delete every partition inclusively from system to userdata, then recreate them with new storage offsets. To visualize this, here's the storage layout as it started out on my Nexus 5:
Code:
Model: MMC SEM32G (sd/mmc)
Disk /dev/block/mmcblk0: 31.3GB
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.7MB 1049kB sbl1
3 68.7MB 69.2MB 524kB rpm
4 69.2MB 69.7MB 524kB tz
5 69.7MB 70.3MB 524kB sdi
6 70.3MB 70.8MB 524kB aboot
7 70.8MB 72.9MB 2097kB pad
8 72.9MB 73.9MB 1049kB sbl1b
9 73.9MB 74.4MB 524kB tzb
10 74.4MB 75.0MB 524kB rpmb
11 75.0MB 75.5MB 524kB abootb
12 75.5MB 78.6MB 3146kB modemst1
13 78.6MB 81.8MB 3146kB modemst2
14 81.8MB 82.3MB 524kB metadata
15 82.3MB 99.1MB 16.8MB misc
16 99.1MB 116MB 16.8MB ext4 persist
17 116MB 119MB 3146kB imgdata
18 119MB 142MB 23.1MB laf
19 142MB 165MB 23.1MB boot
20 165MB 188MB 23.1MB recovery
21 188MB 191MB 3146kB fsg
22 191MB 192MB 524kB fsc
23 192MB 192MB 524kB ssd
24 192MB 193MB 524kB DDR
25 193MB 1267MB 1074MB ext4 system
26 1267MB 1298MB 31.5MB crypto
27 1298MB 2032MB 734MB ext4 cache
28 2032MB 31.3GB 29.2GB ext4 userdata
29 31.3GB 31.3GB 5632B grow
Looking at that, we want to increase system (partition 25), shift crypto (partition 26), shift cache (partition 27), and shrink userdata (partition 28). If you try this on a different phone, you'll have different partitions to move.
I did this from a Debian desktop using adb, but you can use any platform that has adb. You need to download the parted binary linked below, a nexus5 Nougat rom (or any rom I guess), and a gapps package (I chose stock). Here's the commands I used:
Code:
wget http://iwf1.com/iwf-repo/parted.rar
unrar e parted.rar
sudo adb push parted /
sudo adb shell
~ # chmod +x parted
~ # ./parted /dev/block/mmcblk0 p
~ # umount /data
~ # umount /sdcard
~ # umount /cache
~ # ./parted /dev/block/mmcblk0 rm 25
~ # ./parted /dev/block/mmcblk0 rm 26
~ # ./parted /dev/block/mmcblk0 rm 27
~ # ./parted /dev/block/mmcblk0 rm 28
~ # ./parted /dev/block/mmcblk0 mkpart primary 193MB 2291MB
~ # ./parted /dev/block/mmcblk0 mkpart extended 2291MB 2322MB
~ # ./parted /dev/block/mmcblk0 mkpart primary 2322MB 3056MB
~ # ./parted /dev/block/mmcblk0 mkpart primary 3056MB 30.8GB
~ # ./parted /dev/block/mmcblk0 p
~ # ./parted /dev/block/mmcblk0 name 25 system
~ # ./parted /dev/block/mmcblk0 name 26 crypto
~ # ./parted /dev/block/mmcblk0 name 27 cache
~ # ./parted /dev/block/mmcblk0 name 28 userdata
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p25
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p27
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p28
~ # ./parted /dev/block/mmcblk0 p
~ # mount -a
~ # exit
# Download from here: http://www.androiddevs.net/downloads/
sudo adb push aosp_hammerhead-7.1-nougat-*.zip /data/
# Download from here: http://opengapps.org/
sudo adb push open_gapps-arm-7.1-stock-*.zip /data/
sudo adb reboot recovery
# Install the nougat rom through twrp...this will resize the /system partition back to 1GB!
sudo adb shell
~ # umount /system
~ # resize2fs -f /dev/block/mmcblk0p25 2000M
~ # mount -a
# Install opengapps in twrp
~ # exit
# Reboot into system through TWRP GUI
There were some logging errors with the SantoshM nougat rom I tried, but they had no impact. I am unmounting /sdcard and that's where it's trying to stash the logs, hence errors.
You can see that the offsets for the new partitions are 1024MB higher than the originals, meaning the partition will be 1GB bigger. Here's my final partition table:
Code:
Model: MMC SEM32G (sd/mmc)
Disk /dev/block/mmcblk0: 31.3GB
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.7MB 1049kB sbl1
3 68.7MB 69.2MB 524kB rpm
4 69.2MB 69.7MB 524kB tz
5 69.7MB 70.3MB 524kB sdi
6 70.3MB 70.8MB 524kB aboot
7 70.8MB 72.9MB 2097kB pad
8 72.9MB 73.9MB 1049kB sbl1b
9 73.9MB 74.4MB 524kB tzb
10 74.4MB 75.0MB 524kB rpmb
11 75.0MB 75.5MB 524kB abootb
12 75.5MB 78.6MB 3146kB modemst1
13 78.6MB 81.8MB 3146kB modemst2
14 81.8MB 82.3MB 524kB metadata
15 82.3MB 99.1MB 16.8MB misc
16 99.1MB 116MB 16.8MB ext4 persist
17 116MB 119MB 3146kB imgdata
18 119MB 142MB 23.1MB laf
19 142MB 165MB 23.1MB boot
20 165MB 188MB 23.1MB recovery
21 188MB 191MB 3146kB fsg
22 191MB 192MB 524kB fsc
23 192MB 192MB 524kB ssd
24 192MB 193MB 524kB DDR
25 193MB 2291MB 2098MB ext4 system
26 2291MB 2322MB 31.0MB crypto
27 2322MB 3056MB 734MB ext4 cache
28 3056MB 31.3GB 28.2GB ext4 userdata
29 31.3GB 31.3GB 5632B grow
When we resize /system, we're not quite giving it the whole space...I recommend running "resize2fs /dev/block/mmcblk0p25 2048M" and seeing the error...it's easier to adjust the actual filesystem size than the partition size, so we fudge it a bit here so long as it's safe. If this test is unsuccessful, it will tell you that you're allocating more blocks than you have. If it's successful, it'll tell you to run e2fsck...this is normal, and running the resize2fs command with the -f flag overrides that warning...but it'll also allow you to allocate too many blocks, hence why you run a test first as a sanity check. For this exact procedure, 2000M is the exact maximum size.
All in all, this technique can likely be adapted to other android phones. The key is making sure you resize system by the amount you take from data, and making sure you offset all partitions in between linearly by the correct amount. I'm not sure how updates will work...anything that basically lays down a partition is gonna cause issues since it'll try to resize to the default partition size. Anything just laying down new files should be fine.
Happy hacking!
I was looking for such an option as I wanted to install a bigger gapps package then just pico. But shrinking my userdata partition is not was i had in mind. I also really do not want to loose all my data, as i am leazy
so i was thinking about just resizing /cache to a bare minimum of lets say 128mb or even less. Because as i understand /cache is just used for OTA updates - if i am mistaken here, feel free to update my knowledge.
Has anybody done this? On the Galaxy Nexus this is the way to go afaik and one would not loose things in /data.
It worked, Thank you!
What i essentially did was make a nandroid backup followed by "adb pull /sdcard/" on the computer.
Followed your instructions (just before the flashing section), pushed the sdcard data back and restored the backup.
chowned and chmodded the /sdcard directory:
Code:
chown media_rw:media_rw /sdcard
chmod 755 /sdcard
Resized the /system bit, rebooted and hoped it wouldn't 'bootloop'.
The process was nerve wracking, but now the handset is ready for a future stable ROM (I'm still on stock).
So, we need to do
Code:
resize2fs -f /dev/block/mmcblk0p25 2000M
every time we flash a new ROM?
alexeius said:
So, we need to do
Code:
resize2fs -f /dev/block/mmcblk0p25 2000M
every time we flash a new ROM?
Click to expand...
Click to collapse
surfrock66 said:
All in all, this technique can likely be adapted to other android phones. The key is making sure you resize system by the amount you take from data, and making sure you offset all partitions in between linearly by the correct amount. I'm not sure how updates will work...anything that basically lays down a partition is gonna cause issues since it'll try to resize to the default partition size. Anything just laying down new files should be fine.
Happy hacking!
Click to expand...
Click to collapse
Depends on the ROM you're installing.​
Everyone must pay attention that this guide is for 32gb model........for 16gb commands are different.......pay attention else u brick seriously you phone.....
SoftWord said:
Everyone must pay attention that this guide is for 32gb model........for 16gb commands are different.......pay attention else u brick seriously you phone.....
Click to expand...
Click to collapse
Yes, this...my numbers show the methodology, but for the 16GB nexus 5 (or any other phone) you need to start by looking at the starting state of the partition table, then do the math from start to finish. I hope I've provided enough methodology and warnings that someone will either abort or do it right.
poioq said:
I was looking for such an option as I wanted to install a bigger gapps package then just pico. But shrinking my userdata partition is not was i had in mind. I also really do not want to loose all my data, as i am leazy
so i was thinking about just resizing /cache to a bare minimum of lets say 128mb or even less. Because as i understand /cache is just used for OTA updates - if i am mistaken here, feel free to update my knowledge.
Has anybody done this? On the Galaxy Nexus this is the way to go afaik and one would not loose things in /data.
Click to expand...
Click to collapse
In general I would say that's a very bad idea...however, if you're very careful and are willing to incur some risk, it could possibly work...on the N5, since the cache partition sits between system and userdata (and more importantly doesn't touch recovery) you could theoretically try it, and if it doesn't work, undo it, all while leaving your userdata partition untouched. If preserving your data is your goal...it's probably a bad idea, but that doesn't mean it isn't possible.
How about taking space from cache to userdata? 1-1,5GB'll be unused anyway and on 16gb variant it'll be nice to have some more memory to have
TL;DR
Success: Repartition of a Nexus 5 16GB
Success: Flash cm-14.1-20161028-UNOFFICIAL-hammerhead.zip
Success: Flash open_gapps-arm-7.1-stock-20161217.zip
FAIL: Getting through the Google/CM set up process (Google Play services crashes)
Success: Flash Aroma Gapps
Gapps selections:
Code:
AndroidPay=0
Books=0
CalculatorGoogle=1
CalendarGoogle=1
CalSync=0
CameraGoogle=1
Chrome=1
ClockGoogle=1
CloudPrint=0
ContactsGoogle=1
DialerFramework=1
DialerGoogle=1
DMAgent=0
Docs=0
Drive=0
Earth=0
ExchangeGoogle=0
FaceDetect=0
FaceUnlock=1
Fitness=1
GCS=1
Gmail=0
GoogleNow=0
GooglePlus=0
GoogleTTS=0
Hangouts=0
Hotword=0
Indic=0
Japanese=0
Keep=1
KeyboardGoogle=1
Korean=0
Maps=1
Messenger=0
Movies=0
Music=1
NewsStand=0
NewsWidget=0
PackageInstallerGoogle=0
Pinyin=0
PixelIcons=1
PixelLauncher=1
Photos=1
PlayGames=0
PrintServiceGoogle=0
ProjectFi=0
Sheets=0
Slides=0
Search=1
Speech=0
StorageManagerGoogle=0
Street=0
TagGoogle=0
Talkback=0
Translate=1
VRService=0
Wallpapers=1
WebViewGoogle=1
YouTube=1
Zhuyin=0
inclorexcl=1
Aim
To convert my Nexus 5 16GB into a Pixel using CM14.1 and Stock Open Gapps (I didn't want to keep flashing random pixel-experience.zip files)
Issue (strikethrough issues are with Stock Gapps)
When using Aroma Gapps:
1. Launcher3 crashes everytime the G search bar is clicked on
2. Google Now is not on the left pane despite my chosen packages
1. I couldn't Sign into my WiFi because no soft keyboard would appear (workaround: I created a password-less Hotspot on another phone)
2. I wasn't able to get past through the Google setup process; Google Play Services would crash every time I attempted to skip Tap & Go taking me back to a SIM card missing screen. On skipping this, I get taken to Tap & Go... and repeat
I've wiped all the caches (of course). If anyone has any ideas, it would be great.
Question to @surfrock66
You have a parted command that says:
Code:
~ # ./parted /dev/block/mmcblk0 mkpart primary 3056MB 30.8GB
Should this not be:
Code:
~ # ./parted /dev/block/mmcblk0 mkpart primary 3056MB 31.3GB
I may not have understood this fully
Thanks surfrock66 for the original method; my method varies slightly and is as follows:
Code:
Download and unpack parted.rar via the
# With phone in TWRP Recovery
$ sudo adb push parted /
$ sudo adb shell
~ # chmod +x parted
~ # ./parted /dev/block/mmcblk0 p
Model: MMC SEM16G (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.7MB 1049kB sbl1
3 68.7MB 69.2MB 524kB rpm
4 69.2MB 69.7MB 524kB tz
5 69.7MB 70.3MB 524kB sdi
6 70.3MB 70.8MB 524kB aboot
7 70.8MB 72.9MB 2097kB pad
8 72.9MB 73.9MB 1049kB sbl1b
9 73.9MB 74.4MB 524kB tzb
10 74.4MB 75.0MB 524kB rpmb
11 75.0MB 75.5MB 524kB abootb
12 75.5MB 78.6MB 3146kB modemst1
13 78.6MB 81.8MB 3146kB modemst2
14 81.8MB 82.3MB 524kB metadata
15 82.3MB 99.1MB 16.8MB misc
16 99.1MB 116MB 16.8MB ext4 persist
17 116MB 119MB 3146kB imgdata
18 119MB 142MB 23.1MB laf
19 142MB 165MB 23.1MB boot
20 165MB 188MB 23.1MB recovery
21 188MB 191MB 3146kB fsg
22 191MB 192MB 524kB fsc
23 192MB 192MB 524kB ssd
24 192MB 193MB 524kB DDR
25 193MB 1267MB 1074MB ext4 system
26 1267MB 1298MB 31.5MB crypto
27 1298MB 2032MB 734MB ext4 cache
28 2032MB 15.8GB 13.7GB ext4 userdata
29 15.8GB 15.8GB 5632B grow
~ # umount /data
~ # umount /sdcard
~ # umount /cache
~ # ./parted /dev/block/mmcblk0 rm 25
~ # ./parted /dev/block/mmcblk0 rm 26
~ # ./parted /dev/block/mmcblk0 rm 27
~ # ./parted /dev/block/mmcblk0 rm 28
~ # ./parted /dev/block/mmcblk0 mkpart primary 193MB 2291MB
~ # ./parted /dev/block/mmcblk0 mkpart extended 2291MB 2322MB
~ # ./parted /dev/block/mmcblk0 mkpart primary 2322MB 3056MB
~ # ./parted /dev/block/mmcblk0 mkpart primary 3056MB 15.8GB
~ # ./parted /dev/block/mmcblk0 p
~ # ./parted /dev/block/mmcblk0 name 25 system
~ # ./parted /dev/block/mmcblk0 name 26 crypto
~ # ./parted /dev/block/mmcblk0 name 27 cache
~ # ./parted /dev/block/mmcblk0 name 28 userdata
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p25
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p27
~ # mke2fs -b 4096 -T ext4 /dev/block/mmcblk0p28
~ # ./parted /dev/block/mmcblk0 p
~ # mount -a
~ # exit
Model: MMC SEM16G (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.7MB 1049kB sbl1
3 68.7MB 69.2MB 524kB rpm
4 69.2MB 69.7MB 524kB tz
5 69.7MB 70.3MB 524kB sdi
6 70.3MB 70.8MB 524kB aboot
7 70.8MB 72.9MB 2097kB pad
8 72.9MB 73.9MB 1049kB sbl1b
9 73.9MB 74.4MB 524kB tzb
10 74.4MB 75.0MB 524kB rpmb
11 75.0MB 75.5MB 524kB abootb
12 75.5MB 78.6MB 3146kB modemst1
13 78.6MB 81.8MB 3146kB modemst2
14 81.8MB 82.3MB 524kB metadata
15 82.3MB 99.1MB 16.8MB misc
16 99.1MB 116MB 16.8MB ext4 persist
17 116MB 119MB 3146kB imgdata
18 119MB 142MB 23.1MB laf
19 142MB 165MB 23.1MB boot
20 165MB 188MB 23.1MB recovery
21 188MB 191MB 3146kB fsg
22 191MB 192MB 524kB fsc
23 192MB 192MB 524kB ssd
24 192MB 193MB 524kB DDR
25 193MB 2291MB 2098MB ext4 system
26 2291MB 2322MB 31.0MB crypto
27 2322MB 3056MB 734MB ext4 cache
28 3056MB 15.8GB 12.7GB ext4 userdata
29 15.8GB 15.8GB 5632B grow
# This didn't work for me
$ sudo adb push cm-14.1-20161028-UNOFFICIAL-hammerhead.zip /
$ sudo adb push open_gapps-arm-7.1-stock-20161217.zip /
$ sudo adb reboot recovery
# So I copied over the files once I reboot into recovery
# I had to reboot into recovery again to see my CM14.1 and Gapps files
# Flashed them using TWRP
$ sudo adb shell
~ # unmount /system/
/sbin/sh: unmount: not found
# I have no idea why this happened
~ # resize2fs -f /dev/block/mmcblk0p25 2000M
resize2fs 1.42.9 (28-Dec-2013)
Resizing the filesystem on /dev/block/mmcblk0p25 to 512000 (4k) blocks.
The filesystem on /dev/block/mmcblk0p25 is now 512000 blocks long.
~ # mount -a
mount: mounting /dev/block/mmcblk0p1 on /firmware failed: Invalid argument
mount: mounting /usb-otg on vfat failed: No such file or directory
# I have no idea why this happened either
~ # exit
@surfrock66 Hi, is the same way for n7 (2013) 32gb?
Thanks
Sent from my Nexus 7 using XDA-Developers mobile app
jordirpz said:
@surfrock66 Hi, is the same way for n7 (2013) 32gb?
Thanks
Click to expand...
Click to collapse
No, this is not necessarily true. You will need to use Parted to analyse the partitions and then make the relevant modifications. Again, do not try this unless you are willing to potentially brick your device.
@surfrock66
Faied copy parted to //parted : read-only file system
Whats hapend?
Sent from my Nexus 7 using XDA-Developers mobile app
jordirpz said:
@surfrock66
Faied copy parted to //parted : read-only file system
Whats hapend?
Sent from my Nexus 7 using XDA-Developers mobile app
Click to expand...
Click to collapse
In TWRP, you have to choose to mount your system as read/write, for me with TWRP 3.x it's an option right when TWRP starts. If you don't do that, you can't write to / and thus can't copy the file over.
surfrock66 said:
In TWRP, you have to choose to mount your system as read/write, for me with TWRP 3.x it's an option right when TWRP starts. If you don't do that, you can't write to / and thus can't copy the file over.
Click to expand...
Click to collapse
Ok thank you.
Other question please. Adb Shell steps, works in trwp or i need mount system and reboot system for make it? Thank you
Sent from my Nexus 7 using XDA-Developers mobile app
jordirpz said:
Ok thank you.
Other question please. Adb Shell steps, works in trwp or i need mount system and reboot system for make it? Thank you
Sent from my Nexus 7 using XDA-Developers mobile app
Click to expand...
Click to collapse
All done while in twrp.
surfrock66 said:
All done while in twrp.
Click to expand...
Click to collapse
Ok, thanks for you awesome guide.
For me works, now i have 2gb in system?
Sorry for ETA: can you in near future make a reparted file and guide for N7 2013 wifi please?
Sent from my Nexus 7 using XDA-Developers mobile app
jordirpz said:
Ok, thanks for you awesome guide.
For me works, now i have 2gb in system?
Sorry for ETA: can you in near future make a reparted file and guide for N7 2013 wifi please?
Sent from my Nexus 7 using XDA-Developers mobile app
Click to expand...
Click to collapse
I don't have that device, but the original post here should have everything you need to re-create the process for another device. You'll have to re-calculate the offsets based on what you find when you run the original partition query.
souheil said:
Depends on the ROM you're installing.​
Click to expand...
Click to collapse
Just to double check.
Any ideas of what ROMs would need this?
I'm interested of the cyanogenmod in my particular case.
ricardo.adao said:
Just to double check.
Any ideas of what ROMs would need this?
I'm interested of the cyanogenmod in my particular case.
Click to expand...
Click to collapse
CM14.1 fits on the Nexus 5 /system partition WITHOUT repartitioning.
I wanted to try this because I want to flash Stock Gapps (as opposed to Nano), hoping to get a Pixel-like experience as described in my previous post (http://forum.xda-developers.com/showpost.php?p=70145560&postcount=10). However, I had lots of crashes with Stock Gapps.
Instead, I now use CM14.1 with Nano Gapps.
If you want a more Pixel-like experience, that side-loading doesn't provide (no Google Now on the left side of the Homescreen, no Pixel-like animations on clicking the G Search Bar), I have resorted to installing the Pixel Launcher and Wallpaper APKs into /system.
Instructions found: http://android.stackexchange.com/questions/76976/how-to-install-app-as-system-app
Re-flashing a ROM will require you to re-do these steps.

[Guide] [Parted] [Noob-Friendly] Decrease /system Partition to Expand /data Partition [Z00L]

Basic Ideas—QnA​Q: Why would You want to extend Your /data (userdata) partition (Internal Memory Storage)
A: Of course to gives You a lot more space for Files, & Apps to be installed.
Q: What's things You will need to do this?
A: Parted, & mkfs.ext4. Parted to edit Your partition, & mkfs.ext4 to formats a partition to EXT4 file system.
Q: Will it works on my Zenfone 2 Laser?
A: Most likely, Yes. But I'm partitioning on Z00L model, maybe there's some adjustment to be made to work on for Your phone model if different.
Before proceeding any further You may want:​a. Do a full backup of Your phone to the data of Your phone including your personal data, & files!
b. Prepare a computer or such
c. Having a good USB Micro-B cable. If Your don't have any or broken, You can use USB Type C cable, & USB OTG Micro-B
d. Be patient, brave, & good luck!
If You so choose to proceed, remember:​
/*
* Your warranty is now void.
*
* I'm not responsible for bricked devices, dead SD cards,
* thermonuclear war, or You getting fired because the alarm app failed. Please
* do some research if You have any concerns about features included in this tools
* before doing it! YOU are choosing to make these modifications, and if
* You point the finger at us for messing up Your device, we will laugh at You.
*
*/
Click to expand...
Click to collapse
Now Let's Get Started​
Spoiler: Good Luck!
I. Download:​- Android SDK Platform Tools HERE Extract it (e.g. C:\adb)
- Parted, & mkfs.ext4 HERE Extract it somewhere, & copy the folder location, we will get back to this later!
- A TWRP backup of 'LineageOS [17.1] [18.1] [Fork]' Z00L compiled by @markkiths with NikGApps Core HERE Extract it somewhere, & copy the TWRP folder location, we will get back to this later! (Note: AOSP Keyboard, WebView. & all Forks Apps is removed. You may want to use adb install command or download the apk to the MicroSD to install Gboard, & WebView to get the virtual keyboard working, & able to login to Your Google account
- Android 6 Marshmallow Fastboot stock ROM in case You Hard Brick Your phone HERE See step III if You encountered this problem
- Latest TWRP Z00L Z00T
II. Things to do, & Commands:​a. Plug Your phone to computer while in TWRP, & MTP Enabled (Mount > Enable MTP). Then open Terminal on a folder that contains the Android SDK Platform Tools:
→ Windows: Command Prompt or Terminal
→ Linux distros: Terminal
→ macOS: Terminal
Click to expand...
Click to collapse
b. Push (Copy) Parted, & mkfs.ext4 to /sbin:
> adb devices
> adb push parted /sbin
> adb push mkfs.ext4 /sbin
c. Now You shell into it, & set 777 permission to get the files working:
> adb shell
~ # chmod 777 /sbin/parted
~ # chmod 777 /sbin/mkfs.ext4
Now Disable MTP & untick all partitions in Mount menu. You may want to adb shell again
d. Parted into partition of the phone's MMC:
~ # parted /dev/block/mmcblk0
e. List current unmodified partitions:
(parted) print
The output would looks like:
Model: MMC R1J96N (sd/mmc)
Disk /dev/block/mmcblk0: 15.8GB
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 17.4kB 1328kB 1311kB sbl1
2 1328kB 2639kB 1311kB sbl1bak msftdata
3 2639kB 3163kB 524kB rpm
4 3163kB 3687kB 524kB rpmbak msftdata
5 3687kB 4212kB 524kB tz
6 4212kB 4736kB 524kB tzbak msftdata
7 4736kB 5260kB 524kB hyp
8 5260kB 5785kB 524kB hypbak msftdata
9 5785kB 5817kB 32.8kB DDR
10 5817kB 5826kB 8192B ssd
11 5826kB 5842kB 16.4kB sec
12 5842kB 11.1MB 5243kB aboot
13 16.8MB 22.0MB 5243kB abootbak msftdata
14 22.0MB 27.3MB 5243kB splash
15 27.3MB 28.3MB 1049kB devinfo
16 33.6MB 35.1MB 1573kB fsg
17 35.1MB 35.1MB 1024B fsc
18 35.1MB 36.7MB 1573kB modemst1
19 36.7MB 38.3MB 1573kB modemst2
20 38.3MB 48.8MB 10.5MB ext4 factory
21 48.8MB 59.2MB 10.5MB factorybak
22 59.2MB 60.3MB 1049kB asuskey
23 60.3MB 61.3MB 1049kB asuskey2
24 61.3MB 62.4MB 1049kB asuskey3
25 62.4MB 63.4MB 1049kB asuskey4
26 63.4MB 64.5MB 1049kB asuskey5
27 64.5MB 65.5MB 1049kB asusgpt
28 65.5MB 66.6MB 1049kB asusgpt1
29 66.6MB 67.6MB 1049kB asusgpt2
30 67.6MB 68.7MB 1049kB misc
31 68.7MB 69.2MB 524kB keystore
32 69.2MB 69.2MB 32.8kB config
33 69.2MB 103MB 33.6MB ext4 asdf
34 103MB 105MB 2097kB abootdebug
35 105MB 106MB 1049kB persistent
36 117MB 151MB 33.6MB oem
37 151MB 185MB 33.6MB boot
38 185MB 218MB 33.6MB recovery
39 218MB 252MB 33.6MB ext4 persist
40 252MB 268MB 16.8MB asusfw
41 268MB 336MB 67.1MB fat16 modem msftdata
42 336MB 369MB 33.6MB ext4 ADF msftdata
43 369MB 587MB 218MB ext4 APD msftdata
44 587MB 621MB 33.6MB ext4 cache
45 621MB 3842MB 3221MB ext4 system
46 3842MB 15.8GB 11.9GB ext4 userdata
Click to expand...
Click to collapse
f. Change the unit to byte:
(parted) unit b
You could list the partitions again by typing print to see in bytes
Model: MMC R1J96N (sd/mmc)
Disk /dev/block/mmcblk0: 15758000128B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
1 17408B 1328127B 1310720B sbl1
2 1328128B 2638847B 1310720B sbl1bak msftdata
3 2638848B 3163135B 524288B rpm
4 3163136B 3687423B 524288B rpmbak msftdata
5 3687424B 4211711B 524288B tz
6 4211712B 4735999B 524288B tzbak msftdata
7 4736000B 5260287B 524288B hyp
8 5260288B 5784575B 524288B hypbak msftdata
9 5784576B 5817343B 32768B DDR
10 5817344B 5825535B 8192B ssd
11 5825536B 5841919B 16384B sec
12 5841920B 11084799B 5242880B aboot
13 16777216B 22020095B 5242880B abootbak msftdata
14 22020096B 27262975B 5242880B splash
15 27262976B 28311551B 1048576B devinfo
16 33554432B 35127295B 1572864B fsg
17 35127296B 35128319B 1024B fsc
18 35128320B 36701183B 1572864B modemst1
19 36701184B 38274047B 1572864B modemst2
20 38274048B 48759807B 10485760B ext4 factory
21 48759808B 59245567B 10485760B factorybak
22 59245568B 60294143B 1048576B asuskey
23 60294144B 61342719B 1048576B asuskey2
24 61342720B 62391295B 1048576B asuskey3
25 62391296B 63439871B 1048576B asuskey4
26 63439872B 64488447B 1048576B asuskey5
27 64488448B 65537023B 1048576B asusgpt
28 65537024B 66585599B 1048576B asusgpt1
29 66585600B 67634175B 1048576B asusgpt2
30 67634176B 68682751B 1048576B misc
31 68682752B 69207039B 524288B keystore
32 69207040B 69239807B 32768B config
33 69239808B 102794239B 33554432B ext4 asdf
34 102794240B 104891391B 2097152B abootdebug
35 104891392B 105939967B 1048576B persistent
36 117440512B 150994943B 33554432B oem
37 150994944B 184549375B 33554432B boot
38 184549376B 218103807B 33554432B recovery
39 218103808B 251658239B 33554432B ext4 persist
40 251658240B 268435455B 16777216B asusfw
41 268435456B 335544319B 67108864B fat16 modem msftdata
42 335544320B 369098751B 33554432B ext4 ADF msftdata
43 369098752B 587202559B 218103808B ext4 APD msftdata
44 587202560B 620756991B 33554432B ext4 cache
45 620756992B 3841982463B 3221225472B ext2 system
46 3841982464B 15757983231B 11916000768B ext4 userdata
Click to expand...
Click to collapse
From this point onward DO NOT do stupid stuffs, like delete unmentioned partitions! You have been warned!
g. Remove partition of userdata, & system:
(parted) rm 46
(parted) rm 45
h. Create, name, & set flag for the new system partition: You could use this tool to convert from Gigabytes to Bytes for more precise result
(parted) mkpart system ext4 620756992 2365985773 Remember: It now only have 2 MB left on Your /system partition. You may either can't really tinker much with the bootanimation.zip nor the Media sounds on /system/product/media to Your liking
Here's You realized there are 2 values. The 620756992 as Start Address, & 2365985773 as End Address. Here's some explanation to specify each address:
→ By adding 1 byte from previous partition: 620756991+1=620756992 ← You got Your Start Address for system partition!
→ By adding Start Address + Your decided value (In my case I just want 1.69 GB or 1,745,228,781 Bytes): 620756992+1745228781=2365985773 ← You got Your End Address for system partition!
Click to expand...
Click to collapse
(parted) name 45 system
(parted) set 45 msftdata on
i. List the Free Space:
(parted) p free
The output would looks like:
Model: MMC R1J96N (sd/mmc)
Disk /dev/block/mmcblk0: 15758000128B
Sector size (logical/physical): 512B/512B
Partition Table: gpt
Disk Flags:
Number Start End Size File system Name Flags
7168B 17407B 10240B Free Space
1 17408B 1328127B 1310720B sbl1
2 1328128B 2638847B 1310720B sbl1bak msftdata
3 2638848B 3163135B 524288B rpm
4 3163136B 3687423B 524288B rpmbak msftdata
5 3687424B 4211711B 524288B tz
6 4211712B 4735999B 524288B tzbak msftdata
7 4736000B 5260287B 524288B hyp
8 5260288B 5784575B 524288B hypbak msftdata
9 5784576B 5817343B 32768B DDR
10 5817344B 5825535B 8192B ssd
11 5825536B 5841919B 16384B sec
12 5841920B 11084799B 5242880B aboot
11084800B 16777215B 5692416B Free Space
13 16777216B 22020095B 5242880B abootbak msftdata
14 22020096B 27262975B 5242880B splash
15 27262976B 28311551B 1048576B devinfo
28311552B 33554431B 5242880B Free Space
16 33554432B 35127295B 1572864B fsg
17 35127296B 35128319B 1024B fsc
18 35128320B 36701183B 1572864B modemst1
19 36701184B 38274047B 1572864B modemst2
20 38274048B 48759807B 10485760B ext4 factory
21 48759808B 59245567B 10485760B factorybak
22 59245568B 60294143B 1048576B asuskey
23 60294144B 61342719B 1048576B asuskey2
24 61342720B 62391295B 1048576B asuskey3
25 62391296B 63439871B 1048576B asuskey4
26 63439872B 64488447B 1048576B asuskey5
27 64488448B 65537023B 1048576B asusgpt
28 65537024B 66585599B 1048576B asusgpt1
29 66585600B 67634175B 1048576B asusgpt2
30 67634176B 68682751B 1048576B misc
31 68682752B 69207039B 524288B keystore
32 69207040B 69239807B 32768B config
33 69239808B 102794239B 33554432B ext4 asdf
34 102794240B 104891391B 2097152B abootdebug
35 104891392B 105939967B 1048576B persistent
105939968B 117440511B 11500544B Free Space
36 117440512B 150994943B 33554432B oem
37 150994944B 184549375B 33554432B boot
38 184549376B 218103807B 33554432B recovery
39 218103808B 251658239B 33554432B ext4 persist
40 251658240B 268435455B 16777216B asusfw
41 268435456B 335544319B 67108864B fat16 modem msftdata
42 335544320B 369098751B 33554432B ext4 ADF msftdata
43 369098752B 587202559B 218103808B ext4 APD msftdata
44 587202560B 620756991B 33554432B ext4 cache
45 620756992B 2365985773B 1016468480B ext4 system msftdata
2365985774B 15757993471B 14120768000B Free Space
Click to expand...
Click to collapse
j. Create, name, & set flag for the new userdata partition:
(parted) mkpart userdata ext4 2365985774 15757993471
More or less to specify Start Address, & End Address for userdata partition is same as before. Here's quick sums up:
→ 2365985773 is added 1 byte to the End Address of system partition (2365985773+1)
→ 15757993471 is just the maximum MMC range
Click to expand...
Click to collapse
You may get this warning just answer it with y, & i:
Warning: You requested a partition from 2389054446B to 15757992960B (sectors
3197706..30777330).
The closest location we can manage is 2389054446B to 15757982720B (sectors
3197706..30777310).
Is this still acceptable to you?
Yes/No? y
Warning: The resulting partition is not properly aligned for best performance.
Ignore/Cancel? i
Click to expand...
Click to collapse
(parted) name 46 userdata
(parted) set 46 msftdata on
k. Now quit parted, & format system partition using EXT2 file system, & userdata partition using EXT4 file system:
(parted) quit
~ # mkfs.ext2 /dev/block/mmcblk0p45
Why not format system partition with EXT4? I'm just follows phone's default file system!
~ # mkfs.ext4 /dev/block/mmcblk0p46
Now remount the partitions by typing: mount /dev/block/mmcblk0p45 /system_root, & mount /dev/block/mmcblk0p46 /data
l. Now exit out the adb shell, & push (Copy) a gigs or more file to Your Internal Memory to prevent system partition from messing up: Your phone may restart near the completion of pushing 'system.ext4.win000' file, Calm down it's normal!
~ # exit
> adb push "YourExtractionLocation\TWRP" /sdcard
m. If Your phone rebooted into Fastboot Mode by itself just pulled out the battery, & get back to TWRP by pressing Down Volume Button with Power Button (Note: If You immediately see the screen just go blank, while the phone being turned on, & when plugged into the computer there are many partitions mounted. That means You unfortunately Hard Brick Your phone. See step III below to Unbrick it), & push the TWRP folder once more: Most likely it will be copied successfully without errors!
> adb push "YourExtractionLocation\TWRP" /sdcard
Now You can re-enable MTP in TWRP > Mount, & do adb kill-server then eject Your phone from the computer
n. Now Restore in TWRP menu or flash a new ROM that You may want to modify it with Jancox Tool Unpack Repack ROMs. Done! You now can setup Your phone. To check if You actually expand Your /data partition:
TWRP or Terminal: df -h
Android: Link2SD or DiskInfo
​III. Unbrick Your Phone:​a. Boot into Fastboot Mode (Pressing Volume Up + Power Button), & plug Your phone to the computer
b. Extract the Fastboot ROM zip, & run the flashall_AFT.cmd then wait until it completes (Note: For some reason it still have Bootloader Unlocked. So no need to reunlock it!)
c. When completes, just open Terminal then type fastboot flash recovery twrp-x.x.x_x-x-Z00x.img
d. Then boot into TWRP fastboot boot recovery
e. Now you get Your TWRP back, up & running again!
​IV. Extras:​a. Want custom accent color? Use Accent Colour Creator
b. Want custom Dark Theme Color Bucket other than Pitch Black & Android 12 Dark? Use APK Editor Studio & copy the SystemDark12Overlay.apk from /system/product/overlay/SystemDark12. Edit it on APK Editor Studio then modify the colors.xml & style.xml in /res/values-night folder. Lastly change the package="com.custom.dtcb.name" in AndroidManifest.xml then Save the APK & install it on to Your phone
Spoiler: ⚠️ For Specific¹ Purpose Only
¹ Finding the exact start-end address for extreme storage saving on specific ROM. The free space that'll be available is 20.48 kB.
You may not run this multiple lines of codes without knowing their real function is. If you're running this codes, & your phone got hard bricked that's aren't my problems! That's your typos, miscopied problem!
Code:
adb push mkfs.ext4 /sbin
adb push parted /sbin
adb shell
chmod 777 /sbin/parted
chmod 777 /sbin/mkfs.ext4
parted /dev/block/mmcblk0
unit b
p free
rm 46
rm 45
mkpart system ext4 620756992 2352082431
name 45 system
set 45 msftdata on
mkpart userdata ext4 2352082432 15757983231
y
i
name 46 userdata
set 46 msftdata on
quit
mkfs.ext2 /dev/block/mmcblk0p45
mkfs.ext4 /dev/block/mmcblk0p46
mount /dev/block/mmcblk0p45 /system_root
mount /dev/block/mmcblk0p46 /data
exit
If you're facing 1 of this problem while you Restore Backup in TWRP:
extractTarFork() process ended with ERORR; 255 Then the way to fix it to extend /system by repartition your EMMC with value of the subtraction from the Progress Value that shown just right before it's outputs the error message by the Total Backup Size of /system Partition.
extractTarFork() process ended with ERORR; 9 Then you must recreate the backup. It's caused by formatting the /data partition using TWRP's built in EXT4 formatter especially after you reboot & after partitioned the EMMC, or you didn't answer the last mounted on question after the 21ˢᵗ command has been executed.
Credits:​Thanks to Hovatek for being the first to actually demonstrate it on physical device, & providing the necessary files
Thanks to @markkiths for compiles, & providing LineageOS/Fork 18.1
Thanks to NikGApps for providing GApps for Android 11
Run into problem? Write it down below! I'll try my best to help You out.​

Categories

Resources