• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

[HOWTO][GUIDE][Mi3][Mi4]Resize/extend system partition capacity

Search This thread

arif920629

New member
Jan 26, 2011
4
53
Kota Kinabalu
Disclaimer: I am not responsible for bricked devices, obviously

Unlike most people here, I do not find the "dual-boot" feature particularly useful due to its buggyness and quirky configuration plus it made the available space for the /system partition divided, leaving only 600++ MB for each system1 and system2. This guide is using CWM v6.0.5.1 (R11) by furniel and donbo.

Prerequisites:
  • CWM Recovery V6.0.5.1
  • a Mi 3w (probably doable for the Mi 4 too)
  • ADB drivers installed

Not necessary, but do back up system1 if you wish to conserve your current ROM and config.
As parted cannot resize partitions, /system (system1) and /system1 (system2) partitions will have to be removed and re-created with the desired size, this is why backing up system1 is favourable.

  1. Reboot to recovery and connect your phone
  2. Open a cmd window (or terminal, if you're using linux), and connect through adb by typing;
    Code:
    adb devices
    adb shell
  3. If everything is fine and you get a shell input (#), start parted by typing;
    Code:
    parted /dev/block/mmcblk0
    unit MB #to set storage unit as MB
    print #shows partition table. do remember to screenshot this
  4. Output of "print" should be something like this
    Code:
    Number  Start   End      Size     File system  Name      Flags
     1      0.02MB  2.10MB   2.08MB                sbl1
     2      2.10MB  3.15MB   1.05MB                rpm
     3      3.15MB  4.19MB   1.05MB                tz
     4      4.19MB  5.24MB   1.05MB                DDR
     5      5.24MB  6.29MB   1.05MB                ssd
     6      6.29MB  7.34MB   1.05MB                dbi
     7      7.34MB  11.5MB   4.19MB                aboot
     8      11.5MB  16.8MB   5.24MB                bk1
     9      16.8MB  21.0MB   4.19MB                misc
    10      21.0MB  29.4MB   8.39MB                logo
    11      29.4MB  67.1MB   37.7MB                bk2
    12      67.1MB  68.7MB   1.57MB                modemst1
    13      68.7MB  70.3MB   1.57MB                modemst2
    14      70.3MB  70.3MB   0.00MB                fsc
    15      70.3MB  134MB    64.0MB                bk3
    16      134MB   136MB    1.57MB                fsg
    17      136MB   168MB    32.0MB                bk4
    18      168MB   201MB    33.6MB                bk5
    19      201MB   218MB    16.8MB                boot
    20      218MB   235MB    16.8MB                boot1
    21      235MB   252MB    16.8MB                recovery
    22      252MB   268MB    16.8MB   ext4         persist
    23      268MB   336MB    67.1MB   fat16        modem
    24      336MB   403MB    67.1MB   fat16        modem1
    25      403MB   1074MB   671MB    ext4         system
    26      1074MB  1745MB   671MB    ext4         system1
    27      1745MB  2147MB   403MB    ext4         cache
    28      2147MB  15758MB  13610MB  ext4         userdata
  5. Remove partition "system" (system1) and "system1" (system2);
    Code:
    rm 25
    rm 26
  6. Create new partitions after deleting them, partition size is up to you;
    Code:
    mkpartfs primary ext2 403 1645 # 403MB is the start of the partition ending at 1645 MB, this will be for system1
    mkpartfs primary ext2 1645 1745 # Do the same for system2
    print # show the partition table to confirm that the partitions are created
    name 25 system # name the partition as "system" for system1
    name 26 system1 # again for system2
    print # check again
    quit
  7. Convert newly created partitions to ext4 from ext2;
    Code:
    #for system1;
    
    tune2fs -j /dev/block/mmcblk0p25
    e2fsck -fDp /dev/block/mmcblk0p25
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p25
    e2fsck -fDp /dev/block/mmcblk0p25
    
    # for system2;
    
    tune2fs -j /dev/block/mmcblk0p26
    e2fsck -fDp /dev/block/mmcblk0p26
    tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p26
    e2fsck -fDp /dev/block/mmcblk0p26
  8. Go back to parted to check whether it's applied;
    Code:
    parted /dev/block/mmcblk0
    unit MB
    print
  9. It should be like this (if you followed my partition sizes)
    Code:
    Model: MMC SEM16G (sd/mmc)
    Disk /dev/block/mmcblk0: 15758MB
    Sector size (logical/physical): 512B/512B
    Partition Table: gpt
    
    Number  Start   End      Size     File system  Name      Flags
     1      0.02MB  2.10MB   2.08MB                sbl1
     2      2.10MB  3.15MB   1.05MB                rpm
     3      3.15MB  4.19MB   1.05MB                tz
     4      4.19MB  5.24MB   1.05MB                DDR
     5      5.24MB  6.29MB   1.05MB                ssd
     6      6.29MB  7.34MB   1.05MB                dbi
     7      7.34MB  11.5MB   4.19MB                aboot
     8      11.5MB  16.8MB   5.24MB                bk1
     9      16.8MB  21.0MB   4.19MB                misc
    10      21.0MB  29.4MB   8.39MB                logo
    11      29.4MB  67.1MB   37.7MB                bk2
    12      67.1MB  68.7MB   1.57MB                modemst1
    13      68.7MB  70.3MB   1.57MB                modemst2
    14      70.3MB  70.3MB   0.00MB                fsc
    15      70.3MB  134MB    64.0MB                bk3
    16      134MB   136MB    1.57MB                fsg
    17      136MB   168MB    32.0MB                bk4
    18      168MB   201MB    33.6MB                bk5
    19      201MB   218MB    16.8MB                boot
    20      218MB   235MB    16.8MB                boot1
    21      235MB   252MB    16.8MB                recovery
    22      252MB   268MB    16.8MB   ext4         persist
    23      268MB   336MB    67.1MB   fat16        modem
    24      336MB   403MB    67.1MB   fat16        modem1
    25      403MB   1645MB   1242MB   ext4         system
    26      1645MB  1745MB   99.8MB   ext4         system1
    27      1745MB  2147MB   403MB    ext4         cache
    28      2147MB  15758MB  13610MB  ext4         userdata
  10. You can quit adb now, process is finished. Reboot and restore your back up (if you have made one earlier) or flash a rom through CWM

Do comment/reply if you are having difficulties or otherwise :)
 
Last edited:

shrisangram

Senior Member
Oct 19, 2012
127
109
27
aurangabad
Thank you so much

Screenshot_2015_01_26_00_17_31.png

One command is miswritten
mkpartfs primary ext2 1812 3070
It should be
mkpartfs primary ext2 1645 1745
 
Last edited:

mchauhan

Senior Member
Nov 17, 2012
163
47
Thanks,

Will this have any effect if I have to do fastboot of MIUI in future?

Is this method safe since we are playing with partition table?
 

adsim

Member
Jul 28, 2010
20
0
Disclaimer: I am not responsible for bricked devices, obviously

Unlike most people here, I do not find the "dual-boot" feature particularly useful due to its buggyness and quirky configuration plus it made the available space for the /system partition divided, leaving only 600++ MB for each system1 and system2. This guide is using CWM v6.0.5.1 (R11) by furniel and donbo.
...

Do comment/reply if you are having difficulties or otherwise :)

why did these steps??

tune2fs -j /dev/block/mmcblk0p25
e2fsck -fDp /dev/block/mmcblk0p25
tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p25
e2fsck -fDp /dev/block/mmcblk0p25
 
Last edited:

Amruth Pillai

Senior Member
Nov 24, 2012
133
92
25
Bangalore
Samsung Galaxy S21 Ultra
I would like to know why you have changed the format of the file systems from ext3 to ext4.

Code:
[B]Ext4[/B]
[LIST]
[*]Ext4 stands for fourth extended file system.
[*]It was introduced in 2008.
[*]Starting from Linux Kernel 2.6.19 ext4 was available.
[*]Supports huge individual file size and overall file system size.
[*]Maximum individual file size can be from 16 GB to 16 TB
[*]Overall maximum ext4 file system size is 1 EB (exabyte). 1 EB = 1024 PB (petabyte). 1 PB = 1024 TB (terabyte).
[*]Directory can contain a maximum of 64,000 subdirectories (as opposed to 32,000 in ext3)
[*]You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).
[*]Several other new features are introduced in ext4: multiblock allocation, delayed allocation, journal checksum. fast fsck, etc. All you need to know is that these new features have improved the performance and reliability of the filesystem when compared to ext3.
[*]In ext4, you also have the option of turning the journaling feature “off”.
[/LIST]

With all these features, and an option to... who wouldn't? :)
 
  • Like
Reactions: srvoleti

srvoleti

Senior Member
Sep 7, 2008
564
159
India
Code:
[B]Ext4[/B]
[LIST]
[*]Ext4 stands for fourth extended file system.
[*]It was introduced in 2008.
[*]Starting from Linux Kernel 2.6.19 ext4 was available.
[*]Supports huge individual file size and overall file system size.
[*]Maximum individual file size can be from 16 GB to 16 TB
[*]Overall maximum ext4 file system size is 1 EB (exabyte). 1 EB = 1024 PB (petabyte). 1 PB = 1024 TB (terabyte).
[*]Directory can contain a maximum of 64,000 subdirectories (as opposed to 32,000 in ext3)
[*]You can also mount an existing ext3 fs as ext4 fs (without having to upgrade it).
[*]Several other new features are introduced in ext4: multiblock allocation, delayed allocation, journal checksum. fast fsck, etc. All you need to know is that these new features have improved the performance and reliability of the filesystem when compared to ext3.
[*]In ext4, you also have the option of turning the journaling feature “off”.
[/LIST]

With all these features, and an option to... who wouldn't? :)
OK, Thank you for the info.
 

iwjy

Senior Member
Dec 14, 2010
52
23
system2

Why is system2 still exist with 100MB size? I think it will cause error if you do OTA update because MI3 OTA update by default will flash update to system1 and then system2 in the next OTA. Unless if you stick to custom rom or always manually flash update to system1
 

The Dork Knight Rises

Senior Member
Mar 20, 2014
1,188
1,125
Mumbai
samriddhabasu.github.io
Why is system2 still exist with 100MB size? I think it will cause error if you do OTA update because MI3 OTA update by default will flash update to system1 and then system2 in the next OTA. Unless if you stick to custom rom or always manually flash update to system1

Ah, yes, I have the same question, actually...we DO need system2 to be usable atleast, right?
 

Top Liked Posts

  • There are no posts matching your filters.
  • 47
    Disclaimer: I am not responsible for bricked devices, obviously

    Unlike most people here, I do not find the "dual-boot" feature particularly useful due to its buggyness and quirky configuration plus it made the available space for the /system partition divided, leaving only 600++ MB for each system1 and system2. This guide is using CWM v6.0.5.1 (R11) by furniel and donbo.

    Prerequisites:
    • CWM Recovery V6.0.5.1
    • a Mi 3w (probably doable for the Mi 4 too)
    • ADB drivers installed

    Not necessary, but do back up system1 if you wish to conserve your current ROM and config.
    As parted cannot resize partitions, /system (system1) and /system1 (system2) partitions will have to be removed and re-created with the desired size, this is why backing up system1 is favourable.

    1. Reboot to recovery and connect your phone
    2. Open a cmd window (or terminal, if you're using linux), and connect through adb by typing;
      Code:
      adb devices
      adb shell
    3. If everything is fine and you get a shell input (#), start parted by typing;
      Code:
      parted /dev/block/mmcblk0
      unit MB #to set storage unit as MB
      print #shows partition table. do remember to screenshot this
    4. Output of "print" should be something like this
      Code:
      Number  Start   End      Size     File system  Name      Flags
       1      0.02MB  2.10MB   2.08MB                sbl1
       2      2.10MB  3.15MB   1.05MB                rpm
       3      3.15MB  4.19MB   1.05MB                tz
       4      4.19MB  5.24MB   1.05MB                DDR
       5      5.24MB  6.29MB   1.05MB                ssd
       6      6.29MB  7.34MB   1.05MB                dbi
       7      7.34MB  11.5MB   4.19MB                aboot
       8      11.5MB  16.8MB   5.24MB                bk1
       9      16.8MB  21.0MB   4.19MB                misc
      10      21.0MB  29.4MB   8.39MB                logo
      11      29.4MB  67.1MB   37.7MB                bk2
      12      67.1MB  68.7MB   1.57MB                modemst1
      13      68.7MB  70.3MB   1.57MB                modemst2
      14      70.3MB  70.3MB   0.00MB                fsc
      15      70.3MB  134MB    64.0MB                bk3
      16      134MB   136MB    1.57MB                fsg
      17      136MB   168MB    32.0MB                bk4
      18      168MB   201MB    33.6MB                bk5
      19      201MB   218MB    16.8MB                boot
      20      218MB   235MB    16.8MB                boot1
      21      235MB   252MB    16.8MB                recovery
      22      252MB   268MB    16.8MB   ext4         persist
      23      268MB   336MB    67.1MB   fat16        modem
      24      336MB   403MB    67.1MB   fat16        modem1
      25      403MB   1074MB   671MB    ext4         system
      26      1074MB  1745MB   671MB    ext4         system1
      27      1745MB  2147MB   403MB    ext4         cache
      28      2147MB  15758MB  13610MB  ext4         userdata
    5. Remove partition "system" (system1) and "system1" (system2);
      Code:
      rm 25
      rm 26
    6. Create new partitions after deleting them, partition size is up to you;
      Code:
      mkpartfs primary ext2 403 1645 # 403MB is the start of the partition ending at 1645 MB, this will be for system1
      mkpartfs primary ext2 1645 1745 # Do the same for system2
      print # show the partition table to confirm that the partitions are created
      name 25 system # name the partition as "system" for system1
      name 26 system1 # again for system2
      print # check again
      quit
    7. Convert newly created partitions to ext4 from ext2;
      Code:
      #for system1;
      
      tune2fs -j /dev/block/mmcblk0p25
      e2fsck -fDp /dev/block/mmcblk0p25
      tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p25
      e2fsck -fDp /dev/block/mmcblk0p25
      
      # for system2;
      
      tune2fs -j /dev/block/mmcblk0p26
      e2fsck -fDp /dev/block/mmcblk0p26
      tune2fs -O extents,uninit_bg,dir_index /dev/block/mmcblk0p26
      e2fsck -fDp /dev/block/mmcblk0p26
    8. Go back to parted to check whether it's applied;
      Code:
      parted /dev/block/mmcblk0
      unit MB
      print
    9. It should be like this (if you followed my partition sizes)
      Code:
      Model: MMC SEM16G (sd/mmc)
      Disk /dev/block/mmcblk0: 15758MB
      Sector size (logical/physical): 512B/512B
      Partition Table: gpt
      
      Number  Start   End      Size     File system  Name      Flags
       1      0.02MB  2.10MB   2.08MB                sbl1
       2      2.10MB  3.15MB   1.05MB                rpm
       3      3.15MB  4.19MB   1.05MB                tz
       4      4.19MB  5.24MB   1.05MB                DDR
       5      5.24MB  6.29MB   1.05MB                ssd
       6      6.29MB  7.34MB   1.05MB                dbi
       7      7.34MB  11.5MB   4.19MB                aboot
       8      11.5MB  16.8MB   5.24MB                bk1
       9      16.8MB  21.0MB   4.19MB                misc
      10      21.0MB  29.4MB   8.39MB                logo
      11      29.4MB  67.1MB   37.7MB                bk2
      12      67.1MB  68.7MB   1.57MB                modemst1
      13      68.7MB  70.3MB   1.57MB                modemst2
      14      70.3MB  70.3MB   0.00MB                fsc
      15      70.3MB  134MB    64.0MB                bk3
      16      134MB   136MB    1.57MB                fsg
      17      136MB   168MB    32.0MB                bk4
      18      168MB   201MB    33.6MB                bk5
      19      201MB   218MB    16.8MB                boot
      20      218MB   235MB    16.8MB                boot1
      21      235MB   252MB    16.8MB                recovery
      22      252MB   268MB    16.8MB   ext4         persist
      23      268MB   336MB    67.1MB   fat16        modem
      24      336MB   403MB    67.1MB   fat16        modem1
      25      403MB   1645MB   1242MB   ext4         system
      26      1645MB  1745MB   99.8MB   ext4         system1
      27      1745MB  2147MB   403MB    ext4         cache
      28      2147MB  15758MB  13610MB  ext4         userdata
    10. You can quit adb now, process is finished. Reboot and restore your back up (if you have made one earlier) or flash a rom through CWM

    Do comment/reply if you are having difficulties or otherwise :)
    42
    This Procedure May Will Brick Your Device!!!!!

    Only for users who comfort with single partition layout only !!!

    This is a script to partiton your system partition as like stated in OP. Tested with Clockworkmod recovery.

    How to use? Just flash through recovery on either partition. Remember, this will wipe your system partition, do backup for safe or no if you like to live dangerously.

    Repartition_MI3W_1_2GB.zip

    Credit :
    http://forum.xda-developers.com/showthread.php?t=2765846
    http://forum.xda-developers.com/galaxy-s3/development/guide-extra-1-5-gb-user-data-t2762594
    11
    Thank you so much

    Screenshot_2015_01_26_00_17_31.png

    One command is miswritten
    mkpartfs primary ext2 1812 3070
    It should be
    mkpartfs primary ext2 1645 1745
    7
    Firstly, I let it to deplete the battery (about 24 hours). Tried press power button and hold (30 seconds or more), screen still has no display.

    Plug in USB cable and charger, LED flashing red, tried at different time from plug in until about 2 hours later, press power button and hold, also press power button and volume down buttons and hold (30 seconds or more), screen and capacitive buttons still doesn't light up.

    Leaving it with USB cable and charger as suggested to charge for 12 hours or more before trying again.
    After doing some research, I found the 3 links (see below) which helped me to unbreak my device from blank screen, no LED, capacitive buttons not lighted and last of all when my Mi 3 is plugged to my Windows 8.1 computer, there is many Windows pop-up asking to be formatted.

    THIS IS WHAT I DID:
    1. Download MiFlash from Xiaomi

    2. Download Miphone Manager from Xiaomi and install it. Look in C drive for the directory.

    3. Reboot Windows 8.1 in safe mode, select unsigned drivers option.

    4. When the Mi 3 is connected to my computer by USB, in device manager, the detected device "QHSUSB_BULK" is with "!".

    5. Click on "QHSUSB_BULK" to install drivers by pointing to the directory in point (2) above.

    6. Follow the MiFlash steps from the below thread " Unbrick Your Completely Dead Mi3 With No Fastboot/Recovery" to flash the files under Advanced Mode.

    7. After the flashing completed, press Power button for about 20 seconds, and my Mi 3 booted up.

    LINKS FOR REFERENCE:
    Recover From Hard Bricked OnePlus One
    https://forums.oneplus.net/threads/solution-recover-from-hard-bricked-oneplus-one.104943/


    How to Disable Driver Signature Verification on 64-Bit Windows 8.1 (So That You Can Install Unsigned Drivers)
    http://www.howtogeek.com/167723/how...8.1-so-that-you-can-install-unsigned-drivers/


    Unbrick Your Completely Dead Mi3 With No Fastboot/Recovery
    http://en.miui.com/thread-73348-1-1.html
    6
    Dedicated to ones who are wondering if after Re size will MIUI work or not

    1) To users who are a bit confused whether after increassing the partition size whether you will be albe to install MIUI or not ,
    so answer is yes you can ,no issues at all

    2) somewhere asking if OTA will work or not
    yes OTA works fine :)

    I was on TWRP Recovery , and it was the recovery issue that miui was not flashing o but then switched back to Cwm and it flashed as expected Even started getting Beta updates so i assure Ota works .

    Now switched back to TWRP just made a backup of MIUI :p
    you can make a backup of it and place it in your Pc,lappy and when you feel like switching to Miui just restore it back :cowboy:

    Screenshot_2015-03-05-18-36-56.png , Screenshot_2015-03-05-18-35-26.jpg