Skip to content

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, or persist partition 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 persist after a reflash. modemst* and fsg hold 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 rmtfs service of the modem DSP reads these partitions. If rmtfs is writable, it can corrupt them.

Safe backup order

  1. Document the plan. Make a list of the partitions that the dump does not include.
  2. Do a full EDL partition dump. Use printgpt, then read each partition except the partitions on the list.
  3. Write a SHA256SUMS manifest.
  4. Make sure that the manifest is correct.
  5. Copy the backup to a second, offline location.
  6. Make sure that the copy is correct.
  7. 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 persist
abl_a frp boot_a oem_a modem_a dsp_a bluetooth_a system_a

rmtfs 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 rmtfs as read-only. Use -r in each command. If rmtfs can write, it can corrupt the live NV partitions.

These are the read-only commands:

Terminal window
rmtfs -r -o /run/rmtfs-copy # isolated tmpfs copies, no -P
# or
rmtfs -r -P -s
  • Always pass -r.
  • Use -o with copies in RAM or tmpfs. Then the live eMMC partitions are not open for writing.
  • During bring-up, do not start rmtfs without -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.