Backup critical partitions after root - yashaswee-exe/AndroidGuides GitHub Wiki
[!Important] You SHOULD back up the critical partitions related to cellular signal and fingerprint before making any changes. If these partitions get corrupted, you can lose your IMEI, signal, fingerprint, and hardware attestation, and without a backup it may not be recoverable.
Partitions to Back Up
| Partition | Contains |
|---|---|
modemst1 |
IMEI |
modemst2 |
IMEI |
ocdt |
Device identifiers |
persist |
Attestation key and security items |
Requirements
- A rooted device
- A terminal emulator such as Termux
- Root permission granted to the terminal emulator
Backup
Open your terminal emulator, grant it root when prompted, then copy and paste each command:
su -c dd if=/dev/block/bootdevice/by-name/modemst1 of=/sdcard/Download/modemst1.img
su -c dd if=/dev/block/bootdevice/by-name/modemst2 of=/sdcard/Download/modemst2.img
su -c dd if=/dev/block/bootdevice/by-name/ocdt of=/sdcard/Download/ocdt.img
su -c dd if=/dev/block/bootdevice/by-name/persist of=/sdcard/Download/persist.img
The files are saved to your Downloads folder.
⚠️ Move these files to your PC (and ideally a second location such as cloud storage) for safe keeping. A backup that only lives on the phone is lost if the phone's storage gets wiped or damaged.
To pull them to your PC over ADB:
adb pull /sdcard/Download/modemst1.img
adb pull /sdcard/Download/modemst2.img
adb pull /sdcard/Download/ocdt.img
adb pull /sdcard/Download/persist.img
Restore
-
Put the phone in fastbootd mode:
adb reboot fastboot -
Flash each partition (run from the folder containing the
.imgfiles):fastboot flash modemst1 modemst1.imgfastboot flash modemst2 modemst2.imgfastboot flash ocdt ocdt.imgfastboot flash persist persist.img -
Reboot:
fastboot reboot
Notes
- Back up before flashing custom ROMs, kernels, or modifying partitions.
- Partition names and paths can vary by device. If
/dev/block/bootdevice/by-name/doesn't exist, check/dev/block/by-name/instead. - Flash only backups taken from your own device. These partitions contain device-specific data, and using another device's images can break your IMEI and signal.
- Keep these files private. They contain unique device identifiers.