File System Of Android

Aditi Kale
10 min readDec 31, 2021

--

The Android OS is a popular and universally used operating system for smartphones. Android’s user-visible file system is one of its advantages over iOS. It allows you to more easily work with files, opening them in any app of your choice as long as you know how.

Like other modern operating systems, Android has a disk-based file system. There are two storage areas: internal and external. Internal storage refers to the built-in, non-volatile memory. Devices also can come with removable memory (like a SD card), which is referred to as external storage.

The internal storage is also occasionally referred to as permanent storage. Files saved in internal storage are accessible only to your app by default.

External storage can be removed at any time and files saved here can be accessible to everyone.

App data, pictures, music, and more are all accessed through a single starting folder, and that’s certainly a different take to the hierarchy that PC and Mac users will be used to, and is much more powerful than what’s available to iOS users.

With Android, you won’t have access to the deepest Android system files with a basic file manager or PC connection. Still, this doesn’t mean that you can just delete any file at will. Here’s a breakdown of some of the most common storage folders, what they’re for, and which ones you can delete.

Android File System Hierarchy

Under the Android file system, there are usually six main partitions found on every device. Some devices may come with a couple of additional partitions, those differ from model to model, but there are six primary partitions that are found on every single Android device. These include /boot, /system, /recovery, /data, /cache, and /misc. Additionally, for external Android smartphone, there are two file system partitions — /sdcard and /sd-ext. So, let’s break down each partition separately and explore the Android File system hierarchy.

/boot

This partition consists of the Android kernel and the ramdisk. Basically, every single thing that is needed to boot your Android device when powered on. You should only proceed to wipe this partition from recovery if it is absolutely necessary. If you do, once the partition is wiped, ensure to reboot the phone only after installing a new boot partition. The new partition can be a /boot partition found in a ROM.

/system

The system partition accommodates the entire Android OS. This includes the Android GUI as well as the system apps that come pre-installed on Android devices. So, what happens if you wipe this partition? Well, you can still boot the device. We will only be able to put our device into recovery or bootloader mode.

/recovery

This partition is designed for backup and can be considered the alternative boot option or partition in an Android device. It lets the device boot into recovery mode where backing up data, wiping data, restoring phone to factory settings, and performing other maintenance operations.

/data

Also known as user data partition, this partition consists of all of the user’s data, including contacts, settings, apps and messages. Wiping the data partition will lead to storing your phone to factory settings, having removed all of the apps, messages, and user settings from the Android device.

/cache

This partition stores the frequently accessed app data and components. Wiping this partition will just clear the built-up cache, and the device will simply go back to rebuilding it as you continue using it. Clearing cache also frees up some space in your device and can also fix certain issues at times.

/misc

This partition contains all the miscellaneous system settings, usually on/off switches. The settings may include carrier or region ID, USB configuration, and certain hardware setting. This partition is very important since it can cause several device features to malfunction if the partition becomes corrupt or goes missing. A missing /misc partition can also cause the Android device to not boot at all.

/sdcard

This partition is the space that is available to users to store their files and data. Depending on your device, you could even have more than one sdcard partition. If your device has an external SD card slot, then the /sdcard partition refers to the internal storage device, and the external SD card will be assigned a different partition, either a new partition called /sdcard2 or a separate directory within the /sdcard partition itself such as /sdcard/sd.

Wiping the partition with the external SID card storage is completely safe, as long as you have backed up any important data or documents you may have on it. Wiping the /sdcard partition with the external SD and storage is completely safe, as long as you have backed up any important data or documents you may have on it. Wiping the /sdcard partition, however, results in wiping some system and app data and settings, but it still doesn’t hinder the system’s boot processor functionality.

/sd-ext

This is an additional partition of the sdcard partition, which is only present on some devices, typically ones that have custom ROMS or mods on them. It can usually be used with certain ROMS that have special features such as APP2SD+ or data2ext enabled. This is essentially a /data partition of the /sdcard and stores some user data and settings that are typically stored on the /data partition. This is useful for devices with limited internal memory.

Without rooting your device, Android users typically can only access the data partition. The contents of this partition are what you will see in most file managers or when you connect it to a PC. If you have an external SD card attached to the device, you will also be able to view the contents of it in this user-accessible data partition. If your phone doesn’t come packing a decent file explorer or manager, you can simply install one of the powerful third-party file manager available on the Play Store. You can also browse your data files on PC via a USB connection. However, ensure that your phone is in MTP (Media Transfer) or File Transfer mode.

Android File System Layout

Android’s file system layout isn’t identical to your PC’s. Here’s how it divides its storage:

  • Device Storage: This is the pool of storage you’ll be working with and accessing. You're free to access and modify any files here. Think of it a bit like your user directory on Windows or home directory on Linux or Mac. As on desktop operating systems, many apps dump some data files here–not sensitive data like passwords and login credentials, but downloaded files and other cache items.
  • Portable SD Card: Many Android devices also have SD card slots. You can plug the SD card into your computer or another device, load files onto it, and then plug it into your device (provided it’s formatted as portable storage and not internal storage). If you’re using a Marshmallow device and have your SD card formatted for use as internal storage, it won’t show up separately in your file manager–it will instead be part of your device storage.
  • Device Root: Your Android device also has a special system filesystem where its operating system files, installed applications, and sensitive application data are stored. Most file manager apps can’t modify this file system for security reasons, unless you have root access, and a file manager capable of using it. You probably don’t need to do that, though.

In the most basic sense, ‘root’ refers to the topmost folder in the Android file system. This would be the equivalent to the c:\ drive on Windows. Unlike Windows, though, Android has built an invisible barrier about halfway up the file system tree and only allows you to access certain files before you hit this virtual wall, beyond which the root files lie. This is to stop users from making irreversible or irreparable changes to critical OS files.

Your device storage will include a number of folders created by Android. Some of these are created and used by apps for their cache files, so you shouldn’t mess with them or remove them. However, you can free up space by removing unnecessary files stored here.

Apps and Common Folders

If your internal storage is looking a little full, you may notice that there are a number of folders here dedicated to apps, perhaps even leftover ones that you have uninstalled. As a rule of thumb, we don’t recommend tampering with any app files, but if you have uninstalled an app and notice that a folder is left behind then there shouldn’t be any harm in deleting the folder. It’s probably empty anyway, or contains some log files that are no longer of any use.

Even if you don’t have many apps installed, by default this user data partition will contain a number of folders used for storing your contacts, picture, music, etc. Here’s a breakdown of the most common folders that you’ll find here, which don’t belong to a third party app.

  • Android : This is the default location used for app cache and saved data. Not recommended to delete unless you don’t mind losing your app data; doing so might cause some apps to malfunction.
  • Alarms, Ringtones, Notifications : This folder stores custom audio files for alarms, ringtones, and notifications that can be used by some default and third party apps.
  • Cardboard : This is another self-explanatory folder, which contains data for some virtual reality apps, but will otherwise be empty.
  • DCIM : Pictures taken by your main camera app are saved in here. You’ll find this folder created on your microSD card if you opt to save pictures there, too.
  • Downloads : Anything that you download from a web browser, such as Chrome or Firefox, will appear here.
  • Pictures, Music, Movies, Video : These are all default folders used by various apps for your media needs. Some apps will allow you to specify other locations, but most media players will search these directories by default. Screenshots are often saved in the pictures folder.
  • Podcasts : This folder is used by some apps to separate post cast files from the rest of your music. Will be empty if you don’t use a podcast app.

Flash Memory Android File System

1. exFAT

Originally created by Microsoft for flash memory, the exFAT file system is not a part of the standard Linux kernel. However, it still provides support for Android devices in some cases. It stands for Extended File Allocation Table.

Benefits:
- Removes file size limitation found in FAT32.
- Performs slightly better in real-world transfers than FAT32/VFAT.
- Almost all modern smartphones have native support.

Disadvantages:
- Most likely not supported on older devices.
- Has same inefficient usage of space like FAT32.
- Like all other FAT filesystems, not as reliable as EXT4.

2. F2FS

Users of Samsung smartphones are bound to have come across this type of file system if they have been using the smartphone for a while. F2FS stands for Flash-Friendly File System, which is an Open Source Linux file system. This was introduced by Samsung 4 years ago, in 2012.

Benefits:
- Theoretically faster read/write speeds.
- Can prolong the life span of your flash storage due to less writes required.
- Doesn’t suffer file size limitation of 4GB.

Disadvantages:
- F2FS formatted SD cards may have trouble mounting and some apps may not be able to work correctly.
- Stability is heavily reliant on kernel maintainer.
- Not supported on all phones.

3. JFFS2

It stands for the Journal Flash File System version 2. This is the default flash file system for the Android Open Source Project kernels. This version of Android File System has been around since the Android Ice Cream Sandwich OS was released. JFFS2 has since replaced the JFFS.

Benefits:
- File system uses compression, thus making efficient use of flash memory.
- Writable Flash File System.

Disadvantages:
- Long mount times (especially older versions).
- The garbage collector thread may run at any time, consuming CPU cycles and blocking accesses to the file system.

4. YAFFS2

It stands for Yet Another Flash File System version 2. It has not been a part of the AOSP for a while now and is rarely found in Android smartphones. However, it does tend to make a few appearances every now and then.

Media-based Android File System

1. EXT2/EXT3/EXT4

Ext, which stands for the EXTended file systems, are the standards for the Linux file system. The latest out of these is the EXT4, which has now been replacing the YAFFS2 and the JFFS2 file systems on Android smartphones.

Benefits of EXT4:
- Doesn’t suffer file size limitation of 4GB.
- Regarded as a very stable file system.
- Contains many features such as encryption.
- Supported in all modern smartphones.

Disadvantage of EXT4:
- EXT4 formatted external SD cards may have trouble mounting and some apps may not be able to work correctly.

2. MSDOS

Microsoft Disk Operating System is known to be one of the oldest names in the world of Operating Systems, and it helps FAT 12, FAT 16 and FAT 32 file systems to run.

3. VFAT

An extension to the aforementioned FAT 12, FAT 16 and FAT 32 file systems, the VFAT is a kernel module seen alongside the MSDOS module. External SD cards that help expand the storage space are formatted using VFAT.

Benefits:
- Compatible with all devices
- All applications should be able to work natively

Disadvantages:
- File limitation of 4GB may be counter-productive for people dealing with large files such as UHD Video Recorders, etc.
- File corruption is more likely to occur in an unexpected event compared to EXT4.
- Due to the way the file system works, it can easily introduce file fragmentation.
- Known to be inefficient in storage space usage.

If you liked this blog and it helped you in knowing some of these concept, then please do share this with your friends and comment down and let us know what you are think about it!

Thank You :)

Writers:

Rishita Gawade

Aditi Kale

Ashutosh Koli

Snehal Mane

--

--