[Q] Understanding the android system partitions - Android Q&A, Help & Troubleshooting

Hello all. Somewhat of a n00b to android. I recently got the new nexus 7 (2013) and have been playing around with flashing roms and using a custom recovery. So i know how to do all of that now but my main questions are:
1. When flashing a ROM(ie CM) what partitions are affected? What is actually being flashed on the device? System partition? Kernel too? Because i notice when i factory reset and then flash a new rom, the same data is still on the internal storage.
2. I know that there's a system, dalvik, cache, recovery and boot partition. Well im trying to figure out what exactly does flashing a rom do? Is internal storage a separate partition from those main partitions?
I apologize if this topic has already been covered somewhere else. I have searched the threads and cannot find a straightforward answer. Thanks for your help guys!

Your device has a fake sdcard this your internal storage which flashing a ROM through your custom recovery does not touch
For the most part when flashing a ROM it will only write to the system and boot partition (occasionally data) but you should be wiping cache, userdata and dalvik and this may be in the updater-script if the ROM you are flashing.
Of course depending on the device there are lots of other partitions namely, bootloader (sometimes split between primary and secondary and sometimes even a third SPL) and recovery, some have a separate splash1, radio/modem partitions, and then you can keep going with a slue of others that aren't affected by a normal flash, a quick search will certainly find you a list of all partitions to your device
Sent from my Nexus 4 using xda premium

bynarie said:
Hello all. Somewhat of a n00b to android. I recently got the new nexus 7 (2013) and have been playing around with flashing roms and using a custom recovery. So i know how to do all of that now but my main questions are:
1. When flashing a ROM(ie CM) what partitions are affected? What is actually being flashed on the device? System partition? Kernel too? Because i notice when i factory reset and then flash a new rom, the same data is still on the internal storage.
2. I know that there's a system, dalvik, cache, recovery and boot partition. Well im trying to figure out what exactly does flashing a rom do? Is internal storage a separate partition from those main partitions?
I apologize if this topic has already been covered somewhere else. I have searched the threads and cannot find a straightforward answer. Thanks for your help guys!
Click to expand...
Click to collapse
1. When you flash a rew rom, the files are maily written to system partition. User apps (or if you download from play store) are stored to data partition. Yes, kernel is being flashed, too! Try to open a rom.zip before flashing and you will see, which files are in which partitions.
2.On my old HTC Desire internal storage was a seperate partition. But on my HTC One i dont really know...wanted to know this, too Sometimes i think its not..
Correct me if i am wrong
Hope i could help you somehow! :laugh:

Related

[Q] Flash Kernel Using CWM

I am posting here as there is not sub-forum for Xperia Pro.
I want to flash kernel using CWM already installed on my phone. Is it possible? If so, how do I go about it?
PS: I found a thread which is for Samsung phones here.
I don't think so
There is no way to flash a Kernel for SE phones faik
Were is our moderator!
Sent from my MT15i using Tapatalk
Can anyone tell me why kernel cannot be flashed via flash_image and the like. Is it because /boot partition is locked in Xperia phones? Or because the there is no proper flash_image made for Xperia phones?
That's something like ; doing a bypass surgery while you're awake
Something like that ^
Qwerty123 \m/ said:
That's something like ; doing a bypass surgery while you're awake
Something like that ^
Click to expand...
Click to collapse
I am not a complete nooby. flash_image can be used on (at least) Samsung phones, to flash kernels.
I have a nokia n900(linux kernel)...and i can flash kernels from the phone itself...dual boot maemo OS and android...restore the whole system image on the phone itself...but on neoV...it is not possible.
dont know about other android phones because neoV is my first android.
On PC you can update BIOS, on some motherboards you can do it from Windows, on others you can use some utility in BIOS setup program, on another motherboards you need true DOS and use BIOS flash program, same is with PC video cards, with PDAs...
ameer1234567890 said:
Can anyone tell me why kernel cannot be flashed via flash_image and the like. Is it because /boot partition is locked in Xperia phones? Or because the there is no proper flash_image made for Xperia phones?
Click to expand...
Click to collapse
Because SE xperia phones DONT HAVE recovery partitsion!
taaviu said:
Because SE xperia phones DONT HAVE recovery partitsion!
Click to expand...
Click to collapse
Exactly what does flashing a kernel with flash_image have to do with recovery partition?
ameer1234567890 said:
Exactly what does flashing a kernel with flash_image have to do with recovery partition?
Click to expand...
Click to collapse
The phone's internal memory (not the SD card) is solid-state (flash) memory, AKA NAND. It can be partitioned much like a normal hard drive can be partitioned. The bootloader exists in its own partition. Recovery is another partition; radio, system, cache, etc are all partitions.
Here are the standard partitions on an Android phone:
/misc - not sure what this is for.
/boot - bootloader, kernel
/recovery - holds the recovery program (either clockworkmod or RA recovery for a rooted Evo)
/system - operating system goes here: Android, Sense, boot animation, Sprint crapware, busybox, etc
/cache - cached data from OS usage
/data - user applications, data, settings, etc.
The below partitions are not android-specific. They are tied to the hardware of the phone, but the kernel may have code allowing Android to interact with said hardware.
/radio - the phone's radio firmware, controls cellular, data, GPS, bluetooth.
/wimax - firmware for Sprint's flavor of 4G, WiMax.
During the rooting process, a critical piece of the process is disabling a security system built into the bootloader that protects these partitions from accidental (or intentional) modification. This is what's referred to as "unlocking NAND." The security system can be set to active or inactive. S-ON means the security is in place (NAND locked). S-OFF means the security is off (NAND unlocked). When S-OFF, you have the ability to modify all partitions. With S-ON, you only have write access to /cache and /data. Everything else is read-only.
When you flash a custom ROM, that ROM typically includes a kernel and an OS. That means the /boot and /system partitions will be modified at a minimum. Some ROMs require a clean install, so a format of the /data and /cache partitions is sometimes built into the .zip that you flash. This is essentially doing a factory reset. See next paragraph.
When you do a factory reset (AKA: wipe, hard reset, factory wipe, etc.), you are erasing the /data and /cache partitions. Note that a factory reset does NOT put your phone back to its factory state from an OS standpoint. If you've upgraded to froyo, you will stay on froyo, because the OS lives in /system, and that is not touched during a factory reset. So "factory data reset," as it says under Settings > SD & phone storage, causes confusion. It's not a factory reset. It's a factory DATA reset. Now you know the distinction.
The SD card can also be partitioned to include a section dedicated to storing user apps. To create the partition, your SD card needs to be formatted. Typically a user will copy all the contents in the SD card to a PC hard drive, wipe the card and partition it, and then copy everything back.
Original http://www.addictivetips.com/mobile...plained-boot-system-recovery-data-cache-misc/
taaviu said:
The phone's internal memory (not the SD card) is solid-state (flash) memory, AKA NAND. It can be partitioned much like a normal hard drive can be partitioned. The bootloader exists in its own partition. Recovery is another partition; radio, system, cache, etc are all partitions.
Here are the standard partitions on an Android phone:
/misc - not sure what this is for.
/boot - bootloader, kernel
/recovery - holds the recovery program (either clockworkmod or RA recovery for a rooted Evo)
/system - operating system goes here: Android, Sense, boot animation, Sprint crapware, busybox, etc
/cache - cached data from OS usage
/data - user applications, data, settings, etc.
The below partitions are not android-specific. They are tied to the hardware of the phone, but the kernel may have code allowing Android to interact with said hardware.
/radio - the phone's radio firmware, controls cellular, data, GPS, bluetooth.
/wimax - firmware for Sprint's flavor of 4G, WiMax.
During the rooting process, a critical piece of the process is disabling a security system built into the bootloader that protects these partitions from accidental (or intentional) modification. This is what's referred to as "unlocking NAND." The security system can be set to active or inactive. S-ON means the security is in place (NAND locked). S-OFF means the security is off (NAND unlocked). When S-OFF, you have the ability to modify all partitions. With S-ON, you only have write access to /cache and /data. Everything else is read-only.
When you flash a custom ROM, that ROM typically includes a kernel and an OS. That means the /boot and /system partitions will be modified at a minimum. Some ROMs require a clean install, so a format of the /data and /cache partitions is sometimes built into the .zip that you flash. This is essentially doing a factory reset. See next paragraph.
When you do a factory reset (AKA: wipe, hard reset, factory wipe, etc.), you are erasing the /data and /cache partitions. Note that a factory reset does NOT put your phone back to its factory state from an OS standpoint. If you've upgraded to froyo, you will stay on froyo, because the OS lives in /system, and that is not touched during a factory reset. So "factory data reset," as it says under Settings > SD & phone storage, causes confusion. It's not a factory reset. It's a factory DATA reset. Now you know the distinction.
The SD card can also be partitioned to include a section dedicated to storing user apps. To create the partition, your SD card needs to be formatted. Typically a user will copy all the contents in the SD card to a PC hard drive, wipe the card and partition it, and then copy everything back.
Original http://www.addictivetips.com/mobile...plained-boot-system-recovery-data-cache-misc/
Click to expand...
Click to collapse
As I had mentioned before, I am not a nooby.
ameer1234567890 said:
As I had mentioned before, I am not a nooby.
Click to expand...
Click to collapse
Then show us HOW to install kernel via recovery?
Dont talk about Samsung and HTC option to install kernel via recovery. I have HTC Desire my second phone and yes i know there is option install kernel via recover(also im tested ALL desire roms and kernel already).
SE xperia have just different partitions layout and we simply cant flash kernel via recovery.....BUT i dont want tell you its IMPOSSIBLE.
Be nice and show us how to do that
PS:im tottaly noob.
Boot holds kernel and initrd not the actual bootloader, that is what should be writable. Provided the actual bootloader is not damaged it should be possible, however because there is no recovery partition it is riskier, but s1tool can restore bootloader......
Hmm
Sent from my MT11i using Tapatalk
I have S2(of course i have and xperia neo) and i dont flash with CWM i flash with odin or heimdall; CWM method is not sure.
In my opinion,and i'm NOT an expert, it easy to flash a kernel for xperia with flashtool or using fastboot from adb.
OK guys, you might have misread it. I am looking for a way to flash kernel not just using CWM (eventhough the title says so), but using any method without having to connect to a PC. One such possible method is to use flash_image in terminal, which does not work in my phone.
PS: The fact that I am not a noob doesn't make me a pro.

[Q] Custom ROMs + Encryption

Having trouble finding a firm answer on this. I have read that encryption has NO effect on Recovery mods since it only encrypts apps, data, and a few other pieces of info. (I thought that there was full disk encryption, but I guess not). So I would like to verify the following questions regarding the use of custom ROMs and Android encryption and I would like to do both, back them up, and maybe even change ROMs without issue.
I am fairly certain I can boot into a recovery mod (CWM or Twerp) without any problems while encrypted. Is this true? (I have seen conflicting answers here and on the interwebs).
If I back up a ROM and data (assuming this is done together in one backup), will I be able to recovery the backup properly and use it even when it was encrypted?
Thanks in advance.
Bakura
You can boot into recovery and flash zips but you will not be able to access your /data partition since that's what's encrypted. For flashing ROMs this doesn't matter since those don't touch /data. However if you have to wipe your user data you will have to set up the encryption all over again.
What this also means is you cannot store your zips on the internal memory of your phone because those will not be accessible to the recovery. You will have to store them on either an unencrypted microSD or sideload them with adb (easy enough to do on CWM, not sure about other recoveries).
Backing up should be fine as long as you backup to somewhere other than the internal memory for the reasons I stated above.
Will the wipe and restore options work?
Hexgore said:
You can boot into recovery and flash zips but you will not be able to access your /data partition since that's what's encrypted. For flashing ROMs this doesn't matter since those don't touch /data. However if you have to wipe your user data you will have to set up the encryption all over again.
What this also means is you cannot store your zips on the internal memory of your phone because those will not be accessible to the recovery. You will have to store them on either an unencrypted microSD or sideload them with adb (easy enough to do on CWM, not sure about other recoveries).
Backing up should be fine as long as you backup to somewhere other than the internal memory for the reasons I stated above.
Click to expand...
Click to collapse
I have a full Nandroid Backup of my phone with 4ext Revovery Touch. So if I encrypt Internal Storage only and if it's screwed up, will I be able to restore the Nandroid backup from recovery (I mean, is it possible to modify (rwx) the encrypted partition from recovery?
Far_SighT said:
I have a full Nandroid Backup of my phone with 4ext Revovery Touch. So if I encrypt Internal Storage only and if it's screwed up, will I be able to restore the Nandroid backup from recovery (I mean, is it possible to modify (rwx) the encrypted partition from recovery?
Click to expand...
Click to collapse
If the Nandroid backup is stored on your SD card, I think so, but you might have to wipe the partition first. As far as I know (someone please correct me if I'm wrong) you can still wipe the encrypted partition, you just can't access any of the encrypted data from recovery.
Yeah, the recovery works just fine!
Hexgore said:
If the Nandroid backup is stored on your SD card, I think so, but you might have to wipe the partition first. As far as I know (someone please correct me if I'm wrong) you can still wipe the encrypted partition, you just can't access any of the encrypted data from recovery.
Click to expand...
Click to collapse
^+1. So I went ahead and encrypted the internal storage. The process was fairly fast (took me under 10 mins).
But entering a password was too much of a hassle. So I performed a full system wipe and restored the backup. No problems.
That actually didn't work for me on the Nexus 7.
I tried to wipe the tablet from recovery but it couldn't mount the /data partition.
I tried to wipe the tablet from the OS but it didn't like the custom recovery so it just rebooted without changing anything.
In the end I had to run "fastboot erase userdata" to wipe it. That worked.
I have now installed CM 10.1 and can report that the encryption process seems to be working fine on the N7. It's taking a while but it is the 32GB model.
Encryption on Android is very temperamental. The general pattern seems to be that if the ROM you're using is based on the stock OS for your device (as AOSP is for Nexus devices) encryption will work fine, but due to the way the memory is mounted on modern Nexus devices, recoveries may be unable to mount the /data partition at all.
However if you are using a ROM based on a non-stock OS for your device (e.g. AOSP on an HTC Sensation) encryption may not even be able to turn on, and sadly fixing this problem when it arises is not high on the list of priorities for most developers, especially if your device isn't popular.
We are lucky that CyanogenMod seems to care a lot about privacy and security recently however. That may mean they focus more on encryption compatibility in the future, and most AOSP ROMs are based on CM, so fingers crossed for that.
But basically be aware YMMV when it comes to encryption on custom ROMs.
I tried to encrypt two Moto G's with the new official CM11, but after reboot and enter pin to unlock, the devices crashes with a black screen.
Encryption with stock firmware works fine.

CWM - Wipe data\Factory reset - Wiping all data from Internal SD

I've read some other posts where this has caused a certain amount of controversy but no post seemed to actually answer the question..
Using the Wipe data\Factory reset in ClockWorkMod Recovery has started to wipe the ENTIRE device
(excluding the external SD card)
I have flashed dozens of custom ROMs in the past and what normally happens is my external SD card contents remains safe, this still happens, no problem there, and all my personal documents such as music, pictures, videos and all other files that are not part of the actual ROM itself remain safe too.
BUT
Yesterday, i flashed a certain ROM designed to resemble the S4 (with leaked 4.2.2). Its performance was shockingly bad and other reasons caused me to flash a new ROM which i had used in the past - but when i wiped data/factory reset through CWM - ALL MY INTERNAL SD CONTENTS WHERE GONE
Things i did notice with the 4.2.2 ROM before re-flashing were that:
-When i connected it to the computer (via USB) my device was seen as i9500 (the S4)
-Also, it had created a "0\" folderto store the system ROM.
-I also noticed, wehn re-flashing, it took longer to wipe data than usual..
NOTE: I DID NOT USE THE FACTORY RESET THROUGH ANDROID SETTINGS - THIS, I KNOW, WILL WIPE THE ENTIRE INTERNAL SD, PERSONAL FILES AND ALL. THIS WAS DONE THROUGH CWM.
Because obviously the 4.2.2 ROM wiped my entire Internal SD i had no ROM packages left on it to flash and because obviously i didnt know this until i wiped/reset it involved me having to use ODIN to reflash a STOCK ROM just to be able to boot up and transfer files (ROM packages) from PC to phone - which obviously then meant i had to reflash CWM aswell before i could install the new ROM.
Final Note:
The problem i have, is that i have to do the above EVERYTIME i want to flash a different ROM (i flashed 3 last night).
For some reason when i wipe through CWM my internal SD card is COMPLETELY WIPED!
The question is......Why???
Could the 4.2.2 ROM have re-partitioned my internal SD card and now CWM thinks the ENTIRE thing is data to wipe?
This is the only reasoning i could put to why it wont leave MY FILES alone...
If this IS the case, how do i get it back to normal??
I'm told, on numerous websites in BIG BOLD RED LETTERS that selecting 're-partition' in ODIN is bad and is just a ticket for a free paperwieght (the phone!).
Thank you to ANYONE who can help with this......
The clue may be in the 0 folder. Please read link in my signature to see if it helps
Sent from my GT-I9300 using Tapatalk 2
rootSU said:
The clue may be in the 0 folder. Please read link in my signature to see if it helps
Click to expand...
Click to collapse
Thanks for your help, however the info you suggested does not solve my query..
The info you've provided assumes that the data is stored somewhere else, ie. 0\
Although my device did create a 0\ location when wiping the data, no personal data was in this location.
When i flashed back to stock using Odin, i could see that my phones internal storage was only 1.0-1.5GB used.
Before i started this i only had about 900mb left on my device!
So its not that my data is hiding somewhere.....its gone, and everything on my hones internal storgare is wiped everytime i "wipe data/factory reset" through CWM.

Question about deleting partitions and boot

Hi!
- I have LG G2 mini D620r with stock 5.0.2 Android. Phone has unlocked bootloader, is rooted and TWRP 3.0.2 recovery is flashed.
Few days ago I installed CM13 just to try it and then returned to stock OS. Before flashing custom ROM i used to wipe dalvik, system, data and cache partitions. Now my question is what would happen if I add interal memory partition to list of 4 aforementioned partitions? I know that it would delete all the data in internal memory (and that's what I want to do, because I want my phone to be like it was before it was used for the first time), but would it be able to boot up to OS? I don't won't to flash a kdz file or something like that.
- Also, I can't seem to enter recovery through button combination. I tried all combinations I could find on the internet. When holding volume down + power button for a few seconds i gat an option to hard reset the phone. Only way to get into TWRP is to use QuickBoot app. Anyone having any ideas what could I do?
Triggering a hard reset with a custom recovery installed boots into that recovery.
Wiping internal memory will wipe everything under /sdcard. Not the external one. The built-in one.
To do a complete factory reset, in recovery choose /data and format it as ext4. Don't simply wipe it, or it will leave everything under /sdcard there, while a format will delete them.
Sent from my LG-D620 using XDA Labs
Vagelis1608 said:
Triggering a hard reset with a custom recovery installed boots into that recovery.
Wiping internal memory will wipe everything under /sdcard. Not the external one. The built-in one.
To do a complete factory reset, in recovery choose /data and format it as ext4. Don't simply wipe it, or it will leave everything under /sdcard there, while a format will delete them.
Sent from my LG-D620 using XDA Labs
Click to expand...
Click to collapse
Well you just keep on helping!
Thanks.
Just to be clear these are the steps:
TWRP> Wipe> Advanced Wipe> select partitions: Dalvik, Data, Internal Storage, Cache, System
After that I go to:
TWRP> Wipe> Format Data> type yes
Is that correct procedure?
After all this has been done will my phone boot up to stock Android 5.0.2 or would I have to flash some kdz or custom ROM?
Where can I find option to format /data partition as ext4?
1. Yes your steps are correct.
2. Your phone will not boot up to Android because you don't have ANYTHING on your phone. You just wiped the rom that was running on it. There are a few threads that have flashable stock Android that you can use. Worst case scenario you can always flash kdz. HERE under Custom Rom>lollipop you will see links to [stock] zips.
3. Pretty sure formatting data will format it by default to ext4.
mobiusm said:
1. Yes your steps are correct.
2. Your phone will not boot up to Android because you don't have ANYTHING on your phone. You just wiped the rom that was running on it. There are a few threads that have flashable stock Android that you can use. Worst case scenario you can always flash kdz. HERE under Custom Rom>lollipop you will see links to [stock] zips.
3. Pretty sure formatting data will format it by default to ext4.
Click to expand...
Click to collapse
Thank you. I'm gonna try that and see how it works.

Can't wipe system partition

Hi, I recently unlocked the bootloader of my Redmi Note 9S, and I wanted to install xiaomi.eu. When I was trying to do the necessary wipes in TWRP, I found out that I couldn't wipe the system partition, I mean, the system partition doesn't show in the wipe menu. So everytime I need to install a new ROM I have to perform a format data. Which is botering me because I have a lot of things in the internal storage.
I have already tried another recovery but is the same thing. Can anyone help me?
Sorry for my bad english, I'm not a native speaker
Piusak said:
Hi, I recently unlocked the bootloader of my Redmi Note 9S, and I wanted to install xiaomi.eu. When I was trying to do the necessary wipes in TWRP, I found out that I couldn't wipe the system partition, I mean, the system partition doesn't show in the wipe menu. So everytime I need to install a new ROM I have to perform a format data. Which is botering me because I have a lot of things in the internal storage.
I have already tried another recovery but is the same thing. Can anyone help me?
Sorry for my bad english, I'm not a native speaker
Click to expand...
Click to collapse
Formatting data is needed if your previous rom was encrypted (usually Miui and its derivatives). Find a rom you're going to stick with to do the data format just once.

Categories

Resources