NV partitions and backup
Five partitions hold per-unit identity and calibration data. You cannot make this data again from a different phone, from a firmware package, or from the cloud. Reports say that an overwrite of these partitions is effectively not recoverable. This is true especially with data from a different device. An overwrite can permanently break the modem.
The five protected partitions
| Partition | Contents |
|---|---|
modemst1 |
Modem working copy: IMEI and network calibration |
modemst2 |
Modem working copy (second store) |
fsg |
Factory “golden” copy of the radio data |
fsc |
Modem NV and factory data |
persist |
Wi-Fi/Bluetooth MAC addresses, sensor calibration, and device keys |
WARNING: Do not write the
modemst1,modemst2,fsg,fsc, orpersistpartition of a different unit. This can damage the IMEI and the calibration of the phone. A poster who did this reported that the phone stayed on a previous Android version with a patched baseband, band restrictions, and no OTA. The poster said there was “no way back”.
Why a backup is mandatory
- The unlock of the boot loader wipes
userdata. - If you are not careful, a flash of an OS over EDL can overwrite NV.
- Wi-Fi does not work again without
persistafter a reflash.modemst*andfsghold the IMEI and the calibration. - A mainline or Linux bring-up can start the modem DSP. Wi-Fi is not possible without the modem DSP. The
rmtfsservice of the modem DSP reads these partitions. Ifrmtfsis writable, it can corrupt them.
Safe backup order
- Document the plan. Make a list of the partitions that the dump does not include.
- Do a full EDL partition dump. Use
printgpt, then read each partition except the partitions on the list. - Write a
SHA256SUMSmanifest. - Make sure that the manifest is correct.
- Copy the backup to a second, offline location.
- Make sure that the copy is correct.
- Only then, write to the device.
WARNING: Do not write to the device before steps 1 to 6 are complete. A write without a verified backup can destroy per-unit data that you cannot recover.
A typical EDL dump does not include userdata (it is large and personal). It usually also does not include system_b,
vendor_a, and vendor_b (they are empty or redundant). The dump must include the NV set and the
stock firmware partitions that are necessary for a subsequent restore:
modemst1 modemst2 fsg fsc persistabl_a frp boot_a oem_a modem_a dsp_a bluetooth_a system_armtfs safety
On SDM630, WCN3990 Wi-Fi runs its WLAN MAC on the modem Hexagon. rmtfs gives modemst1,
modemst2, and fsg to the modem Hexagon over QMI.
WARNING: Always operate
rmtfsas read-only. Use-rin each command. Ifrmtfscan write, it can corrupt the live NV partitions.
These are the read-only commands:
rmtfs -r -o /run/rmtfs-copy # isolated tmpfs copies, no -P# orrmtfs -r -P -s- Always pass
-r. - Use
-owith copies in RAM or tmpfs. Then the live eMMC partitions are not open for writing. - During bring-up, do not start
rmtfswithout-r.
Secondary backup (QCN)
Some builds have a diagnostic or QCN path for the modem NV. An example is a USB test mode with QPST
or QCP tooling. If this path is available, make this backup before an unlock or an EDL write. It is
a second copy that is separate from the EDL dump. It does not replace the EDL dump, and the EDL dump does not replace it.
Restore caveats
- A backup does not prove that a restoration works. Practice on a device that you do not need, or accept the risk.
- Do not use the NV images of a different unit.
- Keep the NV set offline and not shared. It has the IMEI and device keys.