Android - File Hierarchy                              Home : www.sharetechnote.com

 

 

 

 

Directory Structure

 

Directories in Android would vary depending on which version of Android you are using and which mobile phone you are using, but the important directories would be common to most of the devices and version. Following is from my mobile phone which is based on Android 5.1

 

\

 

 

acct

 

cache

 

charger -> /sbin/healthd

 

config

 

d -> /sys/kernel/debug

 

data

 

dev

 

etc -> /system/etc

 

firmware

 

mnt

 

mpt

 

persist

 

proc

 

res

 

root

 

sbin

 

sdcard -> /storage/emulated/legacy

 

sns

 

storage

 

sys

 

system

 

tombstones -> /data/tombstones

 

vendor -> /system/vendor

 

 

\acct

 

This is the mount point for user account. If you do 'ls' in this folder, you will see a lot of folder named uidxxxx

 

 

\d

 

This is symbolic link for /sys/kernel/debug. It means that the physical location of this directory is /sys/kernel/debug

 

 

\dev

 

This is the mount point for a tmpfs file system, which defines the devices available to applications

 

 

\etc

 

This is symbolic link for /system/etc. It means that the physical location of this directory is /system/etc. This directory contains the configuration files required by all the programs installed on the system. One example from my test phone is as follows.

    DxHDCP.cfg

    IPACM_cfg.xml

    NOTICE.html.gz

    acdbdata

    amzn.mshop.properties

    apns-conf.xml

    app_audio_config.xml

    appops_policy.xml

    audio_effects.conf

    audio_platform_info.xml

    audio_policy.conf

    bluetooth

    brunch_featureinfo.xml

    brunch_featureswitch.xml

    brunch_media_codec.xml

    brunch_media_parser.xml

    brunch_notusedcodecs.xml

    brunch_player_list.xml

    bssid.dat

    cacert_location.pem

    camera_config.xml

    capability.xml

    clatd.conf

    cm_package_names.xml

    cne

    data

    dcm_settings.xml

    dhcpcd

    dpm

    ethertypes

    eula

    event-log-tags

    fallback_fonts.xml

    fallback_fonts_ame.xml

    fallback_fonts_ame_email.xml

    fallback_fonts_email.xml

    featureset.xml

    firmware

    flp.conf

    fonts.xml

    fonts_ame.xml

    fonts_lge.xml

    gnss-conf.xml

    gps.conf

    hcidump.sh

    hosts

    hsic.control.bt.sh

    init.ath3k.bt.sh

    init.crda.sh

    init.p1_chcon_keystore.sh

    init.qcom.audio.sh

    init.qcom.bt.sh

    init.qcom.coex.sh

    init.qcom.debug.sh

    init.qcom.efs.sync.sh

    init.qcom.post_boot.sh

    init.qcom.sdio.sh

    init.qcom.uicc.sh

    init.qcom.wifi.sh

    init.recovery.p1_chcon_keystore.sh

    interactionconfig.xml

    izat.conf

    led

    libnfc-brcm.conf

    libnfc-nxp.conf

    listen_platform_info.xml

    logmask

    lowi.conf

    media_codecs.xml

    media_codecs_google_audio.xml

    media_codecs_google_telephony.xml

    media_codecs_google_video.xml

    media_profiles.xml

    mixer_paths.xml

    mkshrc

    mrg_default_forms

    msap.conf

    mts_mask

    networksettings_features.xml

    nfc

    nfcee_access.xml

    permissions

    ppp

    preload.filter

    preloaded-classes

    qca6234-service.sh

    qmi_fw.conf

    qremote_conf.xml

    quipc.conf

    ramoops_backup.sh

    recovery-resource.dat

    rssi.xml

    sap.conf

    sec_config

    security

    sensors

    setting_features.xml

    system_fonts.xml

    telephony.xml

    thermal-engine-8992.conf

    thermal-engine-default.conf

    updatecmds

    user.filter

    usf_post_boot.sh

    usf_settings.sh

    wfdconfig.xml

    wifi

    xtra_root_cert.pem

    xtwifi.conf

     

 

\mnt

 

This is the mount point of SD card and some other file system. One example contents on my phone is as below.

    drwxr-xr-x root     system            2015-03-19 00:21 asec

    drwx------ media_rw media_rw          2015-03-19 00:21 media_rw

    drwxr-xr-x root     system            2015-03-19 00:21 obb

    drwxr-xr-x root     root              2015-03-19 00:21 pstore

    lrwxrwxrwx root     root              2015-03-19 00:21 sdcard -> /storage/emulated/legacy

    drwx------ root     root              2015-03-19 00:21 secure

    drwx------ shell    shell             2015-03-19 00:21 shell

  • asec directory is a mount point for a tmpfs file system, and is part of Android security.
  • obb directory is a mount point for the tmpfs file system, and stores expansion files for applications whose files exceed 50MB. 
  • secure directory is another component of Android security

 

\proc

 

This is the mount point for the procfs file system, which provides access to kernel data structures. Programs, such as ps, lsof, and vmstat extract information from this directory.

 

 

\sdcard

 

Usually this is set as a symbolic link. In case of my device, it is set as as symbolic link to /storage/emulated/legacy. Wherever the physical location is, sdcard points to SD Card.

 

 

\sys

 

This is the mount point for the sysfs pseudo file system, which is a reflection of the kernel's device object structure. One example contents from my device is as follows. As you see, there are several directories in it and each of these directories has a lot of contents. It would take a lot of time and efforts to understand the details and I would not comments in details for now.

    drwxr-xr-x root     root              2015-08-13 16:16 block

    drwxr-xr-x root     root              2015-08-13 23:27 bus

    drwxr-xr-x root     root              2015-03-19 00:21 class

    drwxr-xr-x root     root              2015-08-13 23:27 dev

    drwxr-xr-x root     root              2015-03-19 00:21 devices

    drwxr-xr-x root     root              2015-08-13 23:27 firmware

    drwxr-xr-x root     root              2015-03-19 00:21 fs

    drwxr-xr-x root     root              2015-03-19 00:21 kernel

    drwxr-xr-x root     root              2015-03-19 00:21 module

    drwxr-xr-x root     root              2015-03-19 00:21 power

 

 

\system

 

This file contains most of the kernel programs (e.g, shell commands), libraries and other programes installed by users. It is like the combination of 'Windows' and 'Program Files' folder in your windows system.

    -rw-r--r-- root     root      1574048 2015-07-07 01:50 DFFileList.txt

    drwxr-xr-x root     root              2015-07-07 01:49 app

    drwxr-xr-x root     shell             2015-07-07 01:50 bin

    -rw-r--r-- root     root        11831 2015-07-07 00:42 build.prop

    drwxr-xr-x root     root              2015-07-07 01:50 etc

    drwxr-xr-x root     root              2015-07-07 01:37 fonts

    drwxr-xr-x root     root              2015-07-07 01:48 framework

    drwxr-xr-x root     root              2015-07-07 01:44 lib

    drwxr-xr-x root     root              2015-07-07 01:43 lib64

    drwx------ root     root              1969-12-31 19:00 lost+found

    drwxr-xr-x root     root              2015-07-07 01:31 media

    drwxr-xr-x root     root              2015-07-07 01:50 priv-app

    drwxr-xr-x root     root              2015-07-07 00:41 rfs

    drwxr-xr-x root     root              2015-07-07 01:31 sounds

    drwxr-xr-x root     root              2015-07-07 00:39 tts

    -rw-r--r-- root     root     35239936 2015-07-07 01:31 usbautorun.iso

    drwxr-xr-x root     root              2015-07-07 01:37 usr

    drwxr-xr-x root     shell             2015-07-07 01:41 vendor

    drwxr-xr-x root     shell             2015-07-07 01:42 xbin

 

  • app : this contains user installed programs(Apps). If you install an App, it would create a folder in this directory and install the program in it.
  • bin : this contains most of shell command executables