Skip to content

[Reference] data partition layout

Michael Zimmermann edited this page Aug 21, 2016 · 4 revisions

Note: I'm not using the /data prefix anywhere to make the text easier to read.

There are different layout versions. The version used is stored in /.layout_version

  • 0: user data is stored in /media directly, all users have access to it
  • 1: every user has it's own data in /media/<user_id>. OBB data is stored in /media/0/Android/obb
  • 2/API17: like 1 but with OBB data being stored in /media/obb
  • 3/API20: like 2 but with cacerts being stored in /misc/user/<user_id>

migration

0 -> 1

  • move /media to /media.tmp
  • create /media
  • move /media.tmp to /media/0
  • create /media/<user_id> for all existing users

if the process gets aborted you'll have a empty /media/0 directory but you'll still have /media.tmp which you can manually backup/move.

1 -> 2

  • move /media/0/Android/obb to /media/obb

if the process gets aborted you'll have the old,unused OBB data in /media/0/Android/obb while /media/obb has already been created.

2 -> 3

  • for all existing users:
    • create /misc/user/<user_id>
    • copy /keychain/cacerts-added to /misc/user/<user_id>/cacerts-added
    • copy /keychain/cacerts-removed /misc/user/<user_id>/cacerts-removed
  • delete /keychain/cacerts-added
  • delete /keychain/cacerts-removed