[GUIDE][Xiaomi Mi-One] Changing size of /system partitions

Search This thread

SetazeR

Senior Member
Aug 14, 2011
58
9
Belovo
Disclaimer: I am not responsible for bricked devices, dead SD cards, thermonuclear war, or anything else. YOU doing this at your own risk.

This guide is taken from 4pda.ru forums and tested on my own device.

I strongly recommend you to make Nandroid backup with CWM Recovery v6.0.3.0 so after repartitioning ALL DATA (/system, /system1, /data, /cache) WILL BE ERASED.
1. Connect you phone to PC via USB. (USB debugging must be turned on)
2. Install MiFlash. Remember installation path. It will install drivers for "Android Composite ADB Device". If there's still one "Android" device without drivers - just ignore.
3. Run Command Prompt (cmd) and go to the %FOLDER_WHERE_YOU_INSTALLED_MIFLASH%\Google\Android (For me it was C:\Program Files (x86)\Xiaomi\MiPhone\Google\Android)
4. Type adb devices and press enter. It should start adb daemon and show your device with status offline. Check phone for dialog and allow USB debug from your computer.
5. Type adb devices again. Now it should show your phone with status device. Close Command Prompt.
6. Download and unpack to any folder attached archive tadb.zip
7. Run tadb shell.bat. If everything fine it will show something like "shell@android:/ $"
9. Type su and press enter. If requested allow root access on phone.
10. Now enter busybox fdisk /dev/block/mmcblk0 to start repartiotioning program (All changes are virtual until written)
11. Delete all partitions from 20 to 15 inclusive. For this enter d, enter 20, enter d, enter 19 till 15th partition.
After this enter p. Your partition table must be like this
Code:
              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1               1       12801      102400   c Win95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2   *       12801       12863         500  4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3           12863       13051        1500  51 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4           13051      488448     3803183+  5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5           13052       13114         500  47 Unknown
/dev/block/mmcblk0p6           13114       13370        2048  45 Unknown
/dev/block/mmcblk0p7           13370       13683        2500  4c Unknown
/dev/block/mmcblk0p8           13683       14963       10240  48 Unknown
/dev/block/mmcblk0p9           14963       16243       10240  64 Unknown
/dev/block/mmcblk0p10          16243       16305         500  46 Unknown
/dev/block/mmcblk0p11          16305       16368         500  65 Unknown
/dev/block/mmcblk0p12          16385       16768        3072  4a Unknown
/dev/block/mmcblk0p13          16769       17152        3072  4b Unknown
/dev/block/mmcblk0p14          20481       20864        3072  58 Unknown
12. Recreate needed partitions table. Press n, enter start block, end block. You can use attached partitions.xls to calculate needed values. Also You can change size of system partitions in this file as you wish (Make them 384Mb for example). Values will be recalculated.
13. Now we must return System type for 17th block (recovery). Enter t, enter 17, enter 60. After this operation your partiotion table will be like this (If you left 256Mb):
Code:
              Device Boot      Start         End      Blocks  Id System
/dev/block/mmcblk0p1               1       12801      102400   c Win95 FAT32 (LBA)
Partition 1 does not end on cylinder boundary
/dev/block/mmcblk0p2   *       12801       12863         500  4d Unknown
Partition 2 does not end on cylinder boundary
/dev/block/mmcblk0p3           12863       13051        1500  51 Unknown
Partition 3 does not end on cylinder boundary
/dev/block/mmcblk0p4           13051      488448     3803183+  5 Extended
Partition 4 does not end on cylinder boundary
/dev/block/mmcblk0p5           13052       13114         500  47 Unknown
/dev/block/mmcblk0p6           13114       13370        2048  45 Unknown
/dev/block/mmcblk0p7           13370       13683        2500  4c Unknown
/dev/block/mmcblk0p8           13683       14963       10240  48 Unknown
/dev/block/mmcblk0p9           14963       16243       10240  64 Unknown
/dev/block/mmcblk0p10          16243       16305         500  46 Unknown
/dev/block/mmcblk0p11          16305       16368         500  65 Unknown
/dev/block/mmcblk0p12          16385       16768        3072  4a Unknown
/dev/block/mmcblk0p13          16769       17152        3072  4b Unknown
/dev/block/mmcblk0p14          20481       20864        3072  58 Unknown
/dev/block/mmcblk0p15          20866       53633      262144  83 Linux
/dev/block/mmcblk0p16          53635       86402      262144  83 Linux
/dev/block/mmcblk0p17          86404       87683       10240  60 Unknown
/dev/block/mmcblk0p18          87685       88708        8192  83 Linux
/dev/block/mmcblk0p19          88710      111749      184320  83 Linux
/dev/block/mmcblk0p20         111751      488448     3013584  83 Linux
14. Time to save changes. If you not sure, you can just enter q to leave without saving changes. Enter w to write new partition table. Program will show error about using old partition table - that's normal. After you reboot phone - changes will be applied, so it will not load anything except fastboot.
15. Load phone in fastboot mode (Power + Volume Down + Mi-Button), go to folder with tadb and run flash_recovery.bat. It will flash CWM 6.0.3.0 to your device.
16. Go to mounts & storage menu and format /cache, /system, /system1 and /data
17. Now you can restore your nandroid backup.

NOTE: All operations been made on Windows 7 32-bit and Xiaomi Mi-One Plus with MIUIv5 3.7.19
 

Attachments

  • tadb.zip
    6.3 MB · Views: 471
  • Partitions.xls
    39 KB · Views: 335
Last edited:

dancer_69

Senior Member
Jan 2, 2007
2,011
617
Yes, I know about that but there is already a tool for repartition. I thought that this was more than that. It' s nice that you can customise the size though. But isn't dangerous? I'm saying this because I've hard break my device twice using gparted. I had a full linux backup of device though so I recovered it but was the only way to do it. I succeed once though.
 

ball9077

Member
Jun 15, 2013
5
0
What's the name of the repartition tool? I'm caught in a wicked cloning loop that duplicates my partitions periodically and I haven't tracked down the cause. Ota JB Feb. 1st is the day it started. Thanks

A Charge of $17.99 Was Applied To Your Mobile Account For Browbeating The Author's Questions. Albeit, Most Likely a Foolish, Ignorant, Uneducated Compilation of Useless Quibble. But He Is Less Than 1 Year With Me and Is Bashing Adb, Scripting, Rooting, Romming Like a Red Headed Stepchild With No Thumbs, Herpes Type 4.2.2. Flashaholicism! Give My Poor TTS Owner A Hand Would ya? :) Sent From His Overclocked Porn Providing ClapaTalk Razr Maxx Xt-912.
 

ehrans

Senior Member
Nov 8, 2011
65
21
just a note:

On M1S phones the last END block is 477184 and not 488448 like M1+ and M1 C1

all is equal except that

So M1S users take in mind when repartitioning your phones.
 
  • Like
Reactions: XZoppy

SetazeR

Senior Member
Aug 14, 2011
58
9
Belovo
just a note:

On M1S phones the last END block is 477184 and not 488448 like M1+ and M1 C1

all is equal except that

So M1S users take in mind when repartitioning your phones.

Well, when creating last partition (/data) you can just hit Enter when prompted for last END block to use Default value. I think tadb automatically will use 477184 instead of 488448 for M1S. Not sure.
 

eilegz

Senior Member
Aug 1, 2013
139
26
i dont know if this its related but here it seems that there are a easier method to change the size

the author have it set on 280mb but it could be increased

link: miui.es/index.php/topic,7965.0.html
 

ehrans

Senior Member
Nov 8, 2011
65
21
i dont know if this its related but here it seems that there are a easier method to change the size

the author have it set on 280mb but it could be increased

link: miui.es/index.php/topic,7965.0.html

yes, is my tutorial for an automated way to do the changes from a recovery instalable .zip

just download, flash a compatible recovery (any cwm with busybox for M1/S should work) then install the zip for ur phone model.
 

Top Liked Posts

  • There are no posts matching your filters.
  • 3
    Disclaimer: I am not responsible for bricked devices, dead SD cards, thermonuclear war, or anything else. YOU doing this at your own risk.

    This guide is taken from 4pda.ru forums and tested on my own device.

    I strongly recommend you to make Nandroid backup with CWM Recovery v6.0.3.0 so after repartitioning ALL DATA (/system, /system1, /data, /cache) WILL BE ERASED.
    1. Connect you phone to PC via USB. (USB debugging must be turned on)
    2. Install MiFlash. Remember installation path. It will install drivers for "Android Composite ADB Device". If there's still one "Android" device without drivers - just ignore.
    3. Run Command Prompt (cmd) and go to the %FOLDER_WHERE_YOU_INSTALLED_MIFLASH%\Google\Android (For me it was C:\Program Files (x86)\Xiaomi\MiPhone\Google\Android)
    4. Type adb devices and press enter. It should start adb daemon and show your device with status offline. Check phone for dialog and allow USB debug from your computer.
    5. Type adb devices again. Now it should show your phone with status device. Close Command Prompt.
    6. Download and unpack to any folder attached archive tadb.zip
    7. Run tadb shell.bat. If everything fine it will show something like "shell@android:/ $"
    9. Type su and press enter. If requested allow root access on phone.
    10. Now enter busybox fdisk /dev/block/mmcblk0 to start repartiotioning program (All changes are virtual until written)
    11. Delete all partitions from 20 to 15 inclusive. For this enter d, enter 20, enter d, enter 19 till 15th partition.
    After this enter p. Your partition table must be like this
    Code:
                  Device Boot      Start         End      Blocks  Id System
    /dev/block/mmcblk0p1               1       12801      102400   c Win95 FAT32 (LBA)
    Partition 1 does not end on cylinder boundary
    /dev/block/mmcblk0p2   *       12801       12863         500  4d Unknown
    Partition 2 does not end on cylinder boundary
    /dev/block/mmcblk0p3           12863       13051        1500  51 Unknown
    Partition 3 does not end on cylinder boundary
    /dev/block/mmcblk0p4           13051      488448     3803183+  5 Extended
    Partition 4 does not end on cylinder boundary
    /dev/block/mmcblk0p5           13052       13114         500  47 Unknown
    /dev/block/mmcblk0p6           13114       13370        2048  45 Unknown
    /dev/block/mmcblk0p7           13370       13683        2500  4c Unknown
    /dev/block/mmcblk0p8           13683       14963       10240  48 Unknown
    /dev/block/mmcblk0p9           14963       16243       10240  64 Unknown
    /dev/block/mmcblk0p10          16243       16305         500  46 Unknown
    /dev/block/mmcblk0p11          16305       16368         500  65 Unknown
    /dev/block/mmcblk0p12          16385       16768        3072  4a Unknown
    /dev/block/mmcblk0p13          16769       17152        3072  4b Unknown
    /dev/block/mmcblk0p14          20481       20864        3072  58 Unknown
    12. Recreate needed partitions table. Press n, enter start block, end block. You can use attached partitions.xls to calculate needed values. Also You can change size of system partitions in this file as you wish (Make them 384Mb for example). Values will be recalculated.
    13. Now we must return System type for 17th block (recovery). Enter t, enter 17, enter 60. After this operation your partiotion table will be like this (If you left 256Mb):
    Code:
                  Device Boot      Start         End      Blocks  Id System
    /dev/block/mmcblk0p1               1       12801      102400   c Win95 FAT32 (LBA)
    Partition 1 does not end on cylinder boundary
    /dev/block/mmcblk0p2   *       12801       12863         500  4d Unknown
    Partition 2 does not end on cylinder boundary
    /dev/block/mmcblk0p3           12863       13051        1500  51 Unknown
    Partition 3 does not end on cylinder boundary
    /dev/block/mmcblk0p4           13051      488448     3803183+  5 Extended
    Partition 4 does not end on cylinder boundary
    /dev/block/mmcblk0p5           13052       13114         500  47 Unknown
    /dev/block/mmcblk0p6           13114       13370        2048  45 Unknown
    /dev/block/mmcblk0p7           13370       13683        2500  4c Unknown
    /dev/block/mmcblk0p8           13683       14963       10240  48 Unknown
    /dev/block/mmcblk0p9           14963       16243       10240  64 Unknown
    /dev/block/mmcblk0p10          16243       16305         500  46 Unknown
    /dev/block/mmcblk0p11          16305       16368         500  65 Unknown
    /dev/block/mmcblk0p12          16385       16768        3072  4a Unknown
    /dev/block/mmcblk0p13          16769       17152        3072  4b Unknown
    /dev/block/mmcblk0p14          20481       20864        3072  58 Unknown
    /dev/block/mmcblk0p15          20866       53633      262144  83 Linux
    /dev/block/mmcblk0p16          53635       86402      262144  83 Linux
    /dev/block/mmcblk0p17          86404       87683       10240  60 Unknown
    /dev/block/mmcblk0p18          87685       88708        8192  83 Linux
    /dev/block/mmcblk0p19          88710      111749      184320  83 Linux
    /dev/block/mmcblk0p20         111751      488448     3013584  83 Linux
    14. Time to save changes. If you not sure, you can just enter q to leave without saving changes. Enter w to write new partition table. Program will show error about using old partition table - that's normal. After you reboot phone - changes will be applied, so it will not load anything except fastboot.
    15. Load phone in fastboot mode (Power + Volume Down + Mi-Button), go to folder with tadb and run flash_recovery.bat. It will flash CWM 6.0.3.0 to your device.
    16. Go to mounts & storage menu and format /cache, /system, /system1 and /data
    17. Now you can restore your nandroid backup.

    NOTE: All operations been made on Windows 7 32-bit and Xiaomi Mi-One Plus with MIUIv5 3.7.19
    1
    just a note:

    On M1S phones the last END block is 477184 and not 488448 like M1+ and M1 C1

    all is equal except that

    So M1S users take in mind when repartitioning your phones.