Most of the Android user are using their Android phone just for calls, SMS, browsing and basic apps,linux
But form the development prospective, we should know about Android internal structure.android
Android uses several partitions (like boot, system, recovery,data etc) to organize files and folders on the device just like Windows OS.shell
Each of these partitions has it’s own functionality, But most of us don’t know the significance of each partition and its contents.app
In this article, we will take you on a tour of Android partitions.less
So lets start the android file system tutorial.socket
There are mainly 6 partitions in Android phones, tablets and other Android devices.ide
Below is the list of partition for Android File System.ui
Note that there might be some other partitions available, it differs from Model to Model.this
But logically below 6 partitions can be found in any Android devices.google
Also Below are the for SD Card Fie System Partitions.
Please Note:
Only /sdcard partition can be found in all Android devices and the rest are present only in select devices.
You can know which partitions are available along with the partition size for all partition in your android device.
Go through the below image and run the adb command as shown in that image.
For more adb commands, you can read my atricle Useful adb Commands for Android Development.
Also for more details for android architecture, you can read my article Android Architecture.
Note:
boot and recovery partition is not displayed in the above image.
So after adb shell, you need to run mount command. like
cat proc/mounts
This is the boot partition of your Android device, as the name suggests.
It includes the android kernel and the ramdisk.
The device will not boot without this partition.
Wiping this partition from recovery should only be done if absolutely required and once done,
the device must NOT be rebooted before installing a new one,
which can be done by installing a ROM that includes a /boot partition.
As the name suggests, this partition contains the entire Android OS, other than the kernel and the ramdisk.
This includes the Android GUI and all the system applications that come pre-installed on the device.
Wiping this partition will remove Android from the device without rendering it unbootable,
and you will still be able to put the phone into recovery or bootloader mode to install a new ROM.
This is specially designed for backup.
The recovery partition can be considered as an alternative boot partition,
that lets the device boot into a recovery console for performing advanced recovery and maintenance operations on it.
Again as the name suggest, it is called userdata partition.
This partition contains the user’s data like your contacts, sms, settings and all android applications that you have installed.
While you perform factory reset on your device, this partition will be wiped out,
Then your device will be in the state, when you used for the first time or the way it was after the last official or custom ROM installation.
I hope you have some idea about cache, as you are expert on internet browsing.
This is the partition where Android stores frequently accessed data and app components.
Wiping the cache doesn’t effect your personal data but simply gets rid of the existing data there,
which gets automatically rebuilt as you continue using the device.
This partition contains miscellaneous system settings in form of on/off switches.
These settings may include CID (Carrier or Region ID), USB configuration and certain hardware settings etc.
This is an important partition and if it is corrupt or missing, several of the device’s features will will not function normally.
This is not a partition on the internal memory of the device but rather the SD card.
In terms of usage, this is your storage space to use as you see fit, to store your media, documents, ROMs etc. on it.
Wiping it is perfectly safe as long as you backup all the data you require from it, to your computer first.
Though several user-installed apps save their data and settings on the SD card and wiping this partition will make you lose all that data.
On devices with both an internal and an external SD card – devices like the Samsung Galaxy S and several tablets –
the /sdcard partition is always used to refer to the internal SD card.
For the external SD card – if present – an alternative partition is used, which differs from device to device.
In case of Samsung Galaxy S series devices, it is /sdcard/sd while in many other devices, it is /sdcard2.
Unlike /sdcard, no system or app data whatsoever is stored automatically on this external SD card
and everything present on it has been added there by the user.
You can safely wipe it after backing up any data from it that you need to save.
This is not a standard Android partition, but has become popular in the custom ROM scene.
It is basically an additional partition on your SD card that acts as the /data partition
when used with certain ROMs that have special features called APP2SD+ or data2ext enabled.
It is especially useful on devices with little internal memory allotted to the /data partition.
Thus, users who want to install more programs than the internal memory allows can make this partition
and use it with a custom ROM that supports this feature, to get additional storage for installing their apps.
Wiping this partition is essentially the same as wiping the /data partition – you lose your contacts, SMS, market apps and settings.
Now when you install a new binary, you can know what you’re going to loose, make sure to backup your data before flash new binary in your android device.
I hope this small tutorial will help you at it’s best. If you have nay query or comments, please share with us, we will get back to you asap.
A search of the Internet reveals very little about the Android file hierarchy.
For Windows users, it is another world.
For Linux users, it is a variation of the Linux file hierarchy.
In Linux / Android / Unix (for simplicity, referred to a just Linux), the file hierarchy is a single tree,
with the top of the tree being "/" - the root of the tree.
Under "/" are files and directories.
The Linux file hierarchy lacks the concept of drives, as in Windows.
Instead, file systems are mounted on a directory to create a single integrated tree.
For media based file systems. the file system represents a partition of some media.
It makes no difference whether the file system exists on the local device, or on a remote device.
Everything is integrated into a single file hierarchy that begins with root.
The term path refers to the path to a file or directory.
The absolute path to any file or directory begins with "/" - root.
For example, your file application may show the the path to the internal flash drive as /mnt/sdcard, or simply "sdcard."
If your Android device includes an external SD Card, you will also see/mnt/extSdCard.
The actual names may vary, but the concept remains the same.
For example, CyanogenMod mounts the external flash drive appears on/mnt/sdcard, and the internal flash as /mnt/emmc.
The important point to remember is that each of these directories represents a mount point for a file system.
As a normal user, an Android file only displays the file systems to which you have access.
These file systems are just a part of the entire file hierarchy.
To see the complete Android file hierarchy, you need "root" access.
In this case, "root" refers to a special user account that has system administration privileges.
When you "root" a Android device, you are gaining access to the root account.
There is a reason for not automatically granting root access - one tiny mistake can go a long way.
However, for those experienced in Linux commands and Linux system administration, it opens the hood to the underlying structure of Android.
As mentioned in Android Kernel versus the Linux Kernel, Android uses the Linux kernel.
All file, and directory, operations from an application flow through a kernel abstract layer called the Virtual File System (VFS).
Each file system, and there are a lot of them, are implementations of VFS.
Each file system has a separate kernel module that registers the operations that it supports with VFS.
By separating the implementation from the abstraction, adding a new file system becomes a matter of writing another kernel module.
These modules are either part of the kernel, or are dynamically loaded on demand.
The Android kernel comes with a subset of the vast collection of file systems that range
from the Journal File System (JFS) for AIX (IBM's flavor of Unix) to the Amiga file system.
All the fancy footwork is hidden from the user, as the kernel handles all the work when it mounts a file system.
The kernel configuration file determines what file system modules are compiled, and whether they are built into the kernel, or dynamically loaded.
Consequently, the Android kernel only contains those file system modules that are relevant to its operation.
In fact, I don't know of a single Linux distribution that compiles every file system module, as some of the file systems are hardware architecture dependent.
While the supported file systems vary on different Android devices, the common flash memory file systems are as follows:
Besides flash memory file systems, Android devices typically support the following media-based file systems:
The above file systems are media-based file systems.
VFS also supports pseudo file systems, which are not media based.
The Linux kernel supports a number of pseudo file systems, the ones that are important to Android devices are:
While there seems like a lot of file systems, they are just the tip of the iceberg.
For those without root access, these file systems and directories are hidden from your view, as you do not have the permission to access them.
My Samsung Galaxy SIII provides a USB debugging option under Developer options in theSettings menu.
When enabled this option allows one to connect to the Samsung Galaxy SIII using adb (Android Debug Bridge).
While it only provides user level privileges, it does provide access to most directories and most of the Linux commands.
This option may be available on other Samsung Android devices.
You can also try the Terminal Emulator app. It works on my Samsung Galaxy SIII, as well as my B&N Nook Color running CyanogenMod 10 (Jelly Bean).
As mentioned above, the Android file hierarchy is a modified version of the traditional Linux file hierarchy.
There are slight variations in the structure across the different version of Linux, and from different manufacturers.
However, the variations are slight.
The following gives a brief summary of the top levels of the directory structure for the AOSP release of Jelly Bean:
The above is just a thumbnail sketch of the Android file structure.
To understand the workings of Android beneath the desktop, you need a fundamental knowledge of Linux, and the Linux command-line.
For kernel parameters, you need a working knowledge of the Linux kernel. In future articles, I shall explore the Android file hierarchy in more detail.