21
BASICS – Rooting, Custom Recovery, Bootloader, Kernel, etc…

  1. Sridhar Ananthanarayanan
    Lollipop Mar 11, 2018

    Sridhar Ananthanarayanan , Mar 11, 2018 :
    For detailed understanding, use a search engine. I will cover the basics only here. Will be happy to answer questions and clarify doubts.

    Android Partitions


    Boot Partition – the partition that stores the device kernel, ramdisk, firmware (modem), EFS (this contains your device IMEI, WiFi Mac address, Bluetooth Mac address, Network information, etc.).

    Recovery – the partition that allows you to flash custom ROMs, kernels, etc.

    System – the partition where the OS (ROM) and system apps are installed.

    Data – the partition where all user apps are installed and their data stored.

    Cache – the partition that holds temporary app data.

    Internal Storage – the partition that saves user files like documents, pictures, videos, music, downloads, etc.

    The free space that you see in any device just out of the box is your internal storage. The difference (stated capacity minus free space) is occupied by the other partitions listed above.

    What is a kernel?

    A kernel is an intermediary that tells the device/ OS what to do for a specific user action.

    For example:

    if you press the volume up key, the kernel tells the OS to increase the volume.

    If you press the power button, the kernel decides what to do for each key combination:

    boot to system if you press the power button only

    boot to recovery if you press and hold power + volume down button

    boot to Download mode if you press power + volume up button

    Similarly, every touch-based action that we do on the screen gets an appropriate response from the OS/ device because the kernel tells the OS/ device what to do.

    In simple terms, you are directly interacting with the kernel, and the kernel in turn conveys user action to the OS/ device. The kernel controls the hardware. The user as well as all applications communicate directly with the Kernel, which in turn passes on the instructions to the OS/ hardware.

    You –> Kernel –> System or Recovery or Download mode

    5-0.png


    What is bootloader?

    The boot partition where the Kernel, Modem, etc. resides.


    Why is bootloader locked?

    Bootloader is locked to protect your data. If someone tries to bypass inbuilt security and tries installing something before booting to the system, the very 1st step is to unlock the bootloader. And when bootloader is unlocked, all data is wiped, and this secures your data from being accessed by someone without authorization.

    Unlocking the bootloader opens the door to other partitions like recovery, which in turn is what we need to flash ROMs, Frameworks, Mods, etc.

    Once you unlock the bootloader, keep it unlocked. It is easier to fix problems on a device with an unlocked bootloader. Lock the bootloader ONLY if you want to go back to 100% stock (stock ROM, stock Kernel, stock Recovery, stock EVERYTHING!), and locking should be the very last step to return to stock.


    Except for warranty claim, or reselling the device, there are hardly any benefits of re-locking the bootloader.

    Why install a custom recovery?

    1. To take a Nandroid backup. In other words, a complete system image.

    2. To install non-stock software like Custom ROMs, X-posed Framework, etc. With custom ROMs, you can have access to latest Android versions not supported by phone manufacturer

    3. To root your device (unlocking the bootloader or installing a custom recovery or a custom ROM does NOT root your device. It only prepares your system to be rooted)


    Best Custom Recovery (as of 2018) –TWRP, found here.

    The very first thing to do after installing a custom recovery is to take a Nandroid Backup (explained in the end) and keep it safe. This will be extremely handy later if something goes wrong.


    What is root?

    Rooting is gaining administrative access to your device. This involves breaking the security “wall” that is built into the OS for your own security.

    Steps to root:

    1. Unlock the bootloader
    2. Install a custom recovery (to install custom ROMs, mods, etc.)
    3. Root (your device is NOT rooted at steps 1 or 2)


    Advantages and Disadvantages of Rooting

    ADVANTAGES

    1. AdAway - block ads by modifying hosts file and not routing traffic via a VPN
    2. Firewall - control app access to internet without creating a VPN connection
    3. Use dedicated VPN service while keeping ads away and firewall working
    4. Titanium Backup
    • backup & restore apps and data completely
    • freeze apps from running in the background
    • disable system apps & bloatware
    • prevent an app from being updated (example, YouTube AdAway)​

    5. Viper - amazing sound (be careful, can damage hardware)
    6. Schedule automatic restart of device
    7. YouTube AdAway - block YouTube ads
    8. Greenify can hibernate apps automatically.
    9. Others root apps/ mods.

    DISADVANTAGES

    1. Potential Security vulnerabilities
    2. Some apps (like banking apps) may not work
    3. Loss of manufacturer warranty
    4. Potential to "brick" the device


    What is a Nandroid Backup?

    It is a complete backup of various partitions in your device. It is a good idea to check (select) the following partitions in a Nandroid backup:

    System

    Data

    EFS – most important

    Boot – most important

    Recovery


    Not required or safe to exclude from a Nandroid backup:

    System Image (often the largest partition)

    Cache

    Always a good practice to take a Nandroid Backup before flashing anything.

    A Nandroid backup does NOT backup user files like documents, pictures, videos, music, downloads, etc. You must back them up separately.

    What is Bricking?

    Do remember that Kernels, ROMs, Custom Recoveries, etc. are all device specific. They are specific down to the component level. For example, devices like Samsung flagships that ship with Qualcomm processor in the USA and Exynos processor in other markets will require different custom ROMs, Recoveries, etc. Using the right files for flashing is extremely important to avoid bricking your device.

    What is Bricking?

    Bricking is when your device fails to boot (and is as good as a brick). There are 3 types of bricking:


    Soft brick - device starts but is stuck at boot animation. This is caused by flashing an incompatible file. Easy to fix.

    Hard brick - device doesn't respond at all. It can be fixed using "unbrick" tools and methods.

    Permanent brick - congratulations, your device is now a brick. You can't fix it.
     
    Last edited: Sep 20, 2018

    #1
  2. Sridhar Ananthanarayanan
    Lollipop Mar 11, 2018

    Last edited: Mar 11, 2018

    #2
    GopalB. likes this.
  3. Loveit
    KitKat Mar 11, 2018

    Loveit , Mar 11, 2018 :
    Hold on, I hold you responsible for what I do to my device .

    I'm about to install some nasty malware on my phone and will sue you .
     

    #3
  4. Lancelot_69
    Lollipop Mar 11, 2018

    Lancelot_69 , Mar 11, 2018 :
    Sorry to inform you but between 8:52 when you first posted and 9:11 when you posted your warning I have damaged my phone with your instructions! My lawyer will contact you shortly!!

    Good guide though.
     

    #4
  5. Ash645
    KitKat Mar 12, 2018

    Ash645 , Mar 12, 2018 :
    uh oh...too late for that!

    on a serious note, this should be your first ever line of the post! XD

    good one though!
     

    #5
  6. Nick 59
    Marshmallow Mar 12, 2018

    Nick 59 , Mar 12, 2018 :
    Great post, thank you!
    I've added this to bookmarks and will be directing people here when necessary. An excellent summary and easily digestable too. Good job.
     

    #6
  7. Sridhar Ananthanarayanan
    Lollipop Mar 12, 2018

    Sridhar Ananthanarayanan , Mar 12, 2018 :
    the post only explains the terminology and concepts.

    doesn't ask anyone to do anything (apart from learning though). thinking about it, the disclaimer isn't actually required. :)
     

    #7
    GopalB. and Ash645 like this.
  8. BobbyV8_
    The Showcase Reviewer Mar 12, 2018


    #8
    GopalB. and Hydra Bob like this.
  9. Sridhar Ananthanarayanan
    Lollipop Mar 12, 2018


    #9
  10. Ash645
    KitKat Mar 12, 2018

    Ash645 , Mar 12, 2018 :
    hehe, which makes your first comment obsolete.. :p

    but yes, you just made searching easier with this post.
     

    #10
  11. GopalB.
    Nougat Mar 12, 2018


    #11
  12. Tobikage
    Nougat Mar 12, 2018

    Tobikage , Mar 12, 2018 :
    Add another line to OP since we have had more stupid people appear on the forum.

    *Kernels , ROMs and Recoveries are device specific and cannot be flashed on devices other than ones they are meant for.
     

    #12
  13. Sridhar Ananthanarayanan
    Lollipop Mar 12, 2018

    Sridhar Ananthanarayanan , Mar 12, 2018 :
    done. thanks.
     

    #13
    Tobikage likes this.
  14. idkwhoiam322
    Nougat Mar 12, 2018


    #14
  15. Dhiren Velari
    Gingerbread Sep 20, 2018


    #15
  16. syntek99
    Froyo Oct 15, 2018

    syntek99 , Oct 15, 2018 :
    I was wondering what the pros and cons of rooting were... I could have asked on an unrelated thread like so many others do, but I took 10 seconds to search, and found this... I appreciate the detailed procedure and your time to post it... I've read that the OP3T can't receive the pie OS if the phone is rooted... If true, I plan on getting the OP6T and will use this guide to root that... Thanks again for this post... Peace
     

    #16
  17. Sridhar Ananthanarayanan
    Lollipop Oct 16, 2018

    Sridhar Ananthanarayanan , Oct 16, 2018 :
    the OP3T will receive Android P and you will be able to root it. no need to buy 6T just for that. :)
     

    #17
  18. Saketh Chandra.B
    Cupcake Jun 18, 2019

    Saketh Chandra.B , Jun 18, 2019 :
    Thank you!,
    For clearing a basic doubt about Rooting, Custom Recovery, Bootloader, Kernel, etc…
    Great post.
     

    #18