Saving Android firmware is a critical step before any manipulation of the system: from manual updating to unlocking the bootloader. Without a backup, you risk losing not only user data, but also the ability to return the phone to a working state if it fails. This article will help you figure out how to properly create a firmware backup on devices from Samsung, Xiaomi, Google Pixel and other brands - taking into account the characteristics of each manufacturer.

We will look at both standard methods (via recovery and ADB), and alternative solutions for devices with an unlocked bootloader. We will pay special attention to the nuances: why backup via TWRP does not always save you, how to bypass manufacturer restrictions, and what to do if the phone does not turn on. If you are planning experiments with custom firmware or just want to be on the safe side before visiting a service center, these instructions are for you.

Why you need to save the firmware: 3 scenarios when a backup will save your phone

Many users think about backing up the firmware only after the phone turns into a brick. Meanwhile, there are at least three situations when system backup becomes the only way to avoid expensive repairs:

  • ๐Ÿ”„ Failed update. Even official OTA updates sometimes break devices. For example, owners Samsung Galaxy S20 after upgrading to One UI 5.1 faced endless reboots - without a firmware backup, it was possible to restore functionality only through a service center.
  • ๐Ÿ”“ Unlocking the bootloader. On devices Xiaomi, Huawei i Google Pixel this procedure erases all data, including the partition /system. Without a backup copy, you will even lose the opportunity to roll back to the factory firmware.
  • ๐Ÿ› ๏ธ Repair or replacement of components. Service centers do not always use original software. After replacing the display or battery on iPhone (yes, this also applies to Android devices with similar protections), a warning about a โ€œnon-original partโ€ may appear - a firmware backup will help return the original state.

It is important to understand the difference between a backup user data (photos, contacts, messages) and backup firmware. The first can be done through Google Drive or Samsung Cloud, and the second requires special tools. The firmware includes:

  • ๐Ÿ“ฑ System kernel (boot.img)
  • ๐Ÿ—ƒ๏ธ System partitions (/system, /vendor)
  • ๐Ÿ”‘ Bootloader (recovery, bootloader)
  • โš™๏ธ Modem software (modem, radio)
โš ๏ธ Attention: On devices with a locked bootloader (most smartphones out of the box), creating a full backup of the firmware is impossible without unlocking. Attempt to read system partitions will result in Permission denied errors in ADB or TWRP.
๐Ÿ“Š Why are you do you want to save the firmware?
Before updating the system
For experiments with custom firmware
In case the phone breaks down
Another option

Method 1: Standard recovery (for beginners)

If your phone supports creating backups via standard recovery (stock recovery), this is the simplest method. However, it is not available on all devices. For example, Samsung and Google Pixel do not provide such a function, and on Xiaomi it may be hidden.

To check for the option:

  1. Turn off the phone.
  2. Hold the combination buttons to enter recovery (usually Power + Volume up, but on Sony Xperia it can be Power + Volume down).
  3. In the recovery menu, look for the item Backup or Backup & Restore.

If there is an option, follow the instructions on the screen. Usually the process takes 5-15 minutes, and the result is saved to the internal memory or SD card in the folder /TWRP/BACKUPS/ (yes, even in standard recovery).

Manufacturer Support backup in stock recovery Alternative method
Xiaomi (MIUI) โŒ No (except for old models) Fastboot commands or TWRP
Samsung (One UI) โŒ No Odin + firmware in format .tar.md5
Google Pixel โŒ No ADB or Fastboot
OnePlus (OxygenOS) โš ๏ธ Partial (user data only) TWRP or MSM Tool
โš ๏ธ Attention: Backup through standard recovery often creates incomplete copies, excluding critical sections like modem or efs. This method is not suitable for a complete system recovery.
๐Ÿ’ก

If your recovery does not have a backup option, but there is an item Apply update from ADB, this means that the manufacturer allows partial backup via a computer. Connect your phone to the PC and use the command adb backup --twrp (ADB installed is required).

Method 2: TWRP - a universal solution for unlocked devices

TWRP (Team Win Recovery Project) is a custom recovery that allows you to create full backups of the firmware, including boot partitions. However, to use it you need:

  • ๐Ÿ”“ Unlocked bootloader (OEM Unlock in the developer settings).
  • ๐Ÿ“ฑ TWRP support for your model (check on official website).
  • ๐Ÿ’ป Computer with installed drivers ADB i Fastboot.

Instructions for installing TWRP and creating a backup:

  1. Download the TWRP image for your model (for example, twrp-3.7.0_9-0-redfin.img for Google Pixel 5).
  2. Connect the phone to the PC in Fastboot (hold Power + Volume down when turning on).
  3. Run the command:
    fastboot flash recovery twrp-3.7.0_9-0-redfin.img
    

    fastboot reboot recovery

  4. In the TWRP menu select Backup, check all sections (especially Boot, System, Vendor, Modem) and start the process.

The result will be saved in the folder /TWRP/BACKUPS/[serial_number]/. The main advantage of TWRP is the ability to restore the firmware even if the phone does not turn on (provided that the bootloader is not installed). blocked).

โ˜‘๏ธ Preparing for backup via TWRP

Done: 0 / 5
โš ๏ธ Attention: On some devices (for example Samsung Galaxy S22 s One UI 5.0+) installing TWRP can lead to a trigger KNOX and loss of warranty. In addition, after updating the system via OTA, custom recovery often crashes - you will have to reinstall it.

Method 3: ADB Backup - partial backup without root

If unlocking the bootloader is not possible (for example, on corporate devices), you can try create a backup via ADB (Android Debug Bridge). This method does not require root access, but has serious limitations:

  • โœ… Works on any Android device with USB debugging enabled.
  • โŒ Does not copy boot partitions (boot, recovery).
  • โŒ Many manufacturers (including Huawei and Xiaomi) block backup of system applications.

Instructions:

  1. Enable USB debugging in the developer settings (Settings โ†’ About phone โ†’ Build number - tap 7 times).
  2. Connect the phone to the PC and run the command:
    adb backup -apk -obb -shared -all -f backup.ab

    where:

    • -apk โ€” backup applications,
    • -shared โ€”data on the SD card,
    • -all โ€”all supported data.
  • A confirmation request will appear on the phone - enter the lock password (if you have one) and wait for completion.
  • The file backup.ab will be created in current folder on the PC. To restore, use:

    adb restore backup.ab

    Critical nuance: ADB Backup does not save the firmware in the usual sense - only user data and some system settings. This method is not suitable for fully restoring the system after a failure.

    What to do if ADB gives the error "adbd cannot open"

    This error occurs when when the ADB service on the phone is not running or is blocked by the manufacturer. Try:

    1. Restart the phone and PC.

    2. Use another USB cable (preferably the original one).

    3. Enable the option in the developer settings Cancel USB debugging authorization, then connect again.

    4. On devices Xiaomi disabling MIUI Optimization in the developer settings can help (Settings โ†’ Advanced โ†’ For developers โ†’ Disable MIUI optimization).

    Method 4: Fastboot - backup firmware for devices with a locked bootloader

    Method Fastboot allows you to create a firmware dump even without unlocking the bootloader, but does not work on all devices. For example, Google Pixel and OnePlus allow reading partitions, but Samsung and Huawei โ€”block.

    Instructions:

    1. Install Fastboot and drivers for your device.
    2. Switch the phone to mode Fastboot (usually Power + Volume Down).
    3. Get a list of available partitions:
      fastboot getvar all
    4. Create a dump of each partition separately. For example, for boot and system:
      fastboot flash boot boot.img
      

      fastboot flash system system.img

      However to read, you will need the command:

      fastboot dump boot boot.img
      

      fastboot dump system system.img

    5. Ready images (.img) can be flashed back later using the same commands. The main disadvantage of the method is manual work with each section. For automation, use scripts like fastboot_enhance (available at GitHub).

      Section Description Importance for backup
      boot Kernel and ramdisk โญโญโญโญโญ
      system Main Android OS โญโญโญโญโญ
      vendor Drivers and proprietary software โญโญโญโญ
      modem Modem firmware (communication, GPS) โญโญโญโญ
      efs IMEI and serial numbers โญโญโญโญโญ
      โš ๏ธ Attention: On devices with Dynamic Partitions (Android 10+) disk layout may vary. For example, Google Pixel 4 instead of system is used super. To work with such partitions, you will need a tool lpunpack.

      Method 5: Firmware through official utilities (for Samsung, LG, Sony)

      Some manufacturers provide their own tools for backing up and restoring firmware. Their main advantage is compatibility with locked bootloaders, and the disadvantage is that they are tied to a specific model.

      Overview of popular utilities:

      • ๐Ÿ“ฑ Samsung Odin:
        • Supports firmware in the format .tar.md5.
        • Can create a backup via the option Dump (hidden in some versions).
        • Works only with official firmware from Samsung.
      • ๐Ÿ”ง LGUP (for LG):
        • Allows you to save the firmware in the format .kdz.
        • Requires a special cable LG USB Driver.
      • ๐ŸŽฎ Sony Emma (for Sony Xperia):
        • Official tool for restoring firmware.
        • Supports backup via Newflasher (unofficial fork).

    Example of working with Odin:

    1. Download the latest version of Odin (for example, Odin3 v3.14.4).
    2. Switch the phone to mode Download Mode (Power + Volume down + Bixby for Samsung).
    3. Connect the device to the PC - a message will appear in Odin Added!!.
    4. Press Dump and select the folder to save the firmware.

    Firmware files will be saved as separate .img or .bin For recovery, use the same utility, but selecting the option Flash.

    ๐Ÿ’ก

    Official. Utilities (Odin, LGUP) are the only way to create a backup of the firmware on devices with a locked bootloader and without root access. However, they only work with original software and can reset user data.

    What to do if the phone does not turn on: emergency methods

    If the device does not respond to the power button, but is detected by the computer in Fastboot or EDL (Emergency Download Mode), there is still a chance to save the firmware. Let's consider two scenarios:

    1. The phone is visible in Fastboot

    Use the command to dump critical partitions:

    fastboot dump boot boot.img
    

    fastboot dump recovery recovery.img

    fastboot dump system system.img

    If the phone does not respond to commands, try flashing temporary recovery:

    fastboot boot twrp-3.7.0.img

    This will launch TWRP without installation, allowing you to create a backup.

    2. Phone in EDL mode (Qualcomm 9008)

    For devices on processors Qualcomm (most Xiaomi, OnePlus, Sony):

    1. Download QFil or Mi Flash (for Xiaomi).
    2. Connect the phone to the PC by holding the buttons Power + Volume up (to enter EDL you may need to close the contacts on the board).
    3. In the utility, select Read Back and specify the path to save firmware.

    In EDL mode, you can restore even a completely โ€œbrickedโ€ device, but the process requires technical skills. For Mediatekdevices (Realme, Oppo), a similar mode is called BROM and works through SP Flash Tool.

    โš ๏ธ Attention: Work in EDL/BROM mode can lead to hardware damage if you use incorrect firmware or interrupt the process. For example, flashing a file preloader from another model Mediatekdevice is guaranteed to kill the phone.

    FAQ: Frequently asked questions about Android firmware backup

    Is it possible to save the firmware without unlocking the bootloader?

    Yes, but with serious limitations. On most devices, you can only backup user data through ADB Backup or standard means (for example, Samsung Smart Switch). A complete firmware dump (system, boot) without unlocking is only possible through exploits (for example, DirtyCOW on older versions of Android) or the manufacturer's official utilities (Odin for Samsung, LGUP for LG).

    How to check the integrity of a backup firmware?

    To check, use:

    • ๐Ÿ”น Checksums: Compare MD5/SHA-1 hashes of the original and saved files (certutil -hashfile backup.img MD5 in Windows).
    • ๐Ÿ”น Mounting images: Connect system.img as a disk in Linux or via DiskInternals Linux Reader in Windows.
    • ๐Ÿ”น Test recovery: Try flashing the backup to another device (if any) or to the emulator.

    If the backup was created via TWRP, check the log file /TWRP/BACKUPS/log.txt โ€”there should be no errors like this Failed to mount /system.

    How much space does a full firmware backup take?

    The volume depends on the model and version of Android:

    • ๐Ÿ“ฑ Budget devices (Android Go, Redmi 9A): 1โ€“3 GB.
    • ๐Ÿ“ฑ Flagships 2020โ€“2022 (Samsung Galaxy S21, OnePlus 9): 4โ€“8 GB.
    • ๐Ÿ“ฑ Modern flagships (Google Pixel 7, Xiaomi 13): 8โ€“12 GB (due to section super with dynamic partitions).

    We recommend using an external drive or PC to store backups. Compression (for example, through 7-Zip with the LZMA2 algorithm) can reduce the volume by 30-50%.

    Is it possible to restore a firmware backup to another device?

    Technically yes, but strongly not recommended. The firmware is tied to:

    • ๐Ÿ”น Hardware platform (for example, msm8998 for Snapdragon 835).
    • ๐Ÿ”น Screen and sensor resolutions.
    • ๐Ÿ”น IMEI and serial numbers (section efs).

    An exception is restoration to an identical model (for example, from Xiaomi Redmi Note 10 to another Redmi Note 10). In this case, first check that the versions match bootloader and modem.

    How often should you update the firmware backup?

    Recommended frequency:

    • ๐Ÿ”„ After each update systems (even minor).
    • ๐Ÿ”„ Before installing custom firmware or modifications (root, Magisk).
    • ๐Ÿ”„ Once every 3-6 months for everyday use.

    Tip: keep at least 2 latest versions of backup. For example, if after updating to Android 13 bugs appear, you can roll back to Android 12.