h1. DataPartition {{toc}} h2. /!\ Warning: Draft This article is in draft form and is being written: * Everybody is welcome to contribute * Some things might not be accurate yet, so beware before using the information contained in it. h2. What does the data partition contains? It probably depends on the devices and the Android versions. On Replicant 6.0, it contains at least the application internal data: When various applications are installed, they have access to some storage where they can read and write data that is only visible to them and not to other applications. This is part of the [[ApplicationsSecurityModel|Android security model]] that doesn't trust applications even if they are fully free software. This has serious usability consequences for users as it makes backuping and restoring the application data way more complicated than it should be. In addition, on some devices it also contains the users data. This location and external microSD cards is where users typically their files like Music, photos, etc. This data is made accessible to the users in various location through a mechanism called fuse. In Replicant 6, this data is stored in the media directory in the data partition. Unlike application data, this data is not tied to any Android version or application signatures, so it can be moved, backuped, restored relatively easily across different devices and operating systems. It uses a similar file permission system than with GNU/Linux (unix DAC + Selinux). Summarry: | Mount points | Content | | /data/ | Applications (internal) data | | /sdcard /storage/ | User accessible storage to store music, photos, etc | Here's where the sdcard user accessible storage comes from: /sdcard -> /storage/self/primary [1] /storage/self/primary -> /mnt/user/0/primary [2] /mnt/user/0/primary -> /storage/emulated/0 [3] fn1.
root@i9300:/ # readlink /sdcard                                                                                                                            
/mnt/user/0/primary
fn2.
root@i9300:/ # readlink /storage/self/primary                                                                                                              
/mnt/user/0/primary
fn3.
root@i9300:/ # readlink /mnt/user/0/primary                                                                                                                  
/storage/emulated/0
fn4.
root@i9300:/ # mount | grep "/storage/emulated"                                                                                                              
/dev/fuse on /storage/emulated type fuse (rw,nosuid,nodev,noexec,noatime,user_id=1023,group_id=1023,default_permissions,allow_other)
TODO: * Explain that the user accessible storage is not always present * Explain that it depends on the devices (GTA04) h2. Concerns about the application internal data TODO: * Explain the issue about the Replicant version <-> application data