58

What is Android's file system?

Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
Guimo
  • 613
  • 1
  • 5
  • 3

9 Answers9

39

It depends on what filesystem, for example /system and /data are yaffs2 while /sdcard is vfat.

This is the output of mount:

rootfs / rootfs ro 0 0
tmpfs /dev tmpfs rw,mode=755 0 0
devpts /dev/pts devpts rw,mode=600 0 0
proc /proc proc rw 0 0
sysfs /sys sysfs rw 0 0
tmpfs /sqlite_stmt_journals tmpfs rw,size=4096k 0 0
none /dev/cpuctl cgroup rw,cpu 0 0
/dev/block/mtdblock0 /system yaffs2 ro 0 0
/dev/block/mtdblock1 /data yaffs2 rw,nosuid,nodev 0 0
/dev/block/mtdblock2 /cache yaffs2 rw,nosuid,nodev 0 0
/dev/block//vold/179:0 /sdcard vfat rw,dirsync,nosuid,nodev,noexec,uid=1000,gid=1015,fmask=0702,dmask=0702,allow_utime=0020,codepage=cp437,iocharset=iso8859-1,shortname=mixed,utf8,errors=remount-ro 0 0

And with respect to other filesystems supported, this is the list:

nodev   sysfs
nodev   rootfs
nodev   bdev
nodev   proc
nodev   cgroup
nodev   binfmt_misc
nodev   sockfs
nodev   pipefs
nodev   anon_inodefs
nodev   tmpfs
nodev   inotifyfs
nodev   devpts
nodev   ramfs
         vfat
         msdos
nodev   nfsd
nodev   smbfs
         yaffs
         yaffs2
nodev   rpc_pipefs
Matthias Braun
  • 32,039
  • 22
  • 142
  • 171
Diego Torres Milano
  • 65,697
  • 9
  • 111
  • 134
15

By default, it uses YAFFS - Yet Another Flash File System.

Foole
  • 4,754
  • 1
  • 26
  • 23
  • Hmm Is there any other file Systems Android supports ? – Guimo Mar 11 '10 at 01:05
  • 4
    [Android 2.3 will use ext4.](http://www.h-online.com/open/news/item/Android-2-3-Gingerbread-to-use-Ext4-file-system-1152775.html) – Paul Lammertsma Mar 07 '11 at 09:43
  • @PaulLammertsma Is it true that manufacturers are required to follow this? – Pacerier Mar 05 '12 at 16:42
  • 1
    @Pacerier I don't know the policies around what manufacturers are or aren't required to do, but a quick check on a few pre- and post-Gingerbread devices (`adb shell mount`) confirms that from Gingerbread the filesystem is ext4, and Froyo and older are YAFFS. – Paul Lammertsma Mar 05 '12 at 17:18
  • @PaulLammertsma btw do you happen to know how to get the name of the filesystem using code? – Pacerier Mar 05 '12 at 17:39
  • @Pacerier No, I'm afraid not. I would suggest asking a new question. – Paul Lammertsma Mar 05 '12 at 21:02
11

Most answers here are pretty old.

In the past when un managed nand was the most popular storage technology, yaffs2 was the most common file system. This days there are few devices using un-managed nand, and those still in use are slowly migrating to ubifs.

Today most common storage is emmc (managed nand), for such devices ext4 is far more popular, but, this file system is slowly clears its way for f2fs (flash friendly fs).

Edit: f2fs will probably won't make it as the common fs for flash devices (including android)

dolbi
  • 2,180
  • 1
  • 19
  • 25
8

Johan is close - it depends on the hardware manufacturer. For example, Samsung Galaxy S phones uses Samsung RFS (proprietary). However, the Nexus S (also made by Samsung) with Android 2.3 uses Ext4 (presumably because Google told them to - the Nexus S is the current Google experience phone). Many community developers have also started moving to Ext4 because of this shift.

slybloty
  • 6,346
  • 6
  • 49
  • 70
Brian
  • 81
  • 1
  • 1
5

since most of the devices use eMMC,the file system android uses is ext4,except for the firmware.refer-http://android-developers.blogspot.com/2010/12/saving-data-safely.html

Here is the filesystem on galaxy s4:

  • /system ext4

  • /data ext4

  • /cache ext4

  • /firmware vfat

  • /data/media /mnt/shell/emulated sdcardfs

The detailed output is as follows:

/dev/block/platform/msm_sdcc.1/by-name/system /system ext4 ro,seclabel,relatime, data=ordered 0 0

/dev/block/platform/msm_sdcc.1/by-name/userdata /data ext4 rw,seclabel,nosuid,no dev,noatime,discard,journal_checksum,journal_async_commit,noauto_da_alloc,data=o rdered 0 0

/dev/block/platform/msm_sdcc.1/by-name/cache /cache ext4 rw,seclabel,nosuid,node v,noatime,discard,journal_checksum,journal_async_commit,noauto_da_alloc,data=ord ered 0 0

/dev/block/platform/msm_sdcc.1/by-name/efs /efs ext4 rw,seclabel,nosuid,nodev,no atime,discard,journal_checksum,journal_async_commit,noauto_da_alloc,errors=panic ,data=ordered 0 0

/dev/block/platform/msm_sdcc.1/by-name/persdata /persdata/absolute ext4 rw,secla bel,nosuid,nodev,relatime,data=ordered 0 0

/dev/block/platform/msm_sdcc.1/by-name/apnhlos /firmware vfat ro,context=u:objec t_r:firmware:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437, iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0

/dev/block/platform/msm_sdcc.1/by-name/mdm /firmware-mdm vfat ro,context=u:objec t_r:firmware:s0,relatime,uid=1000,gid=1000,fmask=0337,dmask=0227,codepage=cp437, iocharset=iso8859-1,shortname=lower,errors=remount-ro 0 0

/data/media /mnt/shell/emulated sdcardfs rw,nosuid,nodev,relatime,uid=1023,gid=1 023 0 0

rupesh jain
  • 3,410
  • 1
  • 14
  • 22
  • I have just had a corrupted file system on both cache and system partitions. Shall I just reformat them as f2f? – Elysium Jan 12 '16 at 14:46
4

Depends on what hardware/platform you use.

Since Android uses the Linux-kernel at this level, it is more or less possible to use whatever filesystem the Linux-kernel supports.

But since most phones use some kind of nand flash, it is safe to assume that they use YAFFS.

But please note that if some vendor wants to sell a Android netbook (with a harddrive), they could use ext3 or something like that.

Johan
  • 20,067
  • 28
  • 92
  • 110
2

When analysing a Galaxy Ace 2.2 in a hex editor. The hex seemed to point to the device using FAT16 as its file system. I thought this unusual. However Fat 16 is compatible with the Linux kernel.

Michael
  • 21
  • 1
0

Similar to Linux:

  • /boot

  • /system

  • /recovery

  • /data

  • /cache

  • /misc

Bulat
  • 720
  • 7
  • 15
-2

Android supports all filesystems supported by the Linux kernel, except for a few ported ones like NTFS.

The SD card is formatted as ext3, for example.

Community
  • 1
  • 1
Peter vdL
  • 4,953
  • 10
  • 40
  • 60
  • 15
    No, the sd card is using a fat-based filesystem, else it wouldn't be mountable by Windows. Most sd cards are formatted as fat32, although you might stumble upon small sd cards (<1GB) that can get away with using fat16. – Robert Feb 26 '11 at 08:42
  • 1
    You're right Robert - sorry for the goof. – Peter vdL Feb 26 '11 at 23:40
  • You also didn't answer the question that was asked: "What is Android's file system?" The original poster wasn't asking what filesystems Android supports but what filesystem(s) it is installed on. – FlexMcMurphy Dec 27 '21 at 21:01