Take the 2-minute tour ×
Android Enthusiasts Stack Exchange is a question and answer site for enthusiasts and power users of the Android operating system. It's 100% free, no registration required.

What purpose does the /cache partition in Android serve? Are there any cases where clearing the /cache partition could result in lost data?

share|improve this question

2 Answers 2

up vote 9 down vote accepted

/cache partition is mostly for saving the downloads from Google Play Store, found in /cache/downloads. It also can hold the recovery log found in /cache/recovery called last_log as well (this holds any errors and/or diagnostics from the recovery binary a lá CWM or stock, which will get logged in the file to aid debugging and development of the recovery binary).

There is also another directory in there called lost+found which holds any recovered files (if any) as a result of file-system corruption, such as incorrectly removing the SDcard without un-mounting it.

So really, there is no loss of data from clearing it.

In fact, upon Android boot-up, the script will clear out the /cache/downloads to make way for any new downloads/updates from Google Play Store.

share|improve this answer

To give a closer overview on filesystems used on Android devices, here's a short table with a selection of the more important ones:

+---------------+------------------+------------------------------------------+
| Mount Point   | File System Type | What to find here                        |
+---------------+------------------+------------------------------------------+
| /proc         | proc             | metadata about the system such as file   |
|               |                  | system statistics                        |
| /data/data[1] | YAFFS2           | almost all app data                      |
| /data[2]      | EXT3/EXT4/YAFFS2 | data from apps (except those stored on   |
|               |                  | /data/data) plus system                  |
| /cache        | YAFFS2/EXT3      | Cache file system used by some apps and  |
|               |                  | by the system                            |
| /mnt/asec     | tmpfs            | unencrypted .apk file (the encrypted     |
|               |                  | counterpart is stored in                 |
|               |                  | /mnt/sdcard/.android_secure; decrypted   |
|               |                  | variant is needed for running systems to |
|               |                  | access/execute                           |
| /app-cache    | tmpfs            | temporary file system used e.g. by the   |
|               |                  | stock-browser on some HTC devices        |
| /mnt/sdcard   | vfat             | FAT32 file system on the SD-card         |
| /mnt/emmc     | vfat             | FAT32 file system on the embedded        |
|               |                  | (internal) eMMC                          |
+---------------+------------------+------------------------------------------+

[1] on older systems, entire /data is just a single partition/file system [2] on newer devices, /data can be further segemented

You will not find all these file systems on all devices -- but if you find some of them, this list should give you a raw idea.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.