- Android File System And Directory Structure Explained
- Android File System Structure
- The sdcard and ext-sdcard Partitions
- Card Type
- Card Type File System
- Max Capacity
- Android File Associations
- Android File Managers
- File Downloads
- Summary
- Android File System
- Contents
- File System Overview
- Hiding Media Files
- SDCard
- External Storage Public Directory
- App Installation path
- File System Tree
Android File System And Directory Structure Explained
Last Updated: November 7, 2014
Most people are familiar with the file layout on Windows and are happy navigating the Windows file System.
Windows uses a drive letter for each physical drive or partition.e.g. C: drive
Note: A Physical drive will have at least 1 partition but can have more than one. This is true for both Windows and Android.
[outline style=”yellow”]What is a Disk Partition? – Disks can be subdivided into smaller disks called partitions. Partitions appear and can be used as if they were separate physical disks. [/outline]
If you insert a USB drive into your windows machine in shows up as a disk with an assigned drive letter.
Although windows shows a disk icon the disks could be partitions of a single physical disk.
Each disk partition has a root directory which contains files and folders (directories).
The root of the C drive is C:\ and of the F drive is F:\ etc
Android File System Structure
Android uses the Linux file system structure which has a single root .
The diagram below shows the structure
The system partitions and directories are protected and unless your device is rooted you don’t normally have access to these although some file managers will display them.
Physical disks and partitions appear under the root as a directories , and do not have a drive letter as in Windows.
Android doesn’t normally come with a default file manager, and so you will need to install a file manager App like Astro file manager, to locate and manage files and folders.
The sdcard and ext-sdcard Partitions
The sdcard partition is the main storage area for user data and files. It also contains App settings and data.
The sdcard partition exists even though you may not have an external sd card.
It is the internal partition.
If you open the sdcard directory you will see something like this:
Note: partial listing only
These files and directories contain your pictures,films,downloads etc as well as App data and settings.
You can view these files from your PC by connecting your device to a PC using a USB cable.
The ext-sdcard partition will only be visible if your device supports external storage, usually using a microSD slot.
External sd cards use either the FAT,FAT32 or exFAT file system formats.
Most devices support FAT and FAT32, but support for exFAT is limited.
The choice of file system is governed by the partition size as follows:
Card Type
Card Type File System
Max Capacity
Note: Windows format size limit of 32GB. Can be larger but need to format using external tools. Windows XP could fomat FAT32 Volumes upto 128 GB
Android File Associations
Just as with other operating systems like Windows, Android will use an App to open a particular file type,denoted by the extension.
For example if you try to open a pdf file it will normally use Adobe reader (if installed) to open the file.
To open a file you will normally need to located the file using a file manager.
Just press the file to open it.
If the file type doesn’t already have an App associated with it you should be prompted to choose between the available Apps.
The option to always use that App sets it as the default App for that file type.
If you set it as the default App you will not be prompted again unless you remove the association.
To remove an association you need to remove it from the App itself.
So if the pdf files open with adobe reader and you want to change that:
- Go to Settings>Apps>Select Adobe reader,
- Then go to the Launch by default section
- and Clear defaults
The next time you try to open a pdf file you will be promoted to choose an App.
Android File Managers
If you search the Google play store you will find many file managers.
Which App is the most suitable depends on what you want to do. You should bear in mind that more features/functionality isn’t always better.
File managers like ESF have lots of functionality including:
- Built in FTP client
- Task Manager
- Cloud storage client
- etc
However for many this is a bit of an overkill, and so you might consider installing one of the simpler file managers like file manager and Astro file manager.
File Downloads
When you download a file using Google chrome or another browser App the file it is stored in the download directory.
You can access the directory contents through a shortcut in the Apps folder (if provided).
You can also use a file manager to locate it the folder called download. It is under your primary storage (called sdcard)
Summary
Android uses the Linux File and Directory Structure which consists of a single root.
All drives and partitions are displayed as directories in this tree like structure.
Источник
Android File System
Microsoft Windows users are familiar with the terms FAT32, or NTFS, which refers to types of file systems. Android devices are developed on Linux, which is based on UNIX. Linux users are familiar with good old ext2 file system. Well, your Android device may use an updated Linux file system, such as ext4, or a proprietary file system by a manufacturer, depending on who made the device and and what has been done to it by the user.
Samsung Galaxy S phones use the Samsung RFS proprietary file system while the Samsung Nexus S with Android 2.3 uses the Linux Ext4 file system. The new open standard Ext4 file system seems to be the popular standard. Android phones use the Linux kernel, and as many linux users know, linux can support a large number of operating systems.
The SDCard may be formatted ext3 or YAFFS, or ext4.
In December 2010 it was announced «Ext4 filesystem hits Android,» Google’s new Nexus S smartphone is the first Android device to use the Ext4 filesystem. Ext4 developer Ted T’so claims it is less prone to data loss. Previously, most Androids used YAFFS, a lightweight filesystem that is optimized for flash storage and is commonly used in mobile and embedded devices.
Ext4 is considered a breakthrough for Android devices, with increased data integrity and quicker data read/write access.
Contents
File System Overview
The file system structure of Android devices shares some similarities with Linux, and has some peculiar traits unique to Android.
Many applications search the entire sdcard for data files, for example, a common music player will search the entire SD Card for all audio files, including .mp3 files. This can be undesirable for (a) purists that wish to have certain files for certain purposes in specific organized and standardized places and (b) people that have audio files in certain folders they do not want showing up in the new media player just installed.
It is true that Android blows away file system and storage convention, by trying to make it seem as if there is no need for structure of the file system. The design is supposed to be a «stick it in and it just finds the stuff and works» designed for the lowest common denominator. Unfortunately, a lot of technology is heading down this zombie minded road.
Linux users are also familiar with partitions versus directories. Some directories visible via the file manager (or ls command on linux) may be mounted partitions. A good article reference to read is: Android Partitions Explained: boot, system, recovery, data, cache & misc by an author named By Haroon Q. Raja.
Hiding Media Files
If you have a folder with files, such as .mp3 files, and you don’t want them to appear to applications that scan the entire card contents, just put a .nomedia file in the folder and it wont see them. Save a null file as “.nomedia” and make sure that the Save as type is set as “All Files” instead of “Text documents.” Copy that file to the folder on your SD card containing audio files you don’t want to show up. You may have to reboot the Android after doing this.
Also, any folder whose name begins with a period, such as .secretmedia, will be invisible to scanning software also. A folder beginning with a period in the Linux / Android world is like a folder with the hidden attribute set in the Windows world.
The Linux console command to quickly create the null .nomedia file is:
SDCard
The mounted SDCard is a storage device mounted to the file system in the typical Linux fashion. On the file system root the /sdcard is a symbolic link to /mnt/sdcard. /mnt/sdcard is where the SD card is actually mounted, but the same files can also be accessed in /sdcard.
- /mnt/sdcard — Your removable SD card data is stored here.
The Samsung Galaxy Tab 2 actually has two SDCard mounts, one for a built-in internal SDCard which is different than the device memory on a typical Android phone, and the second is the removable SDCard.
- /mnt/extSdCard — On the Samsung Galaxy 2 tablet this is the removable SD card.
Every Android-compatible device supports a shared «external storage» that you can use to save files. This can be a removable storage media (such as an SD card) or an internal (non-removable) storage. Files saved to the external storage are world-readable and can be modified by the user when they enable USB mass storage to transfer files on a computer.
Android uses the DCF (Design rule for Camera File system) specification. All digital cameras contain a DCIM (Digital Camera IMages) folder in their root directory. Inside this will be multiple folders named nnnABCDE, where nnn is a unique directory number between 100-999 and ABCDE is a five-character alphanumeric string often (but not required to be) related to the camera manufacturer. Image files stored within these folders will have a file name in the format ABCDnnnn, where ABCD is a four-character string (often DSC_ or IMG_) and nnnn is a unique sequential index number.
External Storage Public Directory
Android developer’s reference explains that there are certain public storage directories that are not specifically tied to a specific program. So if a program is uninstalled, it should never remove data from one of these standard public storage directories. These directories lay at the root of the external storage, such as Music/, Pictures/, Ringtones/, and others.
- Music/ — Media scanner classifies all media found here as user music.
- Podcasts/ — Media scanner classifies all media found here as a podcast.
- Ringtones/ — Media scanner classifies all media found here as a ringtone.
- Alarms/ — Media scanner classifies all media found here as an alarm sound.
- Notifications/ — Media scanner classifies all media found here as a notification sound.
- Pictures/ — All photos (excluding those taken with the camera).
- Movies/ — All movies (excluding those taken with the camcorder).
- Download/ — Miscellaneous downloads.
So an example would be /mnt/sdcard/Pictures which is made up of the first part, /mnt/sdcard (or just /sdcard) that being the root of the sdcard and then one of the directories above.
App Installation path
Preinstalled applications are in /system/app folder. User installed applications are in /data/app
- /data/app
- /data/app-private
- /system/app/
- /sdcard/.android_secure (shows .asec files, not .apks) On Samsung phones: /sdcard/external_sd/.android_secure
In Android 7.0 and before, after an APK is installed, it will be located in /data/app path.
In Android 7.0, the APK file will be installed into the /data/app/
— / folder, where the
is the package name of the APK, and the num may be 1 or 2.
File System Tree
Since Android is a Linux-based operating system for smartphones and tablets it shares the basic Linux «like» file system structure. Purists will argue that Linux is a kernel, not a file system structure, but people get the point. Android runs on top of a standard Linux kernel, and uses many of the same kernelspace utilities. The directory structure of Android looks similar to the directory structure of common Linux distributions. Android utilizes certain conventions providing uniformity in partitions versus directories on a partition. There are mainly 6 partitions in Android phones, tablets and other Android devices: boot, system, recovery, data, cache, misc.
Click on a folder for details on purpose.
Keywords: Android Tablet PC Samsung Galaxy Tab Two 2 FS File System Root Linux
Источник