What is stored on nvram android. How to make and restore an NVRAM backup - Lenovo smartphones - general questions - Lenovo Forums RU. If there is no backup

What is NVRAM

NVRAM in the application to smartphones on the MTK platform is a service area in non-volatile memory that stores IMEI, MAC addresses for WiFi, BT, and much other information unique to your smartphone. When you do a factory reset, a copy is made from this partition to the user data /data partition, and Android uses this data.

What is the risk of damaging the NVRAM partition?

WiFi, BT, and mobile communications that are malfunctioning or not working at all

How can you ruin an NVRAM partition?

Incorrect version of the SP Flash Tool when flashing the firmware (which is why it is recommended to use the version that comes with the firmware), full memory formatting in the SP Flash Tool (in rare cases you have to do this operation), incorrect recovery script.

These problems can be avoided if follow a simple rule: Having received a smartphone in your hands, the first thing you need to do is make a backup (including the NVRAM partition, or at least just that) and save it on your computer!

Perhaps there will be some problems with it and you will have to return it under warranty, it happens that the firmware with which it came is simply not found on the network, perhaps you will re-experiment with the firmware.... I recommend making a full backup, and then experiment.

To create a backup, you must have root rights on your phone or have TWRP recovery installed.

A backup of the NVRAM partition can be obtained in the following ways:

Spoiler

Using TWRP custom recovery.

If your phone already has an extended TWRP recovery, you can make a backup in it to restore (in it) all the main system partitions - just press the button in the main menu

Backup, tick all the boxes Select partitions to back Up , check the box to enable compression Enable compression , set a name by pressing Set Backup Name and swipe right to start creating a backup

Spoiler

After that, reboot and, having connected the smart phone to the PC, copy the TWRP\BACKUPS\name of your backup folder to a safe place. From such a complete backup you can always restore any necessary partition, including NVRAM

Spoiler

Using the MTK Droid Tools program from a PC.

Most owners of phones on the MTK platform know this powerful tool.

Download the latest version from here(the link is the author’s, it will be the simplest form of gratitude to download the program from it)

  • On the phone in the settings in the "Developer Options" section it is enabled USB Debugging. If you don’t have the “Developer Options” section in your settings, then go to the “About phone” item in the settings and tap on the build number 7 times to turn on the display of the “Developer Options” section.

After that, run MTKdroidTools.exe as administrator and connect the cable to the port on the PC motherboard (on the back)

After the program detects your phone, a colored rectangle will appear in the lower left corner, indicating the capabilities of working with the phone.

If this rectangle green, as in the screenshot - everything is fine, there is a root shell

Spoiler

If this rectangle yellow, then you need to click the button at the bottom right ROOT and follow directions

Spoiler

Most often, the program manages to obtain a temporary root shell.

After that, press the IMEI/NVRAM button, check the checkboxes /dev/nvram And /data/nvram and press the button Backup. Upon completion of work, two files with the extensions bin and tar and information in the name about the phone name, IMEI and the date/time of creation of the NVRAM backup will appear in the subfolder of the BackupNVRAM program.

Spoiler

Spoiler

Download archive and unpack it into a folder with full access for you (preferably without spaces or Russian letters in the path), in which you will store your NVRAM backup.

Check before starting that:

  • The antivirus is temporarily disabled on the computer
  • ADB drivers are installed on the computer
  • On your phone, USB Debugging is enabled in the Developer Options section of your phone. If you don’t have the “Developer Options” section in your settings, then go to the “About phone” item in the settings and tap on the build number 7 times to turn on the display of the “Developer Options” section.

Connect the phone cable to the port on the PC motherboard (on the back) and run NVRAM_backup.bat, upon completion of work, a file will appear in the folder nvram.img.

I once wrote on the subject of a subject on a neighboring forum. If the rules do not prohibit, I will post the message in full here. Let's say this

so, the second edition.)) Before that I wrote on this topic, but I backed up nvram.img with a g-script dump and restored it with FlashTool. I learned backup and restore commands from this topic. They work flawlessly, thanks to javum for them.

In some ways it looks like a summary of this topic.)

Spoiler

This is not the first time that someone has been asked to comment or provide clarification on one post in a personal message.
Since this directly relates to the topic, I decided to post a new edition here. I hope it's not so vague this time.

The IMEI on our devices crashes when formatting, and sometimes when flashing FlashTool firmware.
To understand the nature of this phenomenon, it is necessary to plunge into the bowels of EMMC. There is a section /dev/nvram. It contains IMEI, SN, MAC addresses of network interfaces, etc.
If you open a scatter, you can find it in the 16th line - __NODL_NVRAM 0xe00000. Start of line __NODL_ makes the flash drive ignore this item. Why, despite this, he sometimes erases it - I don’t know. This is precisely the reason for the disappearance of IMEI after the firmware, and as is clear from the previous one, not only IMEI. That is, we delete the section without giving anything in return!
So /dev/nvram is flashed at the factory and all further official updates and firmware do not even dare to think about touching it. No matter how the software part changes, it remains unchanged. In rare cases, the manufacturer makes changes to it and releases firmware for service centers, including this section.

In the working system, IMEIs are located along the path /data/nvram. More precisely /data/nvram/md/NVRAM/NVD_IMEI/. The /data/nvram directory is created when the device is first started by copying the contents into it /dev/nvram. It is a common recommendation to save the /data/nvram folder for future recovery. This is, of course, fair, as are calls for backup in principle. You will restore calibrations with the existing ones, but this directory is useless when restoring the /dev/nvram partition.

What needs to be done to avoid problems in the future?
First, you need to create a complete memory dump of the device. I recommend doing this immediately after purchasing the device, before you start searching for the best firmware in the world. Depending on the dump method, among other files there should be a file nvram.img. It is img size 5242880. This is the image of the required partition. All sorts of nvram.tar and other ext4 are copies of /data/nvram and are of no interest.
To create only an image of the /dev/nvram partition, you can use the command:
dd if=/dev/nvram of=/sdcard/nvram.img bs=5242880 count=1
5242880 is the partition size for devices on platforms 6577-6589. As a result, a file will be created along the sdcard path nvram.img. We save it in a safe place.

How to recover a worn out /dev/nvram partition?
The easiest way is to copy a previously saved file to the device memory and type the command:
dd if=/sdcard/nvram.img of=/dev/nvram
The result of successful execution of the command will be the lines
10240+0 records in
10240+0 records out
5242880 bytes transferred in…..
To flash this section with FlashTool, find the line in the scanner __NODL_NVRAM.... and delete it __NODL_, after which in the program window we select our nvram.img. We choose. Although it will become available in the program window, FlashTool itself will not pick it up.
Sometimes the flash drive does not want to sew this section separately. In this case, you need to download the firmware for the flash drive, open the corrected file and check, among other things, nvram.img

In order to flash FlashTool using the Upgrate method, which requires including all items, only the sections necessary at the time, we do the following:

Open scatter in any text editor.We add to the beginning of the line the section we want to exclude__NODL_. For example __NODL_PRELOADER 0x0. Save and open the scatter FlashTool and sew only those sections that remain uncommented, maybe FlashTool will not see them.
This trick allows you to both hide and open hidden scatter points. Thus, you can selectively flash the necessary partitions via Upgrate, for example nvram.

How to restore a partition if there is no backup?
To do this, you need to use the file from the donor. Ask someone on your device's thread to lend you their nvram.img. How to get it is written above. The disadvantage is obvious, we get someone else’s IMEI, MAC, etc. I don’t know how to edit nvram.img, but there are software tools for editing the /dev/nvram partition (links below). After successfully making changes to the section, save it with the command above.

How to find out whether /dev/nvram is overwritten or not?
It makes sense to check only if you have “lost” IMEI at least once. To do this, just reset the device to factory settings in recovery, thereby deleting /data. If after the first launch the IMEI is still missing, then everything written above is for you..

A reasonable question arises: why all this Kama Sutra, when you can restore IMEI in a minute using software?
It is possible, but you will “restore” it to the address /data/nvram, and the “article” is about how to restore an important partition, in which, in addition to having a lot of necessary things and after overwriting it, problems of various nature are noted. In addition, it will crash again during the next flashing.

Please note that the new version of MTK Droid Tools has a /dev/nvram backup function. Saves with the extension .bin

The methods have been tested and work. I restored three live devices and four offline. The last one was less than an hour ago in kumys.

The Android system is highly customizable, as even a beginner can customize an Android smartphone or tablet. There are actually various methods by which you can optimize, customize and personalize your device, and it's up to you to leave it as is or let your imagination run wild. In any case, if you want to learn how to become an advanced Android user, you should start with the basics. Thus, today we will show you how to perform a backup operation to save (and also restore if necessary) the IMEI and NVRAM data of an Android device.

IMEI and NVRAM store extremely important data on a smartphone or tablet. As you may know, if this data is corrupted or if you lose the information stored in the IMEI and NVRAM partition, the Android device will not be able to function at all. In fact, you will face - you will have to take your device for service to get it repaired (you will most likely have to pay for technical assistance even if under warranty, since usually the IMEI and NVRAM data are erased when you perform custom or unofficial operations) .

In any case, our goal is to teach you how to avoid these unpleasant situations, so you need to learn how to create and repair IMEI and NVRAM on any Android device. As you will see, the backup process is easy to complete since you can use a special tool. Don't worry, the operation is safe and secure and you don't need to use complicated or risky tools. Moreover, we will not do anything unofficial, so you will not lose the warranty of your Android device, but learn how to backup IMEI or NVRAM.

Why and when should you perform the backup process? As already stated, you need to perform a backup operation before applying any other custom or unofficial process. Basically, you should save the IMEI and NVRAM data of the Android device before performing operations such as: installing custom recovery (like CWM or TWRP), installing such as LineageOS, AOKP or Paranoid Android, installing custom kernels, removing viruses etc. It is important to know that during these procedures a wipe (hard reset) is usually applied; Well, during cleaning, IMEI and NVRAM data can also be damaged or erased.

What information is stored in the IMEI and NVRAM section? Firstly, IMEI stands for International Mobile Equipment Identity and stores 15 decimal digits (14 digits plus a check digit). These numbers contain a unique identification number for GSM, UMTS, LTE devices, so without these data you cannot use your Android device at all. On the other hand, NVRAM (Non-volatile Random Access Memory) is a specific memory that retains data after the device is turned off. It consists of SRAM and EEPROM chips. NVRAM contains data such as WiFi and Bluetooth MAC address, Baseband version, IMEI/MEID number and other important information.

With IMEI everything is simpler than with NVRAM data. Why? The IMEI number can be easily viewed - you can dial "*#06#", you can go to "Settings - About phone - Status - IMEI" or you can look at the IMEI numbers on the back of your Android device, next to its battery. Unfortunately, NVRAM data cannot be retrieved that easily, and if you lose it, you won't be able to get it back. This is why the backup process is more than recommended - you simply save the information temporarily and restore it when necessary, which is just a precaution.

Now, to perform this special backup operation, you will first need to make sure that there is a computer nearby; An Android device and its USB cable are available. You should temporarily disable antivirus protection on your computer as security features may interfere with the download process (you will have to download a backup tool on your computer first). Additionally, you need to enable USB debugging on your Android device. This can only be done after activating the developer options, so first go to “menu - settings - about phone” and click on the build number several times. You will eventually access “Menu - Settings - Developer Options” and tap on the USB Debugging box.

We also recommend that you charge your Android device before backing up the IMEI/NVRAM data. If your device goes offline during the backup process, it may become damaged, so it is best to avoid such situations. In a few words, check the battery status, and if the remaining power is below 50%, do not proceed with the backup save without recharging the phone.

This backup process is general, so you have no restrictions - you can follow it and apply the steps below for any Android device.

Backup IMEI and NVRAM from any Android device

  1. Download the PC backup tool from here.
  2. Save it to your desktop and unzip it to any location you prefer.
  3. Now connect your Android device to your computer; establish a USB connection by connecting the USB cable.
  4. Launch the backup tool on your computer.
  5. In the window that appears, at the bottom of it, click the “root” button.
  6. Then simply press the IMEI/NVRAM button and select “Backup” from the drop-down window.
  7. Wait until the backup process is complete and disconnect the USB cable at the end.

How to repair IMEI and NVRAM on any Android device

  1. Launch a backup application on your computer.
  2. Establish a connection between your Android device and your computer.
  3. In the backup application, press the "root" button.
  4. Then select “Restore” and simply select the saved IMEI/NVRAM data from the BackupNVRAM folder located on your computer.
  5. Wait a few seconds and then disconnect the USB cable.

That's all; you have successfully backed up the IMEI and NVRAM data from your Android device. So now you can safely perform any other custom, risky and unofficial operation you want.

NVRAM is a special memory area on modern smartphones with the Android operating system. When you turn on the phone for the first time, information regarding the phone’s IMEI, connected SIM cards, etc. is recorded in this section. If the firmware on the smartphone is unsuccessful, the file from NVRAM may be erased, and some important information will be lost. In some cases, this leads to loss of functionality of the smartphone.

How to determine that the problem is in NVRAM

Loss of NVRAM is often the result of incorrect rollback of settings through third-party programs, partial or full firmware, also done incorrectly. Signs that indicate file loss:

  • If you turn on Wi-Fi on your smartphone, a network appears with the name “NVRAM warning err=0x10”;
  • After entering the USSD command *#06# no IMEI codes are received in the response message, because they are stored in NVRAM.

In some cases, the phone cannot detect the SIM card network.

Recovery methods

Before starting the recovery process, it is recommended to charge the smartphone at least 50%, preferably completely. It doesn’t matter what method you use to return the lost file, this procedure takes some time and you don’t want your phone to run out of power.

Restoring from a backup

To do this, you need Root rights on the phone. Restoration is only possible if the owner made a full backup before flashing the firmware. It is recommended to save the backup file on your PC so as not to lose it when recording a new OS on your smartphone. Restoring NVRAM from a backup:

  1. Launch the recovery application on your phone;
  2. Connect your smartphone to your PC via USB;
  3. Enable Root access on your smartphone;
  4. Click the Restore button;
  5. Follow the system instructions on the device.

Menu appearance and user actions may vary slightly across devices and operating systems.

Via TWRP Recovery

The TWRP Recovery application can be downloaded. It is free and can be installed directly on your smartphone. TWRP Recovery allows you to restore the entire system or individual parts, including NVRAM.

  1. Launch the application;
  2. Enter the “Restore” menu;
  3. Find the desired backup option;
  4. Select the partitions that the user wants to restore;
  5. Confirm your choice.

Via SP Flash Tool

The program is designed to work with device firmware. You can download SP Flash Tool on the official website of the developer. You need to connect your smartphone to a PC with the utility installed via USB:

  1. Launch SP Flash Tool;
  2. Find phone by program;
  3. Go to the “Write Memory” tab;
  4. In the File Path section, specify the path to the file with NVRAM;
  5. Press the memory recording button;
  6. Reflash your smartphone with the factory version of the OS.

Via terminal

The algorithm for working with the ADB utility is similar to the previous options. You need to connect your smartphone to your PC, specify the path to the NVRAM file and click the Root button.

To work with the utility, Root rights must be installed on the phone.

If there is no backup

Not every user is prudent enough to make a backup before installing the firmware. If there is no copy of an important file, there are ways to recover without it.

Using the patch

A special patch was created to restore NVRAM. You can download the patch. The following is the algorithm:

  1. Install the archive into the phone’s memory using one of the programs listed above, for example, TWRP;
  2. In recovery mode on your smartphone, find a file called “Patch IMEI Fixing” and run it;
  3. Wait for the installation to complete.

SN Write Station Tool

The program is free, you can download SN Write Station Tool. Installs on a PC and works with a smartphone via a USB connection. SN Write Station Tool is designed to repair IMEI.

Best compatible with Windows 7; may be unstable on other operating systems.

IMEI&SN Writer

You need to download and install the utility on your computer. Further:

  1. Connect your smartphone to your PC;
  2. Set up a connection in IMEI&SN Writer (check the USB box);
  3. Select partitions to recover in the Write Litem tab;
  4. Press the large START button to start the recovery.

Overwriting IMEI after flashing is a common problem that owners of smartphones based on MKT chips face more often than others. A “free” device simply will not be able to catch the net and turn into a beautiful toy. Restoring the device is a complex and expensive procedure. However, this can also be done at home. Now we will tell you how.

Process mechanics

IMEI destruction occurs due to erasure of the nvram information file. It also stores the serial number of the device, calibrating the wireless equipment. To restore this file, all information will have to be rewritten manually. Understanding this process is not easy, so we are considering replacing your damaged nvram file with a donor one, which can be downloaded on the Internet.

After replacement, the serial number, address and IMEI of the device will match the donor. The smartphone will start ringing, but then it is better to seek professional help. You can also “disguise” the IMEI as your “native” one yourself. But after the next reset, the donor information will return.

We also recommend that you first read the article “Flashing Lenovo, Fly, Huawei, etc. based on MTK while preserving IMEI.” It will help you not to be left without an IMEI if the phone is still working fine.

Warning:

This instruction is not a guide to action. The resource administration is not responsible for what you do with your smartphone or tablet.

Preparation

The first thing you need to do is flash your smartphone with clean firmware, as indicated in the article above. Also enable installation of programs from unknown sources.

Next, get root and install the modified recovery using one of the methods in the article “Easy ways to get Root on devices with an MTK65XX processor”

Find a donor file on the Internet nvram and download to your device's memory card. The file should look like this.

You will also need to download the Terminal Emulator for Android application and download the Mobileuncle MTK Tools program if you want to “register” your IMEI after the recovery is complete.

Anticipating questions: yes, this is the easiest IMEI repair method.

Installing the nvram donor file on the system

So the file nvram.img on the memory card, root received, Terminal Emulator for Android installed. Now log into Terminal Emulator for Android, confirm root permissions and enter the command S.U., confirm the selection with the “enter” key. You will see a shell prompt (#).

In the terminal we write the command dd if=/sdcard/nvram.img of=/dev/nvram

When the process is completed, Terminal Emulator for Android will show text like this.

Now read the article “Reset your Android device from Recovery mode” and reset the settings to factory settings. The smartphone will start and begin to connect to the network. In principle, we can stop there. But walking around with someone else's IMEI is illegal. Let's enter yours.

Replacing IMEI with “native”

Copy the IMEI from the box or back cover of the device onto a separate piece of paper. If root rights are not lost, reinstall Mobileuncle MTK Tools and run the program.

Now find the menu Engineer mode - MTK engineer mode

Scroll to the tab Telephony and we find CDS Information

Now go to Radio Information - Phone 1 and enter the command AT+EGMR=1.7, "IMEI". Here "IMEI" is your IMEI copied from the box.

Click Send AT command, reboot your smartphone and be happy with your IMEI.

But if the device has two SIM cards, you will need to enter the second IMEI. We make our way again CDS Information - Radio Information - Phone 2, but now we use the command view AT+EGMR=1.10, "IMEI". We enter it again, reboot, check that the IMEI is correct in the settings and calmly use the device.