Mi2S - extending size of storage partition


Hi! I'm thinking about installing Ivan's 5.1.1 AOSP and a couple questions came to my mind: can I remove system1? I mean, not giving it the minimum size possible, but removing it completely (which will cause partition numbers to change).

What about cache? Is it really used by Play Store to download apks?
 
Hi! I'm thinking about installing Ivan's 5.1.1 AOSP and a couple questions came to my mind: can I remove system1? I mean, not giving it the minimum size possible, but removing it completely (which will cause partition numbers to change).

What about cache? Is it really used by Play Store to download apks?

Yes, there is a guide by m1cha for do that and also install G4A
 
Yes, there is a guide by m1cha for do that and also install G4A
Can you link it to me, please? I already repartitioned my phone to increase userdata size following this guide, so I was going to merge partitions this way, manually. I'd really like to enable TDB or to remove system1 completely.
 
Sir plz say how i re partition mi redmi 1s device , sir plz reply this , bcoz my phone was not warking now , and also not going to recovery mood anly open Fastboot mood. and when i try to flash it show "remort partition table not exist" sir pls write how to repartition the 1s devise,. Thank u
 
Hi,

i am going to try this, because my phone keeps runmning out of space. back when i got it, apps were 5MB, now they are 50MB.

question to start: CWM, which is it? in the app store i see ROM manager, CWM bakcup manager, mk802 CWM recovery...
2nd question: what is ADB? is it a programm i should install on my pc?
 
Hi! Keep in mind that this is an intermediate procedure, in terms of difficulty. You don't need to be a developer (I'm not), but at least a power user. If you don't know what CWM or ADB is, there is a non-zero risk you could end up bricking your phone.

CWM is not an app you install on your phone, it's a recovery ROM. If you turn your phone off, and then turn it back on by pressing Power + Volume Up, you'll see a black screen with orange writings and shapes. That is Xiaomi's default recovery. It allows you to delete all user data (apps and their saved files, settings and such) restoring your phone to "factory settings", and to flash a newer version of the same ROM you already have, if it is placed in your /storage partition and named "update.zip". What you need to do is replace that with a more advanced recovery (CWM or, better, TWRP) which will allow you to perform more advanced actions. A recovery serves to modify your phone in various ways bypassing your operating system. This will allow you to do radical procedures not permitted to the average user by Android, and to replace the system, which obviously can't be done while it's running.

ADB, Android Debug Bridge, allows you to act on the flash memory of your phone using your computer. This will be possible even in the most critical situation. Generally speaking, unless your phone is physically damaged you should be able to restore it in some way via ADB. Basically, with ADB your phone, connected via USB, will act as a mass storage device, without MTP or anything. You will access your eMMC directly by mounting its partitions. The software "parted", used in GNU/Linux systems as well, can modify the partition table of any accessible drive. Keep in mind that this will make you lose any last bit of data you have on your phone so, even if everything goes smooth, you need to back everything up on an external drive first.
 
Last edited:
Hi! Keep in mind that this is an intermediate procedure, in terms of difficulty. You don't need to be a developer (I'm not), but at least a power user. If you don't know what CWM or ADB is, there is a non-zero risk you could end up bricking your phone.

CWM is not an app you install on your phone, it's a recovery ROM. If you turn your phone off, and then turn it back on by pressing Power + Volume Up, you'll see a black screen with orange writings and shapes. That is Xiaomi's default recovery. It allows you to delete all user data (apps and their saved files, settings and such) restoring your phone to "factory settings", and to flash a newer version of the same ROM you already have, if it is placed in your /storage partition and named "update.zip". What you need to do is replace that with a more advanced recovery (CWM or, better, TWRP) which will allow you to perform more advanced actions. A recovery serves to modify your phone in various ways bypassing your operating system. This will allow you to do radical procedures not permitted to the average user by Android, and to replace the system, which obviously can't be done while it's running.

ADB, Android Debug Bridge, allows you to act on the flash memory of your phone using your computer. This will be possible even in the most critical situation. Generally speaking, unless your phone is physically damaged you should be able to restore it in some way via ADB. Basically, with ADB your phone, connected via USB, will act as a mass storage device, without MTP or anything. You will access your eMMC directly by mounting its partitions. The software "parted", used in GNU/Linux systems as well, can modify the partition table of any accessible drive. Keep in mind that this will make you lose any last bit of data you have on your phone so, even if everything goes smooth, you need to back everything up on an external drive first.


Hi thanks for the warning. i want to try this so i can learn from it. with the coninues storage warnings my phone is getting more and more useless, i have had to uninstall convenient and fun apps, an now i have reached the point where i need to start unintsalling apps i really use. i want to try this or i'll get a new phone, which is a shame because it is technically in perfect order and is still running fast.

anyway:
i followed this thread https://forum.xda-developers.com/mi-2/development/2014-07-08-clockworkmod-recovery-6-0-5-0-t2878549 to get CWM and got the file from the link on the last page.

I renamed it to update.zip and placed it in the root SD folder. i then used the default miui recovery system to use the "install update.zip to System" but it gives the message "install update.zip failed" error aplying update.

any idea what is wrong?

PS i am running MIUI 6.7.2.o
 
Keep in mind that the default recovery is useless. It allows you only to flash a newer version of the same type (dev, stable...) of MIUI you currently have on your phone.

Like I said, your first step will be to change recovery. You obviously can't do that using a recovery. You need to flash the extracted recovery image using fastboot.

Read more on fastboot and how to flash a custom recovery on XDA (the second post is about TWRP, but the procedure's the same for any recovery, including CWM — keep in mind TWRP is better though). If you have any doubts about it, ask here!
 
ok so i am reading up on fastboot, twrp and adb. i am actually enjoying myelf, i like fiddling with gadgets.

i have adb working, as well as CWM

another silly question:

how do i do this step? - copy content of partition_tools.zip into /system/bin and add executable attributes if necessary

i have the files but system/bin? on the phone? or on the pc? i see no such directory. should i somehow approach it with adb? and what are executable attributes?
 
Last edited:
/system/bin is in your phone. Using the Linux kernel, Android uses paths and mounts as seen in the GNU/Linux operating system: the primary path, called "root", is indicated with a slash (/). Every absolute path will begin with a slash, as it starts from the root. For example, the partition labelled "system", which contains the firmware (ROM) and the crucial applications it needs, is mounted in a folder named "system" (generally, it isn't needed that the two names are the same, you can mount any partition anywhere) directly created in the root (/system). This way, the folder "bin" in that partition will have the absolute path /system/bin. To send a file in there, you have to use the "push" command in adb.

adb also has a shell functionality, which allows you to issue basic bash commands, like chmod (change mode) which changes permissions of a file (read/write access and executable attributes, which allow the file to be run). Issuing "+x" gives executable attributes without altering the other two. This command must obviously be run with administrative rights. In short:

Code:
adb shell "su -c 'chmod +x %path'"

This issues the command enclosed in quotation marks with the adb shell. That command issues the one enclosed in ticks as root user (administrator). This last one, finally, allows the file located at %path to be executed.
 
As a downside, it uses proprietary software (Mi PC Suite) which is only available under Windows, it is bound to MIUI 6, and it doesn't allow the user to choose partition sizes.
 
  • Like
Reactions: cbpbxecmecmbeh