Monday, March 11, 2013

Android File System Structure/Architecture/Layout Details




Android File System Structure/Architecture/Layout Details

Most of the Android user are using their Android phone just for calls, SMS, browsing and basic apps, But form the development prospective, we should know about  Android internal structure. Android uses several partitions (like boot, system, recovery,data etc) to organize files and folders on the device just like Windows OS. Each of these partitions has it’s own functionality, But most of us don’t know  the significance of each partition and its contents. In this article, we will take you on a tour of Android partitions. So lets start the android file system tutorial.
There are mainly 6 partitions in Android phones, tablets and other Android devices. Below is the list of partition for Android File System. Note that there might be some other partitions available, it differs from Model to Model. But logically below 6 partitions can be found in any Android devices.
  • /boot
  • /system
  • /recovery
  • /data
  • /cache
  • /misc
Also Below are the for SD Card Fie System Partitions.
  • /sdcard
  • /sd-ext
Please Note: Only /sdcard partition can be found in all Android devices and the rest are present only in select devices.

Know Your Android Device Partition Size using adb Command

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.
partition-size-in-android-device
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

/boot

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.

/system

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.

/recovery

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.

/data

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 are doing factory reset on your device, this partition will wipe out, Then your device will be in the state, when you use for he first time, or the way it was after the last official or custom ROM installation.

/cache

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.

/misc

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.

/sdcard

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.

/sd-ext

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.


No comments:

Post a Comment