When you experiment with custom ROMs, beta builds, or risky tweaks, a full system partition backup is the safety net that lets you roll back to a known‑good state. Unlike a regular app‑data backup, this captures the entire /system image – the core OS files, pre‑installed apps, and system‑level settings.
/data).Build number seven times, then Settings > System > Developer options > USB debugging.adb and fastboot).Fastboot operates at the bootloader level, which has direct access to flash partitions. As long as the bootloader is unlocked, fastboot can read and write any partition, including /system. Unlocking the bootloader does not require root, but it does wipe user data on most devices – that’s why we stress a separate personal backup first.
adb devices
You should see a line like 0123456789ABCDEF device. If it shows unauthorized, unlock the phone and tap “Allow USB debugging”.adb is in your PATH.Most manufacturers require an explicit unlock command. The process varies:
adb reboot bootloader then fastboot flashing unlock. Confirm on the device with the volume keys.fastboot oem unlock or fastboot flashing unlock. Check the manufacturer’s developer site for the exact phrase.Warning: Unlocking erases /data on most phones. Ensure your personal backup is complete before proceeding.
From the ADB shell, issue:
adb reboot bootloader
The screen will show a fastboot prompt (e.g., “Fastboot mode”). If your device uses a different key combo (Power + Volume‑Down), you can also power off and hold those keys manually.
Run the following command while in fastboot mode:
fastboot getvar all
Look for a line like system: /dev/block/bootdevice/by-name/system. The exact name (usually system) is what you’ll use in the next step.
Use the fastboot flash command with the --download flag (available in newer fastboot versions) or the fastboot oem variant. The most universal method is to use fastboot pull:
fastboot pull /dev/block/bootdevice/by-name/system system.img
If your fastboot version does not support pull, you can use the following workaround:
adb sideload (e.g., TWRP). This does not require flashing the recovery permanently.adb shell dd if=/dev/block/bootdevice/by-name/system of=/sdcard/system.img.adb pull /sdcard/system.img ./system.img.Both methods create a system.img file (typically 300‑600 MB) on your computer.
After the transfer finishes, run a quick checksum comparison:
sha256sum system.img
Note the hash value. Later, after a restore, you can recompute the hash to ensure the image wasn’t corrupted.
System images compress well with xz or zip:
xz -9 system.img # results in system.img.xz
Store the compressed file on an external drive or cloud storage. Keep the original hash in a text file for future checks.
Should you need to revert to the saved state, the process is the reverse of the backup. Only attempt a restore if the device still boots into fastboot mode.
adb reboot bootloader
If you kept the image compressed, decompress first:
xz -d system.img.xz
Then flash:
fastboot flash system system.img
Some devices require the fastboot flash command to be prefixed with fastboot --disable-verity --disable-verification flash system system.img to bypass Android Verified Boot (AVB). Use this only if the device refuses to flash otherwise.
fastboot flashing lock
Locking restores the device’s security posture. After locking, the device will reboot and may perform a factory‑reset – be prepared.
fastboot reboot
The phone should boot into the exact system state captured in system.img. If you see boot loops, you likely flashed an image that doesn’t match the device’s firmware version. In that case, repeat the backup on a matching firmware.
fastboot binary is in your system PATH. On Windows, install the Google USB Driver via the SDK Manager.pull. Use the TWRP sideload workaround described in step 5.OKAY for each packet.With a verified system.img in hand, you now have a reliable rollback point for any system‑level experiment. The workflow uses only ADB and fastboot, tools that are part of the official Android SDK, and it works on the majority of fastboot‑compatible devices without requiring root access.









