[DEV][ Expand System Partition To 5GB - MediaPad M3 ]

Search This thread

surdu_petru

Recognized Contributor
Feb 3, 2010
7,086
23,070
Paris
Hello !

Here you will find the information needed to change the system partition from 2GB to 5GB - this operation is somewhat useful for installing any version of GApps on your device : Huawei MediaPad M3 8.4 Kirin version ( BTV-DL09; BTV-L0J; BTV-W09 )


Thanks to @accerian for his help, and you can also check out this tutorial for more information !


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


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

Step I : extended system partition from about 2GB to 5GB ( example for a 32GB device, for 64GB devices the procedure is 99% similar, only one operation differs which will be specified at the appropriate time ) - also this example is for BTV-DL09 which is with LTE capabilities.

- 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 43, which should be the same for all devices :
43 1174MB 3255MB 2080MB ext2 system msftdata
44 3255MB 3456MB 201MB ext4 cust msftdata
45 3456MB 3490MB 33.6MB ext4 version msftdata
46 3490MB 4127MB 638MB ext2 vendor msftdata
47 4127MB 4329MB 201MB ext4 product msftdata
48 4329MB 4333MB 4194kB hisitest2 msftdata
49 4333MB 31.3GB 26.9GB userdata msftdata
- if line 43 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 43 in the case of your device so that I can guide you correctly .
- assuming that all devices have the same system partition ( the same 43 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) rm 43
(parted) mkpart system ext2 1174 6501
(parted) name 43 system
(parted) set 43 msftdata on
(parted) mkpart cust ext4 6501 6702
(parted) name 44 cust
(parted) set 44 msftdata on
(parted) mkpart version ext4 6702 6736
(parted) name 45 version
(parted) set 45 msftdata on
(parted) mkpart vendor ext2 6736 7374
(parted) name 46 vendor
(parted) set 46 msftdata on
(parted) mkpart product ext4 7374 7575
(parted) name 47 product
(parted) set 47 msftdata on
(parted) mkpart hisitest 7575 7579
(parted) name 48 hisitest2
(parted) set 48 msftdata on
- for devices with 32GB :
(parted) mkpart userdata 7579 31.3GB
- for devices with 64GB :
(parted) mkpart userdata 7579 62.5GB
(parted) name 49 userdata
(parted) set 49 msftdata on
(parted) quit

Step II : activating partitions for reuse :
# mkfs.ext4 /dev/block/mmcblk0p43
# mkfs.ext4 /dev/block/mmcblk0p44
# mkfs.ext4 /dev/block/mmcblk0p45
# mkfs.ext4 /dev/block/mmcblk0p46
# mkfs.ext4 /dev/block/mmcblk0p47
# 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 5GB into your device
- copy any GApps arm64 Android 10 to your device
- Install them like always, enjoy !

Mention :

- if your device is WiFi only, you may have fewer partitions .... the above instructions can be easily adapted from case to case !

The main idea is that we must first find out what position the system partition is in, in this case it was at position 43 which corresponds to /dev/block/mmcblk0p43 - then we need to delete all partitions from userdata to system, and recreate them in the same order !
To calculate the start and end position, it is again very easy : for example the system partition starts from the initial position 1174, which is the same as the end position of the previous partition 42 (42 1160MB 1174MB 14.7MB reserved3 msftdata), and the end position was incremented by 5327 in this case (almost 5GB), resulting in 6501. .. the next partition 44 (cust) will have the starting position 6501, and the end position will be incremented by 201 (i.e. 201MB) as shown on line 44 (44 3255MB 3456MB 201MB ext4 cust msftdata)


If really needed, a concrete example will be added here for WiFi only devices !
 
Last edited:

Me,You,and Daigorou

Senior Member
Jun 30, 2020
76
30
Thank you surdu_petru.

The internal storage size of BTV-L0J is 16GB, is the above procedure effective?

Is it possible to restore a partition size back to its original size? I sometimes use a dd command as a way to restore from LineageOS to stock ROM. So I need to restore it to its original size before using a dd command.

According to z3DD3r, who created a tool to resize the Nexus 5 system partition, it is recommended that after changing the partition size, TWRP should also be changed.
Because TWRP includes size of system partition. This size should match the size of system partition on device. Otherwise bad things can happen...
Is there any problem without changing TWRP?

I am sorry for asking so many questions. I am cautious about changing the partition size because it is perilous.
 

surdu_petru

Recognized Contributor
Feb 3, 2010
7,086
23,070
Paris
Thank you surdu_petru.

The internal storage size of BTV-L0J is 16GB, is the above procedure effective?

Is it possible to restore a partition size back to its original size? I sometimes use a dd command as a way to restore from LineageOS to stock ROM. So I need to restore it to its original size before using a dd command.

According to z3DD3r, who created a tool to resize the Nexus 5 system partition, it is recommended that after changing the partition size, TWRP should also be changed.

Is there any problem without changing TWRP?

I am sorry for asking so many questions. I am cautious about changing the partition size because it is perilous.
If you still have 49 partitions, and partition 43 (system) shows that in the above tutorial then the procedure is identical, you just have to put a lower value of the user data partition in the last corresponding line of 16GB!
- for devices with 16GB:
(parted) mkpart userdata 7579 ?? GB

There is no need to change anything, neither TWRP nor the partition to the initial value ... the most important thing is to pay attention to the Start and End position of system partition to make the calculations as accurate as possible !

I can help you if you can send me a screenshot of what the command below displays on your device (from the system down to the last partition):
> adb shell
# parted /dev/block/mmcblk0 print
 

Me,You,and Daigorou

Senior Member
Jun 30, 2020
76
30
If you still have 49 partitions, and partition 43 (system) shows that in the above tutorial then the procedure is identical, you just have to put a lower value of the user data partition in the last corresponding line of 16GB!


There is no need to change anything, neither TWRP nor the partition to the initial value ... the most important thing is to pay attention to the Start and End position of system partition to make the calculations as accurate as possible !

I can help you if you can send me a screenshot of what the command below displays on your device (from the system down to the last partition):
> adb shell
# parted /dev/block/mmcblk0 print
Thank you for your reply.:)
It is good news that if each partition has the same number it is effective.
I am currently not having trouble with the size of system partitions, so I will give it some more thought.
 

Herby007

New member
May 20, 2022
2
0
@surdu_petru - many thanks for this guide, I found it very clear and straightforward. I wasn't sure if you were wanting confirmation that these instructions work with other models of the tablet - if so, I can confirm it works perfectly with my (wifi only, 32GB) BTV-W09.
 

surdu_petru

Recognized Contributor
Feb 3, 2010
7,086
23,070
Paris
@surdu_petru - many thanks for this guide, I found it very clear and straightforward. I wasn't sure if you were wanting confirmation that these instructions work with other models of the tablet - if so, I can confirm it works perfectly with my (wifi only, 32GB) BTV-W09.
Thanks for confirmation. I'm not waiting especially confirmation, but it's always better if you can confirm. I'm here to help in case that something goes wrong.
 

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 5GB - this operation is somewhat useful for installing any version of GApps on your device : Huawei MediaPad M3 8.4 Kirin version ( BTV-DL09; BTV-L0J; BTV-W09 )


    Thanks to @accerian for his help, and you can also check out this tutorial for more information !


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


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

    Step I : extended system partition from about 2GB to 5GB ( example for a 32GB device, for 64GB devices the procedure is 99% similar, only one operation differs which will be specified at the appropriate time ) - also this example is for BTV-DL09 which is with LTE capabilities.

    - 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 43, which should be the same for all devices :
    43 1174MB 3255MB 2080MB ext2 system msftdata
    44 3255MB 3456MB 201MB ext4 cust msftdata
    45 3456MB 3490MB 33.6MB ext4 version msftdata
    46 3490MB 4127MB 638MB ext2 vendor msftdata
    47 4127MB 4329MB 201MB ext4 product msftdata
    48 4329MB 4333MB 4194kB hisitest2 msftdata
    49 4333MB 31.3GB 26.9GB userdata msftdata
    - if line 43 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 43 in the case of your device so that I can guide you correctly .
    - assuming that all devices have the same system partition ( the same 43 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) rm 43
    (parted) mkpart system ext2 1174 6501
    (parted) name 43 system
    (parted) set 43 msftdata on
    (parted) mkpart cust ext4 6501 6702
    (parted) name 44 cust
    (parted) set 44 msftdata on
    (parted) mkpart version ext4 6702 6736
    (parted) name 45 version
    (parted) set 45 msftdata on
    (parted) mkpart vendor ext2 6736 7374
    (parted) name 46 vendor
    (parted) set 46 msftdata on
    (parted) mkpart product ext4 7374 7575
    (parted) name 47 product
    (parted) set 47 msftdata on
    (parted) mkpart hisitest 7575 7579
    (parted) name 48 hisitest2
    (parted) set 48 msftdata on
    - for devices with 32GB :
    (parted) mkpart userdata 7579 31.3GB
    - for devices with 64GB :
    (parted) mkpart userdata 7579 62.5GB
    (parted) name 49 userdata
    (parted) set 49 msftdata on
    (parted) quit

    Step II : activating partitions for reuse :
    # mkfs.ext4 /dev/block/mmcblk0p43
    # mkfs.ext4 /dev/block/mmcblk0p44
    # mkfs.ext4 /dev/block/mmcblk0p45
    # mkfs.ext4 /dev/block/mmcblk0p46
    # mkfs.ext4 /dev/block/mmcblk0p47
    # 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 5GB into your device
    - copy any GApps arm64 Android 10 to your device
    - Install them like always, enjoy !

    Mention :

    - if your device is WiFi only, you may have fewer partitions .... the above instructions can be easily adapted from case to case !

    The main idea is that we must first find out what position the system partition is in, in this case it was at position 43 which corresponds to /dev/block/mmcblk0p43 - then we need to delete all partitions from userdata to system, and recreate them in the same order !
    To calculate the start and end position, it is again very easy : for example the system partition starts from the initial position 1174, which is the same as the end position of the previous partition 42 (42 1160MB 1174MB 14.7MB reserved3 msftdata), and the end position was incremented by 5327 in this case (almost 5GB), resulting in 6501. .. the next partition 44 (cust) will have the starting position 6501, and the end position will be incremented by 201 (i.e. 201MB) as shown on line 44 (44 3255MB 3456MB 201MB ext4 cust msftdata)


    If really needed, a concrete example will be added here for WiFi only devices !