[Galaxy S II General] Saber:
How to format your phone properly

Guide updated on 14/05/15

Disclaimer:

This process will wipe all of your data off your phone. This includes all of your apps and system storage. Make sure to backup all of your apps and data to the cloud or onto a computer

Make a backup!! Why am I saying this again? Because there is always a few careless people who do this process and complain how they lost all of their data.

All users of android 4.0.x are warned that factory resetting your phone will hard brick your device. To check if you have brickbug, follow this link: brickbug check Also, a custom recovery is not a custom kernel! Brickbug occurs at kernel level. If you are affected, you will need to install a custom kernel like siyah kernel

Here are some of the ways you can format your phone:

- Manually via recovery

- Using a pit file

- Using hawker's scripts

Formatting manually via recovery:

If you don't have a custom recovery already, flash Philz recovery using odin: https://goo.im/devs/philz_touch/CWM_Advanced_Edition/i9100/philz_touch_6.48.4-i9100.zip.md5

Reboot your phone to recovery. If your current ROM doesn't have the option to do this, you can use the app quick boot or you can shut down your phone then use the button combinations to get into recovery (volume up + home + power). Note: Root is need to run the app.

Once in recovery, select and confirm factory reset

Select and confirm wipe cache partition

In mounts and storage, select and confirm format /system and /preload (wiping preload is necessary when switching between stock and custom roms).

Go back to the main menu and go to advanced menu. You will now have to select and confirm to wipe dalvik(or art) cache.

Once all of these has been done, you can install a rom normally.

If you are on TWRP recovery, follow these steps:

Reboot your phone to recovery.

Once in recovery, go to wipe

Tick: Data, system, cache and dalvik cache

Swipe the bar to confirm to wipe

Go back to the main menu

You can now install a rom normally.

If you get errors when formatting the preload partition, you will have to flash this first then you will be able to format the preload partition: http://bit.ly/13ojAEh

Formatting via pit file:

This process will wipe all of your data off your phone. This includes all of your apps, system storage and internal sd card. It doesn't wipe your external sd card. Make sure to backup all of your apps and data to the cloud or onto a computer

Make a nandroid backup onto your external sd card or PC (VERY IMPORTANT!!! All backups in internal sd card will be deleted so move them!)

Download the system pit files (attached in OP)

Extract the zip file

Open ODIN (Attached in the OP, JOdin for linux and OS X)

Connect your phone to your PC via USB while in download mode (make sure your phone is detected on ODIN, it should say COM:{number})

Click on the PIT button and locate and select your desired pit file

Click on PDA or AP and select your kernel .tar file (look at this thread if you don't have one: http://xdaforums.com/galaxy-s2/development-derivatives/convert-kernel-zip-to-tar-t2994381)

Make sure that re-partition has been ticked then click start. If your phone successfully flashes, move onto the next step. If not, try changing usb ports, changing ODIN version, changing pit files or seeing if your device has a corrupt nand (or broken). If your nand is corrupt or broken, you won't be able to flash with ODIN (and you will need to buy a new motherboard). If you are still unsure what to do, look at the screenshot in the attachments.

While your phone reboots, you need to perform the button combination to get into recovery (home button + power button + volume up)

If you have CWM recovery, go to mounts and storage then select format /sd card0 or /internal sd card. Select default and your internal sd card should successfully format. If not, try ext4 format. If you have TWRP recovery, you will need to go to wipe>advanced and select format /sd card then swipe to confirm . If you can successfully format your phone here, skip steps 11, 12, 13, 14.

----IF FORMATTING FAILS IN RECOVERY----

If formatting sd card in recovery fails, connect your phone to your PC. While still in recovery (CWM), go to mounts and storage and select mount mass storage. If you have TWRP recovery, go to mount and select mount sd card. It should prompt you that the storage isn't ready yet and you need to format. If your PC still doesn't detect your phone, check if the proper drivers are installed (in attachments). Also, if your phone doesn't get detected and you've done everything in this step, try changing usb ports, computers and even usb cables.

Click format

You can leave all of the settings to default, I personally like to change the allocation size to 4KB (4KB is good if you want to make the most out of your phone's storage while having enough speed)

Click format.

----AFTER SUCCESSFULLY FORMATTING----

Go back to your phone. You can choose to restore from your backup or install a new rom. If you choose to restore from a backup, skip all of the remaining steps. (Note: DorimanX kernel recoveries can not format /data partition more than 2gb, use an alternative first when restoring a backup then flash back if needed)

In mounts and storage, choose format /data, /cache and /system (Note: DorimanX kernel recoveries can not format /data partition more than 2gb, use an alternative first then flash back if needed)

Now you can flash a ROM as you normally would

Formatting via hawker's script:

Copy HawkerCoreV???.zip onto your device. I have included the zip in the attachments.

Reboot into Recovery

Install zip from SD card>Run HawkerCoreV???.zip

When you are at a stage whereby you want to flash a new CUSTOM ROM and want to do a FULL WIPE before doing so (which I would ALWAYS recommend) the steps are as follows:

If you have not previously done so, download and install the core zip HawkerCoreV???.zip. This will create a folder called /sdcard/HawkerCore

A nandroid backup is recommended beforehand

Install zip from SD card>Run /sdcard/HawkerCore/Scripts/ROMNuke

Install zip from SD card>Flash your new ROM

Reboot

If you are installing a new STOCK ROM and want to do a Nuke then:

A nandroid backup is recommended beforehand

Install zip from SD card>Run /sdcard/HawkerCore/Scripts/ROMNuke

Reboot into Download mode using the button combinations (volume down + home + power button)

Install your stock ROM via Odin

Huge thanks to hawkerpaul for his awesome scripts. Also huge thanks to ElGamal for providing the modified pit files and metalgearhathaway for providing the stock pit file.