Sem 7

Android Partitions and File Hierarchy

Deck 2: Android file partition and hierarchy. The main partitions (/boot, /system, /recovery, /data, /cache, /misc, /sdcard), the root directory tree with ADB demos, where apps store data (shared preferences, internal, external, SQLite), mount points and VFS, and flash, media and pseudo filesystems.

To analyse any system you must know its file hierarchy. Knowing how Android organises data in files and folders lets an analyst narrow the search to specific locations.

  • The Android file hierarchy is a customised version of the Linux hierarchy.
  • It may change slightly with the manufacturer and the underlying Linux version.
  • Some folders are visible only with root access.

Android PartitionsSearch on YouTube

PartitionContentsForensic relevance
/bootInformation and files needed to boot: the kernel and RAM diskWithout it the phone cannot start. Data in RAM is rich in value and should be captured during acquisition.
/systemSystem files other than kernel and RAM disk: Android frameworks, libraries and preinstalled appsMust never be deleted; that makes the device unbootable.
/recoveryBackup boot option; boots the device into recovery modeRecovery mode is used for phone updates and maintenance, and has tools to repair the installation.
/dataData of each application and most user data: contacts, SMS, dialled numbersMost important partition for forensics.
/cacheFrequently accessed data, some logs, and update packages downloaded over the cellular networkData here may no longer be present in /data.
/miscMiscellaneous settings, mostly device state (on/off): hardware settings, USB settingsShows how the device was configured.
/sdcardEverything on the SD cardPictures, videos, files, documents.

Partitions vary from phone to phone, because manufacturers customise Android.

Big Systems Rarely Delete Cached Media Silently: Boot, System, Recovery, Data, Cache, Misc, Sdcard.

Practical: Viewing Partitions with ADBSearch on YouTube

adb devices                          # list connected devices
adb shell                            # open a shell on the device
cd /proc
ls -al                               # the 'partitions' file is here
cat partitions                       # lists partitions (sda, sdb...) but not what they map to
exit                                 # leave the shell and come back
adb shell
df                                   # filesystem path (alias/mapping) and size info
ls -l $(find /dev/block -name by-name)   # partition name -> block device mapping
cat /proc/partitions                 # partition layout
cat /proc/mounts                     # what is mounted where

cat /proc/partitions shows block devices (for example sda) but not whether sda is data, system or boot. The by-name symlinks under /dev/block give that mapping.

Android File HierarchySearch on YouTube

In Linux the file hierarchy is a single tree. The top of the tree is /, called the root.

Overview of DirectoriesSearch on YouTube

DirectoryWhat it holdsDemo
acctMount point for the acct cgroup (control group), which provides user accounting (details about different users)ls, cd acct/
cacheFrequently accessed data and app components. May hold images, browsing history and other app data. Contains lost+found, which keeps recovered files after filesystem corruption (for example, removing the SD card without unmounting it)cd cache, ls
dataData of each application; most user data (contacts, SMS, dialled numbers)cd data/, ls -al
devSpecial device files for all devices. Mount point for the tmpfs filesystem, which defines the devices available to appscd dev, ls -al
initThe init program executed when the Android kernel bootscat init
mntMount point for all filesystems, internal and external SD cardscd mnt/, ls
procMount point for procfs, access to kernel data structures and process information. For example /proc/meminfo gives memory allocationcd proc/, cat meminfo
rootHome directory of the root account. Accessible only on a rooted device
sbinBinaries for several important daemonscd sbin, ls
miscMiscellaneous settings, mostly state (ON/OFF): hardware settings, USB settings
sdcardData on the device's SD cardcd sdcard, ls
systemLibraries, system binaries, system files and preinstalled appscd system, cat build.prop, cd app

Important Subdirectories of /dataSearch on YouTube

  • /data/dalvik-cache: holds optimised dex files so they need not be compiled and loaded each time. When an app is installed, its .dex file is modified and an .odex (optimised dex) file is created. It is cached here so the optimisation does not run every time the app loads. Demo: cd data/, ls -al, cd dalvik-cache, ls -al.
  • /data/data: the private data of all applications. Most user data is stored here, so it is very important forensically. Demo: cd data, ls, cd com.android.phone, ls.

/sdcard and DCIMSearch on YouTube

  • The SD card can be removable or non-removable storage.
  • Any app with the WRITE_EXTERNAL_STORAGE permission may create files or folders here.
  • Most phones have default folders such as android_secure, Android, DCIM and media.
  • DCIM (Digital Camera Images) is the default directory structure for cameras, smartphones and tablets. It holds photos, videos and thumbnail (cache) files. Photos are stored in /DCIM/Camera.

/system ContentsSearch on YouTube

  • build.prop: all build properties and settings for the device. It gives an overview of the device model, manufacturer, Android version, CPU details and more. Demo: cat build.prop.
  • app: system apps and preinstalled apps. Mounted read-only to prevent changes. Besides .apk files you see .odex files. An .odex file is a collection of parts of the app optimised before booting, meant to save space.
  • framework: sources of the Android framework. Holds implementations of key services, such as the system server with the package and activity managers. Much of the mapping between Java app APIs and native libraries happens here. Demo: cd framework.

Practical: Walking the TreeSearch on YouTube

adb shell
ls -al                     # top-level folders; acct is listed first
cd acct/ ; ls ; cd ..
cd cache ; ls ; cd ..
cd data/ ; ls -al ; cd dalvik-cache/ ; ls -al ; cd ..
cd data ; ls ; cd com.android.phone ; ls ; cd ../../..
cd dev ; ls -al ; cd ..
cat init                   # contents of the init file
cd mnt/ ; ls ; cd ..
cd proc/ ; ls ; cat meminfo ; cd ..
cd sbin ; ls ; cd ..
cd sdcard ; ls ; cd ..
cd system ; ls ; cat build.prop ; cd app ; ls ; cd ../framework ; ls

Most of these need root on a real phone. On an emulator adb root gives a root shell.

Assignment 1, Android File System Exploration using ADB. The lab connects with adb shell, lists the root directory (ls -al /) and /data, and explains the forensic relevance of each folder. Key findings: /data/data/<package> holds databases/, shared_prefs/, files/, cache/; /data/system holds accounts and lock settings; /data/app holds user-installed APKs; misc_ce/misc_de show the CE/DE split from L02; /system/build.prop identifies the device; /proc gives live process data.

Application Data StorageSearch on YouTube

Android apps store a lot of sensitive data. Apps on a device come from four sources:

  • Apps that come with Android
  • Apps installed by the manufacturer
  • Apps installed by a wireless carrier
  • Apps installed by the user

App data often holds a wealth of information relevant to an investigation (for example, WhatsApp forensics starts by finding where the WhatsApp package is installed).

  • App data can be stored internally or externally.
  • On external storage (SD card) data can be anywhere. On internal storage the location is predefined.
  • Internal data of every app (system or user-installed) is saved in /data/data/<package name>. For example, the default email app is com.android.email, and its data is in /data/data/com.android.email.

App data can be stored in five places:

  1. Shared preferences
  2. Internal storage
  3. External storage
  4. SQLite database
  5. Network

Some Investigators Examine SQLite Nightly: Shared preferences, Internal, External, SQLite, Network.

Shared PreferencesSearch on YouTube

  • A framework to store key-value pairs of primitive data types in .xml format. Primitive types: boolean, float, int, long and string.
  • Stored in /data/data/<package>/shared_prefs/, for example /data/data/com.android.email/shared_prefs/.
  • View with cat:
cat /data/data/com.android.email/shared_prefs/com.android.email_preferences.xml
<boolean name="account_settings_cc_bcc" value="true" />
<string name="account_name">user@example.com</string>
<string name="account_password">...</string>
  • Data is in name-value pairs. Parameters such as account_name, account_password and recent_messages are interesting forensically.
  • Many apps store sensitive data in shared preferences because it is lightweight. So it is a key source of evidence.

Internal StorageSearch on YouTube

  • Files are stored in the app's /data/data subdirectory.
  • Data here is private; other apps cannot access it.
  • Even the device owner cannot view these files unless they have root.
  • The developer can allow other processes to modify and update these files if needed.
  • Most apps get the folders databases, lib, shared_prefs, cache.
  • The databases folder holds crucial data. View it with tools such as SQLite Browser.

External StorageSearch on YouTube

  • Removable media (SD card) or non-removable storage that comes with the phone.
  • A removable SD card can be used on other devices by moving the card.
  • SD cards are usually formatted with FAT32, EXT3 or EXT4.
  • External storage has no strict security enforcement. Data here is public. Other apps can read it if they have the needed permissions.
  • Apps keep large files (images, videos) here for faster retrieval.

SQLite DatabaseSearch on YouTube

  • A popular database format for structured data on many mobile systems. Open source, compact, full-featured.
  • Android supports SQLite through dedicated APIs.
  • App databases are usually at /data/data/<ApplicationPackageName>/databases.
  • Highly valuable forensically: they often hold much of the app's important data.
StorageLocationFormatWho can read it
Shared preferences/data/data/<pkg>/shared_prefs/XML key-valueApp only (root to read)
Internal storage/data/data/<pkg>/ (files, cache, lib)Any fileApp only (root to read)
External storage/sdcard/...Any file, FAT32/EXT3/EXT4Any app with permission
SQLite/data/data/<pkg>/databases/.db filesApp only (root to read)
NetworkRemote serverAnyServer side

Mid sem 2026 asked where a banking app would store account details (SQLite), login and preferences (shared preferences), downloaded statements (internal/external file storage) and temporary files (app cache). Map each data type to one of these locations with its path.

Android FilesystemSearch on YouTube

A filesystem defines how data is stored, organised and retrieved from a volume. A basic installation may use one volume split into several partitions, and each partition can have a different filesystem. Windows uses FAT32 or NTFS; Linux uses EXT2 or EXT4. Examination tools (FTK, Autopsy) extract evidence from an image based on its filesystem.

Purpose of a FilesystemSearch on YouTube

  • A directory is a collection of files; files hold data and have extensions.
  • To the OS everything is in memory, in binary form.
  • The filesystem decides how content is stored in memory and how files are retrieved. For example, it lets the OS open a .docx file with Microsoft Word.
  • The filesystem manages the files and folders inside a partition.

Mount Points and VFSSearch on YouTube

  • Android uses mount points, not drive letters (C:, E:).
  • A mount point is a directory to which a partition is attached.
  • Mounting attaches an additional filesystem to the currently accessible filesystem.
  • Each filesystem has its own rules, so each offers different retrieval speed, security, size limits and so on.
  • From a forensic view, identify which filesystems Android uses and which matter to the case. The filesystem holding user data is the main concern.
  • Filesystems are not accessed by drive name. They are combined into one hierarchical tree. Each new filesystem joins this tree when it is mounted, and its files become the contents of the mount-point directory.
  • Each filesystem has a kernel module that registers its operations with the Virtual File System (VFS). VFS lets applications access different filesystems in a uniform way.
cat /proc/mounts     # sda, sdb... are partitions; /system, /data are mount points
cat /proc/filesystems   # supported filesystems; 'nodev' marks pseudo filesystems

In /proc/mounts, /system and /data are directories mounted on partitions such as sda and sdb.

Common Android FilesystemsSearch on YouTube

Three main categories:

  1. Flash memory filesystems
  2. Media-based filesystems
  3. Pseudo filesystems

Flash Memory FilesystemsSearch on YouTube

Flash memory is non-volatile memory that is erased and reprogrammed in units called blocks. Flash has special characteristics (long erase times for some blocks), so it needs special filesystems.

FilesystemKey fact from the slides
exFAT (Extended File Allocation Table)Microsoft proprietary, optimised for flash drives
F2FS (Flash Friendly File System)Open-source filesystem introduced by Samsung
JFFS2 (Journal Flash File System v2)Log-structured filesystem used in Android; the slide states it is the default flash filesystem for AOSP since Ice Cream Sandwich
YAFFS2 (Yet Another Flash File System v2)Not supported in newer kernels, but some manufacturers may still support it
RFS (Robust File System)Listed on the slide with no further detail

Media-based FilesystemsSearch on YouTube

These manage media storage and retrieval.

  • EXT2/EXT3/EXT4 (Extended file system): one of the first filesystems to use the virtual filesystem.
    • Journaling is the main advantage of EXT3 over EXT2. After an unexpected shutdown or corruption, EXT3 does not need the filesystem verified; files and folders stay available.
    • EXT4 gained importance with dual-core phones. YAFFS2 had a bottleneck on dual-core systems, so with Gingerbread Android swapped YAFFS for EXT4.
  • FAT (FAT12, FAT16, FAT32): supported by the MSDOS driver.
  • VFAT (Virtual File Allocation Table): an extension of FAT16 and FAT32.
  • Most Android devices support Microsoft's FAT32. Windows, Linux and macOS all support it, so they can read, modify and delete files on the FAT32 part of an Android device. Most external SD cards are formatted FAT32.

Pseudo FilesystemsSearch on YouTube

Pseudo filesystems are logical groupings of files. They have no real storage device and are marked nodev in /proc/filesystems.

Pseudo FSMounted atPurpose and forensic value
cgroup (control group)/acct and othersAccess and define kernel parameters. Android uses it to track jobs: it aggregates tasks and keeps track of them.
rootfs/Holds everything needed to boot. Mounted first; all other filesystems are mounted on it. If corrupt, the device cannot boot.
procfs/procKernel data structures, processes and system information. /proc/filesystems lists available filesystems; cat /proc/cpuinfo shows CPU details.
sysfs/sysDevice configuration. Useful to check whether a setting was enabled on the phone.
tmpfs/tmp (and /dev)Temporary storage in RAM. Fast, but lost on restart or power-off. Examine or extract it before a reboot. Demo: cd tmp/, ls.
cat /proc/filesystems
cat /proc/cpuinfo

tmpfs data lives in RAM. If the phone is rebooted or switched off, it is gone. This is one more reason not to power off a seized phone (see L01).

Quick self-testSearch on YouTube

Why is the /data partition the most important for forensics?

It holds the data of every application and most user data: contacts, SMS, dialled numbers, app databases and shared preferences under /data/data/<package>.

Why can /cache be useful even when /data has been examined?

/cache stores frequently accessed data, logs and downloaded update packages. Data here may no longer exist in /data.

What is the Dalvik cache and why is it there?

/data/dalvik-cache stores the optimised .odex file created from an app's .dex file at install, so the optimisation does not run every time the app loads.

What does build.prop tell a forensic analyst, and where is it?

/system/build.prop holds build properties: device model, manufacturer, Android version, CPU details and other settings.

Which ADB commands show the partitions and their mapping?

adb shell, then cat /proc/partitions (partitions only), df (paths and sizes), ls -l $(find /dev/block -name by-name) (name to block device mapping), and cat /proc/mounts (mount points).

List the five places an Android app can store data.

Shared preferences, internal storage, external storage, SQLite database, network.

What are shared preferences and why do they matter forensically?

XML files of key-value pairs of primitive types (boolean, float, int, long, string) in /data/data/<pkg>/shared_prefs/. Apps often store sensitive values such as account_name and account_password there because it is lightweight.

How does external storage differ from internal storage?

Internal storage (/data/data) is private to the app and needs root to read. External storage (SD card, usually FAT32/EXT3/EXT4) has no strict security; any app with permission can read it, and it holds large media files.

What is a mount point and what does VFS do?

A mount point is a directory to which a partition's filesystem is attached. VFS is the kernel layer where each filesystem module registers its operations, so apps can access different filesystems uniformly.

Name the three categories of Android filesystems with one example each.

Flash memory (F2FS, YAFFS2, JFFS2, exFAT, RFS), media-based (EXT4, FAT32, VFAT), pseudo (rootfs, procfs, sysfs, tmpfs, cgroup).

  • Android uses a customised Linux tree rooted at /; some folders need root.
  • Partitions: /boot (kernel, RAM disk), /system (framework, libs, preinstalled apps), /recovery, /data (user and app data), /cache, /misc, /sdcard.
  • Key paths: /data/data/<pkg>, /data/dalvik-cache (odex), /system/build.prop, /system/app, /system/framework, /DCIM/Camera.
  • Use adb shell with cat /proc/partitions, df, /dev/block/.../by-name and cat /proc/mounts to map partitions.
  • App data goes to shared preferences (XML), internal storage, external storage, SQLite (databases/) or the network.
  • Filesystems mount at mount points into one tree; VFS gives uniform access.
  • Flash (F2FS, YAFFS2, JFFS2, exFAT, RFS), media (EXT2/3/4, FAT32, VFAT) and pseudo (cgroup, rootfs, procfs, sysfs, tmpfs) filesystems.
  • tmpfs lives in RAM and is lost on reboot.