[Guide] Partitioning Xiaomi Mi2 (S)

One of the problems with mobile devices may be memory limitation ... even if you have several jigs, as in my case: 32GB. Obviously I don't want to say that 32GB of internal memory are few, in fact, but that this can often be subdivided in such a way as to set limits. My terminal, Xiaomi Mi2, is (or rather, it was) partitioned in such a way that in 4GB of space both the system and the applications should go there, and 25GB for multimedia files, etc. For those who install a few applications, let's say that 4GB are too many, but those who have dozens and dozens of applications and even games, which can take up so much space (up to a few GB), are always forced to delete old apps to make room for new ones . A rather uncomfortable solution. But there is an excellent alternative to this, for which it is necessary pay close attention, otherwise you could no longer access your loved one device!

As the title suggests, in fact, today I want to explain you in detail how to partition this terminal, thanks to a guide found on the forum xiaomi.eu and that I link, as usual, to the end of the article. I have already done this, and I have brought the system partition from 4 to 7GB, and I reduced the one for files from 25 to 22GB. Obviously you can repartition at your leisure.



The guide is based on Windows, but you can also do it from Linux if you are familiar with ADB and the terminal

  • much attention
  • understand the guide well
  • a lot of patience
  • ADB (I consider that it is already installed on your PC, otherwise you can find it with the Android SDK or even Lite versions around the network)
  • a minimum knowledge of ADB
  • ADB recovery driver | Download (these will be necessary to recognize the device while it is in recovery)
  • ClockworkMod installed Installation guide
  • System backup (or both in case of TDB) | Nandroid backup guide
  • TrueDualBoot disabled
  • Partition tools | Download (with registration in the forum - first post, second attachment)
  • Responsibility!! The guide is explained in detail, but any error could permanently damage your terminal. I take no responsibility.



download Partition Tools, then extract the content and copy it to your phone and move it to a good file manager / System / bin thanks to the root permissions, which are necessary to continue with this guide. Now make a nice Nandoid backup, then move it to your PC otherwise you will lose it. Also copy all your media files and everything you don't want to lose to your PC. At this point disable TDB if it is enabled, otherwise you may encounter an error. Install the drivers to recognize the device in recovery, linked above.


Prepare the device and ADB

  • Make sure you've done the above, then access the recovery and through the menu mount and storage mounted / System and dismantling / cache, respectively with options mount / systemunmount / cache
  • Connect the device in recovery to the PC, then (if it is the first time) wait for the driver installation.
    NOTE: in device management, the device name could be Galaxy Nexus rather than Xiaomi Mi2, but you can proceed the same
  • Start the Windows command prompt and move to where you installed ADB. Example: the ADB folder on my PC is in C: \ adb, so to position myself in this folder, I execute the command
    cd C: ab
  • To start using ADB, type now
    adb -d shell
  • We test that everything is ok to proceed, then type

    to verify that the root is active, e


    to verify that / system is mounted and / cache is unmounted. What you will see should be about the same as the following image
    partition-xiaomi-mi2-adb-mountNOTE: the penultimate string, "/ dev / userdata_moved on / data_root type ext4> rw, nodev, noatime, nodiratime>" must not be present! This is in fact only displayed if the TDB is still enabled, and as I said you must disable it in order to proceed.



If everything is as in the previous points, we can continue with the actual procedure to partition our terminal.

  • First of all, we print a table with information on all the partitions present on the screen. Then type
    parted / dev / block / mmcblk0 unit MB print

    where the first command will access the partitions, the second will set the megabytes as the unit of measurement and the third will print the information table precious in order to continue.

  • The table obtained will be similar to this one
    partition-xiaomi-mi2-adb-tableand the partitions that interest us are the number 2627. Also at the top we see the labels that indicate us precisely where they start and at which point they end, the size, the type of file system and the name. We then save the table obtained with a screen (recommended) or copying all the text and pay particular attention to thestart of the 26 and end of the 27. The beginning of the 26 is the same for all, the end of the 27 varies according to the memory of the device. Then it ends at 31269 in the 32GB ea 15578 in the 16GB.
  • We remove the 2 partitions
    rm 26 rm 27
  • Now let's recreate the partitions with the dimensions that interest us. So let's make this (which will be the 26) start at the exact same point where the 26 started, and choose the point where it must end depending on the new dimension. Example: if we wanted to increase the 2GB partition, we need to add 2000 to the number that identified the end in the table (5570), which would become 7570.
    mkpartfs primary ext2 1812 7570

    in the same way we do for the other partition (the 27 substitute), where now the start will be determined by the end of the newly created partition (7570 if we were to follow the example), while the end should be identical to the one obtained in the table (31269 in my case)

    mkpartfs primary ext2 7570 31269
  • Now we have to give the same name again, that is userdata e storage respectively for the 26 and the 27, and then exit from "parted", then
    name 26 userdata name 27 storage quit
  • The partitions created have a file system ext2, so we have to convert them into ext4
    tune2fs -j / dev / block / mmcblk0p26 e2fsck -fDp / dev / block / mmcblk0p26 tune2fs -O extents, uninit_bg, index_dir / dev / block / mmcblk0p26 e2fsck -fDp / dev / block / mmcblk0p26


    tune2fs -j / dev / block / mmcblk0p27 e2fsck -fDp / dev / block / mmcblk0p27 tune2fs -O extents, uninit_bg, index_dir / dev / block / mmcblk0p27 e2fsck -fDp / dev / block / mmcblk0p27
  • We check if the changes have actually been made, so we print the table again
    parted / dev / block / mmcblk0 unit MB print

    and everything should be like the previous one, apart from the latest 2 partitions, which must have different ends for the 26, different start for the 27 (but obviously identical to the end of the 26) and the desired dimensions. It is important that these are ext4, so we pay attention to this, since I got an ext3 on the 27, but I solved it by re-executing the appropriate commands.
    Here is the table I got after repartitioning my Xiaomi
    partition-xiaomi-mi2-adb-table-finalAs you can see, I've increased the data partition up to 7GB. This depends on the use you make of the terminal, in the original guide in fact the 3GB were also many and have been reduced, so it's up to you to decide how to manage the available space.

  • To end the adb session, type
    quit exit
  • Then from the menu advanced of the CWM we delete the dalvik cache and restart the phone. Our ROM will start as if it were the first time we turn on the phone, so it will take longer than usual
  • At startup we connect the phone to the PC, move the backup made previously to the correct folder (clockworkmod) and restore it from recovery. We restart again and our phone will be exactly as before but with more space available in the partition that interests us 😉


 Final results!xiaomi-mi2-memory-partitioned

I remind you to read carefully and to proceed only if you are sure of what you are doing. I hope it is clear enough, for any questions do not hesitate to ask, using the comments.

Problem: SD memory is not mounted or cannot be written to.
Solution: flash any version of MIUI.
How?:, from recovery mount / storage / sdcard0; via adb execute the command adb push update.zip / storage / sdcard0 / where update.zip is the name of the ROM. Perform the normal procedure: wipe data, cache; install zip, from SDcard and select the package

Problem: SD memory is not mounted or cannot be written to.
Solution: from ADB type the following commands

su chown media_rw: media_rw / mnt / media_rw / sdcard0 chmod 755 / mnt / media_rw / sdcard0

Thanks to Matthew


💣 Don't get away Xiaomi Mi Electric Scooter Pro 2 Global on offer for only 375 € with Mi Band 5 as a gift and free shipping from Europe!

Receive the latest posts by email

Enter the email and choose the inscriptions on the new page

Added devices
  • Compare Smartphone (0)