Odin NAND Erase Guide | Re-partition Samsung Devices

O

Odin is mostly used by users to flash firmware binaries and custom recovery. However, Odin can also be used to re-partition, flash lock, decompress data, flash user data, and erase all data on Samsung Galaxy devices. You can even erase FRP (Factory Reset Protection) and perform some very complicated tasks. In this tutorial, explain what Odin NAND Erase or NAND Erase All is, and how you can use it to erase all data and re-partition a Samsung phone or Galaxy Tab.

Actually, Odin is not just a simple flash tool for flashing the stock firmware. It is meant to be used only in the Samsung service centers by Samsung engineers to fix non-functional Galaxy devices. Do you know that Odin can flash or install the firmware on more than 60 Galaxy devices at the same time?

Anyway, let’s keep our focus on Odin’s ‘Nand Erase’ option. I know a lad who enabled Nand Erase in Odin while installing the firmware on his Galaxy S9 just out of curiosity. You know what, he ended up with a bricked phone. Nand Erase had wiped all partitions on his S9 including EFS, boot, recovery, kernel & system partitions. Fortunately, he was able to fix his phone by following one of my tutorials published on another website.

NAND Erase Meaning in Odin

NAND and NOR are actually 2 main types of flash memory, that is related to computers and it stores the BIOS settings to the ROM of a computer. Since Android devices don’t have a BIOS, flash memory or NAND relates to the bootloader and OS kernel that work together to boot Android devices into the system.

NAND is neither an acronym of a term used to express a boolean or logic gate “NOT AND“. Being a non-volatile memory, it keeps the essential OS data even when your Android smartphone is turned off.

Thus, when it comes to Android, NAND memory stores the following partitions of your Android device.

  • boot
  • kernel
  • recovery
  • system
  • data
  • cache
  • .android_secure
  • datadata
  • wimax
  • efs
  • preload

When you create a nandroid backup, an exact mirror all above partitions and directory structures are created. Similarly, when you perform a NAND erase in Odin, you wipe all the partitions on your Samsung Galaxy device. In simple words, you’ll end up with a device without an operating system. A sheer piece of hardware is all you get as the boot, kernel, system recovery, data, EFS, etc. have already been wiped. Obviously, your Samsung phone or tablet won’t boot up at all except to the Odin or Download Mode.

You cannot fix a Samsung device after an unintentional NAND erase action by simply flashing the stock firmware. Since NAND erase wipes all existing partitions from the device’s storage, you’ll have to re-partition your device in Odin with the help of an appropriate PIT (Partition Information Table) file.

What is Re-partition in Odin?

As I already mentioned above, the flash or NAND memory on Android devices is divided into partitions and block structures. These partitions are essential to the proper functioning of a device. It’s the PIT file that tells Odin how much space to allocate to boot, kernel, system recovery, data, EFS. Not just that, it is also responsible for the location and path of these partition blocks on the internal storage.

The Re-partition option in Odin is not meant to be used during a normal firmware flash. If you have to install a firmware, just add the BL, AP, CP, and CSC files to Odin and do not change the default settings.

The PIT file determines the structure, location, and size of specific partitions. Since a NAND erase wipes all partitions, the only way to re-partition your device using is to flash a PIT file that is strictly for your Samsung Galaxy device model and storage capacity. Flashing a wrong PIT may result in a semi-bricked device. Moreover, if you flash the PIT file of a 128GB device model on a 256GB model, your phone may be configured to show only 128GB as available storage. I personally experienced this issue on my Nexus 6P.

You must not enable the Re-Partition option in Odin unless you got the correct PIT file. When you click the Pit tab in Odin, it will show you a warning.

pit warning in odin
Odin warning on PIT selection

It means that you don’t need to flash a PIT file in normal circumstances. In certain situations, when your Samsung device’s partition table is corrupted, flashing the PIT manually can be the only way to fix the issue. If you find the IMEI number of your Samsung Galaxy phone missing, it might be due to corrupt EFS partition. You can restore the lost IMEI by flashing the Partition Information Table. You can follow these steps to flash only the PIT file in Odin.

  1. Boot your device into the Download mode.
  2. Launch Odin and connect your device to the PC.
  3. Add the BL, AP, CP and CSC binaries to the corresponding sections.
  4. Select the Re-Partition option.
  5. Click the PIT tab and add the correct PIT file for your device model.
  6. Hit the Start button on Odin wait for the installation to be finished.

Please keep in mind that the re-partitioning procedure will wipe your phone’s data so take a backup before you proceed.

Steps to Re-Partition and Nand Erase using Odin

Finally, let’s see how we can perform a NAND erase in Odin and re-partition a Samsung device by erasing userdata and all partitions. You can also fix your phone in case you accidentally or unknowingly erased all data. The steps described below will also help you restore the lost IMEI on your Galaxy smartphone.

Below are the steps to flash stock firmware on Samsung devices with the Nand Erase and Re-partition option enabled.

Preparations and downloads

There are a few things that you must do before you jump into the action.

    1. Download the appropriate firmware for your smartphone or Galaxy Tab. Here are 6 best Samsung firmware download tools and websites from where you can download the BL, AP, CP, and CSC files for your device. When the firmware is downloaded, extract the ZIP file.
    2. Install the Samsung USB driver on your PC.
    3. Download the latest Odin tool and extract the downloaded zip on your desktop.
    4. Enable USB debugging from the Developer options under device settings. Skip this step if your device is able to boot up at all.
    5. You’ll also need the correct PIT file for your Samsung device. You can easily extract the PIT from the CSC binary. Just add ‘.ZIP’ extension after .tar.md5 and unzip it. You will find the PIT for your phone inside the extracted folder.

      extract pit from csc on samsung pit extract
      Samsung PIT file

Instructions to Flash Firmware in Odin

Note: Please be warned that performing a firmware flash using the method described below will wipe your phone’s data. It’s strongly recommended to take back up of your phone’s data beforehand.

  1. Turn off your Samsung Galaxy device and boot it into the Android Recovery Mode. The method and key combination to get into the recovery mode on Samsung Galaxy devices differ from device to device. You have to press and hold a certain hardware key combination for 5-7 seconds. There is an easier way that involves using ADB commands and works on all Android devices. However, you need to setup Android SDK Platform-tools first. I’ll mention all possible methods below:
    • Devices with Home button: Home + Volume Up + Power buttons
    • Galaxy devices with Bixby key: Bixby + Volume Up + Power keys
    • Samsung devices with no Bixby key: Volume Up + Volume Down +Power buttons (additionally, you have to hold the Volume Down key when the Samsung logo appears on the screen).
    • Galaxy Tabs: Volume Down + Power buttons (on some models, you need to press the Volume Up key instead).
    • All Android devices: Make sure your device is turned on. Connect your device to your computer via USB cable. Unzip and open the platform-tools-latest folder and launch the command prompt window inside this folder window. Then execute the ‘adb devices‘ and ‘adb reboot recovery‘ commands one after another. Your Samsung device will reboot into the recovery mode.

      samsung recovery mode
      Android Recovery menu

  2. Once you see the recovery menu on the screen, highlight the Wipe data/factory reset option using the Volume Down button and select it by pressing the Power key. When you see the warning screen, select ‘yes’ to confirm and press the Power key to wipe your device.
  3. When your phone boots up, go to Settings and enable USB debugging from the Developer options menu.
  4. Boot your Samsung device into the Download Mode. You can use one of the key-combos mentioned below. You have to press and hold the hardware keys for 2-3 seconds. Alternatively, you can use the ‘adb reboot bootloader‘ command to get into the Download Mode.
    • Devices with Home button: Home + Volume Down + Power buttons
    • Galaxy devices with Bixby key: Bixby + Volume Down + Power keys
    • Samsung devices with no Bixby key: Volume Down + Volume Up + Power buttons.
    • Galaxy Tabs: Volume Up + Power buttons (on some models, you may need to press the Volume Down key instead).
    • Using ADB Command: Connect your device to your computer. Open the platform-tools-latest folder and launch the command prompt window by pressing Shift key+ right-click and selecting the Open PowerShell window here option inside this folder window. Then execute the ‘adb devices’ and ‘adb reboot bootloader’ commands. Doing so will reboot your Samsung phone or tablet into the Download Mode.

      adb reboot bootloader
      adb reboot bootloader command

  5. Open the Odin folder and launch the Odin3_v3.xx.exe.
  6. Now, connect your Samsung device to your Windows PC using the USB cable that came with your device. When Odin detects your Samsung device, the ID:COM port will be highlighted. You’ll also see ‘Added!‘ message in the log box to indicate a successful connection.
  7. Click the BL button on Odin, navigate to the firmware folder, and add the firmware binary that starts with ‘BL‘ in its name. Then click the AP, CP, and CSC buttons and add appropriate binaries to them as well.
  8. Having added the firmware binaries, click the Options tab in Odin and select Nand Erase and Re-Partition.
  9. Then click the Pit tab in Odin and select OK when you see the warning pop-up. Click the PIT button now, navigate to the PIT file and add it.

    odin re-partition
    Re-partition and PIT option in Odin

  10. Make sure your final Odin setup looks like the following screenshot.

    nand erase and repartition in odin
    Odin setup for Nand erase and re-partition

  11. If everything looks fine to you, it’s time now to make Odin do its job. Click the Start button.
  12. Doing so will initiate the firmware installation. You can check the progress of Odin Nand erase, re-partitioning, and firmware installation in the log box. You’ll also see the “Erasing NAND” message in Odin’s log.
  13. All you need to do now is to take a short rest after your hard work and wait for the firmware installation to finish.
  14. The whole process should take around 5-7 minutes and after that, you’ll get ‘PASS!‘ message in Odin and your Samsung device will reboot.

That’s it! You can now disconnect the USB cable and close the Odin window. You have successfully flashed the stock firmware on your Samsung device with Odin NAND erase and re-partition enabled. If you need help with anything while following this tutorial, don’t forget to leave a comment.

Read Next: List of Useful ADB Shell Commands

 

Add comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Recent Posts