A picture of a female hand drawing a structure over white background, a lot of space for text
If you've ever wondered how files are organized and stored on an Android device, what each system folder does, or why apps access your data differently, you've come to the right place. Understanding the file hierarchy in Android and the relevance of each directory helps both curious users and developers get the most out of their devices, improve privacy, and optimize performance.
In this article, we'll explain in detail how the Android file system is structured, what types of storage exist, what the main directories are and what each one is used for, as well as the file systems that support it. We'll also give you tips and tricks for navigating them safely and understanding their importance in the functioning of the operating system. Let's get started!
How does the file hierarchy work in Android?
Android inherits its file structure from the Linux operating system, organizing everything around a root directory “/” from which various folders with specific functions hang. This hierarchy is essential not only for the functioning of the system, but also for ensuring security, application isolation, and controlled access to information.
Every file and directory in Android has access permissions that determine who can read, write to, or execute them. This protects user privacy and the integrity of the system itself. Some folders, such as /system or /data, require superuser (root) permissions to edit.
Main directories and their function in Android

Below, we'll review the most important directories you'll find on almost any Android device, explaining what each one is used for and what precautions you should take.
- /system: It houses the core of the operating system, including executables, essential libraries, drivers, and system applications (factory-installed APKs). It's one of the most sensitive directories, accessible only by the system or users with root permissions. If you're interested in uninstalling a factory-installed app that can't be deleted from the normal interface, this is where its files are located, although modifying it can be dangerous.
- / data: It stores all data related to installed apps, from their settings to databases and private files. Each app has its own folder within /data/data. This is also where the apps' preferences and private caches reside. On non-rooted devices, access is restricted.
- /cache: This directory stores temporary files that help speed up the system and apps. It can be emptied occasionally without serious negative effects, although it may cause apps to reload or temporarily slow down.
- /sdcard or /storage/emulated: The main mounting point for external storage, i.e., the space where photos, videos, documents, and files downloaded or shared by apps are stored. Both the user and apps can access this location, although access is more restricted for privacy reasons from Android 10 onwards.
- /vendor: It contains files provided by the device manufacturer, such as specific drivers, firmware, and libraries that are not part of the original Android system. It is usually updated with system updates released by the manufacturer.
- /giant: This directory includes special device files that enable communication between the operating system and the phone's physical hardware, such as the camera, display, or sensors.
- /proc: Virtual directory that reflects real-time information about system processes and resources. It doesn't host static files, but rather acts as a window into the device's internal state.
- /root: This is the personal space of the root or superuser user. On Android, it's usually empty and unused because the system blocks access to it.
- /etc: It stores configuration files essential for system operation, such as network settings, permissions, and other general configurations. On Android, it's usually a symbolic link to /system/etc.
- /efs: This critical folder contains unique and unrepeatable device data, such as the IMEI, product code, and MAC address. Tampering with or losing this folder can leave the device without a mobile connection, so it's vital to make a backup before making any changes to the system.
- /mt: Previously, on certain distributions, external partitions such as SD cards and USB devices were mounted here. Currently, the trend is to use /storage for these purposes, although /mnt persists on some devices.
- /storage: Modern directory where Android mounts internal and external storage, as well as any USB-connected volumes. Subfolders such as /storage/emulated/0 (user-accessible internal storage) and /storage/ for external cards will appear.
- /lib: It integrates the system libraries necessary for programs to function, very similar to DLL files in Windows. This also contains the kernel modules, which are vital for interacting with specific hardware.
- /sbin: Contains essential executables used by the system itself or during boot. On Android, its use is more limited compared to a full Linux system.
- /preload: Sometimes empty, in some ROMs it is used to store apps and resources preloaded from the factory.
- /config, /factory: Directories are usually empty or reserved, although /factory may contain links to critical factory data such as the WiFi MAC or IMEI.
- /sys: Virtual folder that exposes information about hardware and devices connected to the system, used primarily by developers and for diagnostics.
The file system in Android: types and features
Android supports and uses several file systems, each with specific advantages depending on the type of memory and operating system version. The most relevant ones are:
- EXT4 (Extended File System): The primary operating system in most modern devices. It stands out for its stability, performance, large file support, and advanced security and recovery features. Optimized for working with large disks and partitions, it is responsible for the reliability of the internal storage in most current smartphones.
- VFAT: A variant of the classic FAT system, improved to overcome limitations such as maximum file size. It's generally used on SD cards and external memory, offering compatibility with Windows and other systems.
- YAFFS2 (Yet Another Flash File System 2): Widely used in devices up to Gingerbread (Android 2.3). Specialized in NAND flash memory, it guarantees integrity against power outages and optimizes storage lifespan. It was gradually replaced by EXT4 in later versions.
- F2FS (Flash-Friendly File System): Developed by Samsung, it is designed to maximize performance and energy efficiency in NAND flash memory. It excels at extending lifespan, reducing power consumption, and improving access speed, thanks to a tree structure and advanced mapping techniques.
- RFS (Robust File System): A system created by Samsung and used primarily in older Galaxy devices. It improved access speed, but suffered from durability and wear resistance issues, leading to its replacement in favor of more robust options.
Internal and external storage and file access
Android classifies physical storage locations into two broad categories: internal storage and external storage. This doesn't always refer to whether the storage is external or an SD card, but rather how the system views its access and privacy.
- Internal storage: Reserved and protected space that only the app or the system can access. Perfect for storing sensitive or confidential data, as it automatically disappears when the app is uninstalled and is not accessible from other programs or by the user.
- External storage: This includes both user-accessible internal storage (such as the /sdcard folder) and SD cards and USB devices. This is where photos, downloads, and shared files are stored. Since Android 10 (API 29) and especially Android 11, access has been more restrictive to protect privacy.
External storage is divided into:
- App-specific directories: Only accessible by that specific app, even if they are on SD or external storage.
- Shared directories: multimedia (images, videos, etc.), documents, and other files accessible to any application with the appropriate permissions.
For each type of storage, Android provides different access methods and permissions. For example, access to /sdcard or SD cards may require READ_EXTERNAL_STORAGE or WRITE_EXTERNAL_STORAGE permissions, although since Android 11 the model is more restrictive and purpose-oriented (not location-oriented).
Directory structure in Android Studio projects
If you're a developer working with Android Studio, you'll find that projects have a slightly different internal organization, focused on app programming and deployment. Major directories include:
- app/manifest: Folder where the AndroidManifest.xml file resides, which is essential for defining global app information, activities, permissions, themes, and other metadata.
- app/java: This is where the app's logic classes are located, both in Java and Kotlin, depending on the language chosen. It's also home to the main test and activity files.
- app/res: Space reserved for all visual and interface resources: layouts, images, icons, text files (strings, colors, themes, etc.) and other graphic elements.
- Gradle Scripts: Project configuration files and dependencies, such as build.gradle, which control how the app is compiled, which libraries it needs, versions, plugins, etc.
This framework is the foundation for developing functional, scalable, and well-organized applications in Android Studio.
Permissions and Privacy in the Android File System

Android manages file access permissions following very strict security logic. Access to critical directories like /system or /data is blocked for normal apps and can only be achieved through root, while external storage requires specific permissions depending on the file type and Android version.
- READ_EXTERNAL_STORAGE: Allows reading of files outside the app's private folder, such as photos and documents from other apps. Since Android 11, this only applies to media (images, videos, audio).
- WRITE_EXTERNAL_STORAGE: Allowed writing files outside the app until Android 10. In newer versions, its functionality is limited.
- MANAGE_EXTERNAL_STORAGE: Provides broader access, only for very specific cases in file management apps; it must be justified and may be rejected on Google Play.
Android 10 and 11 introduce scoped storage, further restricting access and requiring apps to operate only in their own spaces unless explicitly consented to by the user.