[DEV][ Expand System Partition To 4GB - P9 Lite ]

Search This thread

surdu_petru

Recognized Contributor
Feb 3, 2010
7,082
23,048
Paris
Hello !

Here you will find the information needed to change the system partition from 2GB to 4GB - this operation is somewhat useful for installing any version of GApps on your device using LOS 17.1 Android 10 : Huawei P9 Lite Kirin version !


Download mkfs.ext4 and parted from here : https://forum.xda-developers.com/attachments/parted_gdisk_fdisk_mkfs-ext4-arm-zip.4494671/


Warning I: the entire data partition will be deleted following this procedure, make sure you have backed up and saved it to a microsd card

Warning II: if you have sound issues, please check Step III !

Step I : extended system partition from about 2GB to 4GB ( example for a device with 16GB )

- extract "mkfs.ext4" and "parted" from previously download archive and put them into a new created tmp directory
- connect the device to the computer via the USB cable and bring the device into TWRP revovery with this command :
> adb reboot recovery
- copy the two executable files from the computer to the device :
> adb push tmp data/local
> adb shell
# cp -r data/local/tmp/mkfs.ext4 sbin/mkfs.ext4
# chmod 0777 sbin/mkfs.ext4
# cp -r data/local/tmp/parted sbin/parted
# chmod 0777 sbin/parted
- launch the "parted" function as follows :
# parted /dev/block/mmcblk0
- display all properties of all partitions : (I wrote what needs to be displayed as a command before pressing enter, so you just have to type "print" and press enter because (parted) is already displayed as promter ... be careful not to type (parted) twice in the following commands)
(parted) print
- go to line 44, which should be the same for all devices :
44 1057MB 3137MB 2080MB ext2 system msftdata
45 3137MB 3339MB 201MB ext4 cust msftdata
46 3339MB 3372MB 33.6MB ext4 version msftdata
47 3372MB 4010MB 638MB ext2 vendor msftdata
48 4010MB 4211MB 201MB ext4 product msftdata
49 4211MB 15.8GB 11.5GB userdata msftdata

- if line 44 is not identical to this one here, please stop the process by writing quit and enter, I'm waiting for a private message with what is written on line 44 in the case of your device so that I can guide you correctly .
- assuming that all devices have the same system partition ( the same 44 line ) - approximately 2GB, we go to the next steps:
- access the Mount menu in TWRP and uncheck Data, and follow the steps below step by step :
(parted) rm 49
(parted) rm 48
(parted) rm 47
(parted) rm 46
(parted) rm 45
(parted) rm 44
(parted) mkpart system ext2 1057 5319
(parted) name 44 system
(parted) set 44 msftdata on
(parted) mkpart cust ext4 5319 5521
(parted) name 45 cust
(parted) set 45 msftdata on
(parted) mkpart version ext4 5521 5554
(parted) name 46 version
(parted) set 46 msftdata on
(parted) mkpart vendor ext2 5554 6192
(parted) name 47 vendor
(parted) set 47 msftdata on
(parted) mkpart product ext4 6192 6393
(parted) name 48 product
(parted) set 48 msftdata on
- for devices with 16GB :
(parted) mkpart userdata 6393 15.8GB
- for devices with 32GB :
(parted) mkpart userdata 6393 31.3GB
- for devices with 64GB :
(parted) mkpart userdata 6393 62.5GB
(parted) name 49 userdata
(parted) set 49 msftdata on
(parted) quit

Step II : activating partitions for reuse :

# mkfs.ext4 /dev/block/mmcblk0p44
# mkfs.ext4 /dev/block/mmcblk0p45
# mkfs.ext4 /dev/block/mmcblk0p46
# mkfs.ext4 /dev/block/mmcblk0p47
# mkfs.ext4 /dev/block/mmcblk0p48
# mkfs.ext4 /dev/block/mmcblk0p49
- go to TWRP -> Wipe -> Advanced Wipe -> select System -> Repair or Change File System -> Change File System -> EXT4 -> Swipe to Change
- go to TWRP -> Wipe -> Advanced Wipe -> select Vendor -> Repair or Change File System -> Change File System -> EXT4 -> Swipe to Change
- go to TWRP -> Wipe -> Format Data -> yes
- reboot device from TWRP to TWRP in order to use data again after formated !
- go to TWRP -> Wipe -> Advanced Wipe -> select Dalvik/ART Cache, Cache, Data, Internal Storage, System, Vendor -> Swipe to wipe
- copy the new updated of LOS 17.1 with system partition of 4GB into your device
- copy any GApps arm64 Android 10 to your device
- Install them like always, enjoy !

Reboot to System in order to enjoy your Android 10 with almost any version of GApps !

Step III: flash back product image to fix sound issues !

- download product.img md5: 848880f9b74686394b0b4667620b5682
- go to TWRP and copy product.img on your internal memory
- flash product image to product partition :
> adb shell
# dd if=/sdcard/product.img of=/dev/block/bootdevice/by-name/product
393216+0 records in
393216+0 records out
201326592 bytes (192 M) copied, 10.460969 s, 18 M/s
# reboot


That's all !
 
Last edited:
  • Like
Reactions: 2ley and -Alf-

alterschalter

Member
Mar 26, 2022
6
1
Hey @surdu_petru, thank you for outlining the steps because I wanted to upgrade to the recent version.
I followed along until rebooting from TWRP into TWRP:
- reboot device from TWRP to TWRP in order to use data again after formated !
However, at that point I cannot make it into TWRP anymore. Upon booting the phone only makes it into FASTBOOT&RESCUE MODE and an error is shown "reboot_enter_fastboot_common_func". The phone does not respond to any fastboot commands from PC at this point and I seem to be stuck. Not sure what went wrong here. Do you maybe have an idea what went wrong for me and I can get into TWRP? On the screen it says "PHONE Unlocked" and "FRP Locked". Before I was using your latest build from before May. Thanks a lot.

Edit: Never mind. I got it to boot into TWRP eventually. Not sure why it did not work initially. After being able to boot into TWRP I was able to follow through and now got the latest build installed and it solved my issue with F-Droid and subtracks.

Thanks for keeping this old phone alive, which my daughter can now use to listen to audiobooks.
 
Last edited:

surdu_petru

Recognized Contributor
Feb 3, 2010
7,082
23,048
Paris
Hey @surdu_petru, thank you for outlining the steps because I wanted to upgrade to the recent version.
I followed along until rebooting from TWRP into TWRP:

However, at that point I cannot make it into TWRP anymore. Upon booting the phone only makes it into FASTBOOT&RESCUE MODE and an error is shown "reboot_enter_fastboot_common_func". The phone does not respond to any fastboot commands from PC at this point and I seem to be stuck. Not sure what went wrong here. Do you maybe have an idea what went wrong for me and I can get into TWRP? On the screen it says "PHONE Unlocked" and "FRP Locked". Before I was using your latest build from before May. Thanks a lot.
I don't know exactly what you did wrong ... and my device has reached this state but I managed to start it in TWRP recovery! Since the device is in fastboot mode, hold down the power button until the device turns off, and at this point press and hold the plus volume key until TWRP recovery enters!

EDIT :
If you have FRP Locked, than you can't use fastboot comands ... try to enter into TWRP in order to recover your device !
 

alterschalter

Member
Mar 26, 2022
6
1
Eventually I was able to boot into TWRP and could follow through. Thanks for the detailed description of all steps. Finally I can use the old phone with Android 10. Thanks a lot.
 
  • Like
Reactions: surdu_petru

Olliblacklist

Member
Sep 17, 2018
14
0
ciao vorrei espandere la partizione di sistema ma con adb non va che si fa per andare in recovery ma poi faccio adb push ma mi da errore non so come mi aiuti a farove? o se c'è un file zip più semplice aspetto una risposta grazie
 

Olliblacklist

Member
Sep 17, 2018
14
0
hello I would like to expand the system partition but with adb it does not go that is I do to go to recovery but then I do adb push but it gives me an error I do not know how to do you help me to farove? or if there is a simpler zip file I wait for an answer thanks
 

surdu_petru

Recognized Contributor
Feb 3, 2010
7,082
23,048
Paris
hello I would like to expand the system partition but with adb it does not go that is I do to go to recovery but then I do adb push but it gives me an error I do not know how to do you help me to farove? or if there is a simpler zip file I wait for an answer thanks
No, there is no simple zip for install via TWRP, you should try to fix your issues by installing correct drivers and adb, fastboot commands on your desktop !
 

EndemicRocket

New member
May 25, 2022
3
0
> adb push tmp data/local
When I run that, I get an error, which is this one: (Using Huawei P9 Lite VNS-L31)
failed to copy 'tmp/parted' to 'data/local/parted': secure_mkdirs failed: No such file or directory

Could you please help me?
Thanks.

Here's the screenshot.
1653487401298.png
 

surdu_petru

Recognized Contributor
Feb 3, 2010
7,082
23,048
Paris

Top Liked Posts

  • There are no posts matching your filters.
  • 2
    Hello !

    Here you will find the information needed to change the system partition from 2GB to 4GB - this operation is somewhat useful for installing any version of GApps on your device using LOS 17.1 Android 10 : Huawei P9 Lite Kirin version !


    Download mkfs.ext4 and parted from here : https://forum.xda-developers.com/attachments/parted_gdisk_fdisk_mkfs-ext4-arm-zip.4494671/


    Warning I: the entire data partition will be deleted following this procedure, make sure you have backed up and saved it to a microsd card

    Warning II: if you have sound issues, please check Step III !

    Step I : extended system partition from about 2GB to 4GB ( example for a device with 16GB )

    - extract "mkfs.ext4" and "parted" from previously download archive and put them into a new created tmp directory
    - connect the device to the computer via the USB cable and bring the device into TWRP revovery with this command :
    > adb reboot recovery
    - copy the two executable files from the computer to the device :
    > adb push tmp data/local
    > adb shell
    # cp -r data/local/tmp/mkfs.ext4 sbin/mkfs.ext4
    # chmod 0777 sbin/mkfs.ext4
    # cp -r data/local/tmp/parted sbin/parted
    # chmod 0777 sbin/parted
    - launch the "parted" function as follows :
    # parted /dev/block/mmcblk0
    - display all properties of all partitions : (I wrote what needs to be displayed as a command before pressing enter, so you just have to type "print" and press enter because (parted) is already displayed as promter ... be careful not to type (parted) twice in the following commands)
    (parted) print
    - go to line 44, which should be the same for all devices :
    44 1057MB 3137MB 2080MB ext2 system msftdata
    45 3137MB 3339MB 201MB ext4 cust msftdata
    46 3339MB 3372MB 33.6MB ext4 version msftdata
    47 3372MB 4010MB 638MB ext2 vendor msftdata
    48 4010MB 4211MB 201MB ext4 product msftdata
    49 4211MB 15.8GB 11.5GB userdata msftdata

    - if line 44 is not identical to this one here, please stop the process by writing quit and enter, I'm waiting for a private message with what is written on line 44 in the case of your device so that I can guide you correctly .
    - assuming that all devices have the same system partition ( the same 44 line ) - approximately 2GB, we go to the next steps:
    - access the Mount menu in TWRP and uncheck Data, and follow the steps below step by step :
    (parted) rm 49
    (parted) rm 48
    (parted) rm 47
    (parted) rm 46
    (parted) rm 45
    (parted) rm 44
    (parted) mkpart system ext2 1057 5319
    (parted) name 44 system
    (parted) set 44 msftdata on
    (parted) mkpart cust ext4 5319 5521
    (parted) name 45 cust
    (parted) set 45 msftdata on
    (parted) mkpart version ext4 5521 5554
    (parted) name 46 version
    (parted) set 46 msftdata on
    (parted) mkpart vendor ext2 5554 6192
    (parted) name 47 vendor
    (parted) set 47 msftdata on
    (parted) mkpart product ext4 6192 6393
    (parted) name 48 product
    (parted) set 48 msftdata on
    - for devices with 16GB :
    (parted) mkpart userdata 6393 15.8GB
    - for devices with 32GB :
    (parted) mkpart userdata 6393 31.3GB
    - for devices with 64GB :
    (parted) mkpart userdata 6393 62.5GB
    (parted) name 49 userdata
    (parted) set 49 msftdata on
    (parted) quit

    Step II : activating partitions for reuse :

    # mkfs.ext4 /dev/block/mmcblk0p44
    # mkfs.ext4 /dev/block/mmcblk0p45
    # mkfs.ext4 /dev/block/mmcblk0p46
    # mkfs.ext4 /dev/block/mmcblk0p47
    # mkfs.ext4 /dev/block/mmcblk0p48
    # mkfs.ext4 /dev/block/mmcblk0p49
    - go to TWRP -> Wipe -> Advanced Wipe -> select System -> Repair or Change File System -> Change File System -> EXT4 -> Swipe to Change
    - go to TWRP -> Wipe -> Advanced Wipe -> select Vendor -> Repair or Change File System -> Change File System -> EXT4 -> Swipe to Change
    - go to TWRP -> Wipe -> Format Data -> yes
    - reboot device from TWRP to TWRP in order to use data again after formated !
    - go to TWRP -> Wipe -> Advanced Wipe -> select Dalvik/ART Cache, Cache, Data, Internal Storage, System, Vendor -> Swipe to wipe
    - copy the new updated of LOS 17.1 with system partition of 4GB into your device
    - copy any GApps arm64 Android 10 to your device
    - Install them like always, enjoy !

    Reboot to System in order to enjoy your Android 10 with almost any version of GApps !

    Step III: flash back product image to fix sound issues !

    - download product.img md5: 848880f9b74686394b0b4667620b5682
    - go to TWRP and copy product.img on your internal memory
    - flash product image to product partition :
    > adb shell
    # dd if=/sdcard/product.img of=/dev/block/bootdevice/by-name/product
    393216+0 records in
    393216+0 records out
    201326592 bytes (192 M) copied, 10.460969 s, 18 M/s
    # reboot


    That's all !
    1
    Eventually I was able to boot into TWRP and could follow through. Thanks for the detailed description of all steps. Finally I can use the old phone with Android 10. Thanks a lot.