How to make an SD card the main memory on Xiaomi Mi 9

Owners of the flagship Xiaomi Mi 9 often face a lack of built-in storage, especially in the basic versions of 64 or 128 gigabytes. Android system overgrows cache, messengers take up gigabytes, and the quality of photos and videos is growing, requiring more space. The standard solution is to install a microSD card, but by default it works only as a portable storage for media files, which does not solve the problem of lack of space for installing applications.

Fortunately, there is a method to turn an external map into a full extension of the system partition, a process known as Adoptable Storage that integrates flash memory into the logical structure of the operating system. For Xiaomi Mi 9 this is especially true, as the device is deprived of a slot for the second. SIM-cards in some modifications, and competent memory management becomes critical for comfortable operation.

This requires not just a drive insert, but a series of technical manipulations of access rights. Data security and proper hardware preparation are key success factors. If you do the right thing, you'll have a single space where applications are automatically installed on an external medium, freeing up valuable gigabytes of internal memory.

Technical requirements and equipment preparation

Before you start modifying the file system, you need to make sure that the compatibility and quality of the components used. Xiaomi Mi 9 has a controller that supports high data rates, but the memory card itself can become a bottleneck. Using a slow drive will lead to noticeable interface lags and long application loads, as the system will access it constantly.

It is recommended to use UHS-I or UHS-II speed cards A1 or A2. These markings guarantee minimum random read and write speeds, which is critical for operating system operation. Lower-end cards can run unstable in main memory mode, causing write errors and Android malfunctions.

  • πŸ“± Xiaomi Mi 9 smartphone with unlocked bootloader (Bootloader).
  • πŸ’Ύ MicroSD memory card with a volume of 32 GB (optimum) 64-128 GB U3/A2.
  • πŸ’» Computer with drivers installed ADB and Fastboot.
  • πŸ”Œ Original. USB-cable.

⚠️ Note: All data on the memory card will be permanently deleted during the formatting process.

It is also important to check the status of the smartphone itself.The battery charge should be at least 60% so that the device does not turn off at the critical time of partition re-marking. Make sure that the phone is on debugging over USB, which is on the menu for developers.

Activation of the developer mode and debugging

To interact with the system services Xiaomi Mi 9 requires advanced access to settings. the standard interface hides many of the parameters necessary for deep work with memory. The first step will be to include a menu for developers, which is standard procedure for Android devices.

Find the About Phone option in the settings and start quickly clicking on the MIUI version. After seven clicks, the system will notify you that you have become a developer. Now, in the advanced settings, a new section will appear where you need to activate the USB Debugging slider, which will allow the computer to send commands to the device.

What to do if the developer menu does not appear?
Sometimes you need to restart your device after you activate the menu, and make sure you are logged in to your Mi Account, as some MIUI features may require authorization to access system settings.

When you first connect to a computer, you'll see a request for debugging permission on your smartphone screen, you'll check the "Always Allow from this computer" box and confirm the action, and without that step, ADB commands won't execute, and the process will get stuck in the authorization phase.

Installation and configuration of ADB tools

The computer part of the training requires a minimum set of tools to communicate with the smartphone. Android Debug Bridge platform allows you to send text commands that are interpreted by the device system. For Windows, macOS and Linux, there are ready-made packages containing the necessary binary files.

Once you download the archive with platform tools, unpack it into the root folder of the disk, for example, in C:\adb, so that the path does not contain Cyrillic and spaces. Open the command line or terminal in this folder. Check the connection by entering the command adb devices. If the list appears serial number of your Xiaomi Mi 9, then the connection is established correctly.

adb shell pm get-install-location

This command shows the current location of the applications being installed. In the answer, you'll see a number: 0 stands for internal memory, 1 for external memory, 2 for automatic selection. Our goal is to change the behavior of the system so that it perceives the formatted card as part of the internal storage.

πŸ“Š How much memory is your Xiaomi Mi 9?
64GB
128GB
256GB
I use cloud services.

Formatting a map through ADB commands

The most critical step is to force the memory card to be formatted in a system partition-compatible format, which is impossible to do with standard MIUI tools, because the manufacturer limits this function, and we use the sm (storage manager) command, which manages the storage at a low level.

First, you need to know the disk ID. Type in the console adb shell sm list-disks. The system will give you a response in disk:179.64 (the numbers may differ). Write down this ID, it will be needed for the next command. Be very careful when you type, an error in one digit can lead to formatting the wrong partition.

β˜‘οΈ Pre-formatting verification

Done: 0 / 1

The next command is the formatting command with the private flag. The syntax is as follows:

adb shell sm partition disk:179,64 private

Once this command is executed, the Xiaomi Mi 9 will restart the storage services, the card will be formatted into the ext4 or f2fs file system and encrypted with a key tied to a particular device, which means that you can’t just paste this card into another phone or computer and read the data.

⚠️ Warning: After formatting, the map becomes unreadable on the PC without special software and encryption keys. Use reliable maps to avoid data loss in the event of damage to sectors.

Setting Data Storage Priorities

Once formatted successfully, the system will suggest using the card as primary memory, and a notification may appear in the MIUI interface, but to ensure that all possible data is transferred, it is worth checking the storage settings manually.

And here you'll see the combined memory, and the system will start to gradually transfer the data and the application cache to an external medium, which can take a long time, especially if there's a lot of space on the internal memory, and don't interrupt your smartphone during the background migration.

ParameterBefore changesAfter Adoptable Storage
File system of the mapexFAT / FAT32ext4/f2fs (encrypted)
Access to PCDirect accessImpossible without root.
Installation of applicationsOnly internal memory.Automatically on the map
Speed of operationStandard.Depends on the class of the card.

For some applications, the transfer may still be unavailable if the developer has banned it in the program manifesto, in which case the use of additional utilities or root rights helps, but for most user tasks, standard Android tools are enough.

πŸ’‘

Use the Files by Google app to analyze which folders take up the most space after the transfer to manually clear the cache of heavy apps.

Possible problems and ways to solve them

When you put a card into the system, you can have unexpected situations, and often users are told that the card is damaged or slow, and this can be due to poor contact in the slot or a defect in the drive itself, and try to re-enter and re-enter the card after you turn off the device.

Another common problem is cyclical reboot or bootloop, which happens if the system files were corrupted at the time of writing, which would require a factory reset or a Fastboot flashing of the device, which is why having a backup is critical.

  • 🐌 Low speed: Replace the card with a faster one (class) A2).
  • ❌ Formatting error: Check card integrity on PC h2testw.
  • πŸ“‰ Loss of Data: Restore Backup from the Mi Cloud.

If the card is no longer defined after some time of operation, it is possible that the resource of the rewrite cycles is exhausted. Memory cards are not designed for intensive operation in the system partition mode, so their life in this mode may be lower than that of the built-in storage.

πŸ’‘

The stability of Xiaomi Mi 9 with Adoptable Storage depends on the quality of the memory card and the absence of physical damage to the slot contacts.

Frequently asked questions

Can I return the card to normal storage mode?
Yes, you have to go to your memory settings, select a card, and click "Format as portable," and all the data on the map will be deleted, and it will be available for reading on other devices again.
Will I lose my warranty on the Xiaomi Mi 9?
By itself, software setting up memory via ADB is not a reason to deny warranty, as it does not require unlocking the bootloader or obtaining root rights. However, if the service center detects software failures caused by the user, questions may arise.
Why does the camera shoot in low quality after setting up?
If the memory card is too slow, the camera buffer may overflow, resulting in a decrease in quality or frame skip. SD-map in camera settings and check the result.
Will it work on Android 10 and higher?
Adoptable Storage has been hidden by manufacturers since Android 6, but it is technically available on newer versions, including Android 10 and 11, which receives Xiaomi Mi 9. ADB Teams remain relevant.