• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!
  • Fill out your device list and let everyone know which phones you have!    Edit Your Device Inventory

Android partitions explained

Search This thread

BIG_BADASS

Senior Member
Jan 5, 2015
273
69
20
This is for those who are new to Android development and basically have NO understanding about the partition structure. I will give a high-level introductory explanation. PC GNU/Linux users: please note this is completely different from x86 (PC Linux) partition table. You will not come across partitions denoted as sda1, sda2, sdb1, sdb2, and so on. Instead, it will be structured as follows:

/boot

This is the partition that has all the data that is necessary for the phone to boot. It includes the kernel and the RAMDISK (these are the only components of the operating system that are stored in this partition. The remaining are stored in /System). Without this partition, the device will simply not be able to boot. Wiping this partition from recovery should only be done if absolutely required and once done, the device must NOT be rebooted before installing a new one, which can be done by installing a ROM that includes a /boot partition.

/system

This partition basically contains the entire operating system, except the kernel and the RAMDISK (as mentioned in /boot explanation). This includes the Android User Interface as well as all the system applications that come pre-installed on the device. Wiping this partition will remove Android from the device without rendering it unbootable, but you will still be able to boot into the /recovery partition to install a new ROM.

/recovery

The recovery partition can be considered as an alternative boot partition that lets you boot the device into a recovery console for performing advanced recovery and maintenance operations on it. Think of this like a proprietary recovery partition that PC companies put on prebuilt PCs. When you flash a custom recovery such as TWRP or CWM, you are overwriting this partition.

/data

Also called userdata, the data partition contains the user’s data – this is where your contacts, messages, settings and apps that you have installed go. Wiping this partition essentially performs a factory reset on your device, restoring it to the way it was when you first booted it, or the way it was after the last official or custom ROM installation. When you perform a wipe data/factory reset from recovery, it is this partition that you are wiping.

/cache

This is the partition where Android stores frequently accessed data and app components. Wiping the cache doesn’t effect your personal data but simply gets rid of the existing data there, which gets automatically rebuilt as you continue using the device.

/misc


This partition contains miscellaneous system settings in form of on/off switches. These settings may include CID (Carrier or Region ID), USB configuration and certain hardware settings etc. This is an important partition and if it is corrupt or missing, several of the device’s features will will not function normally.

/sdcard

This is not a partition on the internal memory of the device but rather the SD card. In terms of usage, this is your storage space to store your media, documents, downloads, pictures, videos, ROMs etc. on it. It is like the equivalent of the ' Users/[Username] ' folder in Windows and ' /home/~ ' folder in x86 Linux. Wiping it is perfectly safe as long as you backup all the data you require from it, to your computer first. Though several user-installed apps save their data and settings on the SD card and wiping this partition will make you lose all that data.

On devices with both an internal and an external SD card – devices like the Samsung Galaxy S and several tablets – the /sdcard partition is always used to refer to the internal SD card. For the external SD card – if present – an alternative partition is used, which differs from device to device. In case of Samsung Galaxy S series devices, it is /sdcard/sd while in many other devices, it is /sdcard2. Unlike /sdcard, no system or app data whatsoever is stored automatically on this external SD card and everything present on it has been added there by the user. You can safely wipe it after backing up any data from it that you need to save.

/sd-ext

This is not a standard Android partition, but has become popular in the custom ROM scene. It is basically an additional partition on your SD card that acts as the /data partition when used with certain ROMs that have special features called APP2SD+ or data2ext enabled. It is especially useful on devices with little internal memory allotted to the /data partition. Thus, users who want to install more programs than the internal memory allows can make this partition and use it with a custom ROM that supports this feature, to get additional storage for installing their apps. Wiping this partition is essentially the same as wiping the /data partition – you lose your contacts, SMS, market apps and settings.


/Boot (Is NOT viewable in Android)
/Recovery (Is NOT viewable in Android)
/Data (Userdata) (Is viewable in Android)
/Cache (Is viewable in Android)
/System (Is viewable in Android)
/Misc (Is NOT viewable in Android)
 
Last edited:

floast

Member
Aug 26, 2015
42
6
izmir
hello bro

bro ı need your help steadfasterX said me you can help me ı have unlocked h815 and my devıce says ıts ls911 and my imei is null what can ı do
 

net10441g

Member
Mar 28, 2020
21
0
a correction to your statement of /sdcard partition.

actually, starting in jellybean or lollipop, the /sdcard partition merged with /data, and has an emulated mount point of /storage/emulated/0 (hence the word "emulated")

apps and personal content(media etc) are all kept in /data , but the OS still restricts you to seeing just your personal(usb storage) content even though it's in the same "storage unit" as apps.
 
Last edited:

lorn10

Senior Member
Oct 31, 2015
108
26
Hello everyone

Really nice topic! However, the whole context is at the end somewhat more complex. As a litte demonstration here follows a nice little fdisk sample. That one belongs to an old Samsung Galaxy mini 2 S6500D phone. (It can be found at the corresponding postmarketOS webpage). Newer phones may have even more partitions. :)

Regards
lorn10

Code:
fdisk -l /dev/mmcblk0
omitting empty partition (25)
Disk /dev/mmcblk0: 3.7 GiB, 3909091328 bytes, 7634944 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x00000000

Device          Boot   Start     End Sectors  Size Id Type                 PIT name               read-writeable?
/dev/mmcblk0p1  *          1      40      40   20K 4d QNX4.x               CFG_DATA
/dev/mmcblk0p2            41     340     300  150K 45 unknown              QCSBL
/dev/mmcblk0p3           341   41300   40960   20M  c W95 FAT32 (LBA)      FAT                    RW
/dev/mmcblk0p4         41301 7634943 7593643  3.6G  5 Extended             ? / partition.bin
/dev/mmcblk0p5         49152   51151    2000 1000K 46 unknown              OEMSBL
/dev/mmcblk0p6         51152   53151    2000 1000K 47 unknown              APPSBL
/dev/mmcblk0p7         53152   57151    4000    2M 5d unknown              SSD                    RW
/dev/mmcblk0p8         57152   81727   24576   12M 48 unknown              APPS / boot partition  RW
/dev/mmcblk0p9         81728   87871    6144    3M 4a unknown              MODEM_ST1
/dev/mmcblk0p10        87872   94015    6144    3M 4b unknown              MODEM_ST2
/dev/mmcblk0p11        94016  110399   16384    8M 90 unknown              PERSIST                RW
/dev/mmcblk0p12       110400  134975   24576   12M 91 unknown              RECOVERY               RW
/dev/mmcblk0p13       134976  143167    8192    4M 92 unknown              PARAMETER              RW
/dev/mmcblk0p14       143168  151359    8192    4M 93 Amoeba               SECURE                 RW
/dev/mmcblk0p15       151360  152383    1024  512K 95 unknown              PIT                    RW
/dev/mmcblk0p16       152384 1176383 1024000  500M 82 Linux swap / Solaris SYSTEM                 RW
/dev/mmcblk0p17      1176384 1483583  307200  150M 94 Amoeba BBT           CACHE                  RW
/dev/mmcblk0p18      1483584 3396415 1912832  934M 83 Linux                USERDATA               RW
/dev/mmcblk0p19      3396416 3420991   24576   12M 65 Novell Netware 386   EFS
/dev/mmcblk0p20      3420992 3470143   49152   24M 9a unknown              IMG_BACKUP             RW
/dev/mmcblk0p21      3470144 3478335    8192    4M 63 GNU HURD or SysV     MISC                   RW
/dev/mmcblk0p22      3478336 3580735  102400   50M 67 unknown              HIDDEN                 RW
/dev/mmcblk0p23      3580736 7429803 3849068  1.9G 64 Novell Netware 286   UMS(user files)        RW
/dev/mmcblk0p24      7429804 7437995    8192    4M 58 unknown              MODEM_BKP              RW
 
Feb 3, 2021
41
0
I have a question, does the /data partition include any information about the ROM?
I'm asking since I want to know if I can downgrade without performing a factory reset.
(The reasson I want to downgrade is because I want to install a custom recovery.)
 
How is dm-verity used in android ?
Did you by chance do any type of searching before you just asked this here on XDA? I say this because that's what we are supposed to do first. And also because I know from searching myself there is ALOT of information on this around. I'm not trying to be a **** just saying, search. It takes a minute and you can and will learn alot. :)
 

Top Liked Posts

  • There are no posts matching your filters.
  • 31
    This is for those who are new to Android development and basically have NO understanding about the partition structure. I will give a high-level introductory explanation. PC GNU/Linux users: please note this is completely different from x86 (PC Linux) partition table. You will not come across partitions denoted as sda1, sda2, sdb1, sdb2, and so on. Instead, it will be structured as follows:

    /boot

    This is the partition that has all the data that is necessary for the phone to boot. It includes the kernel and the RAMDISK (these are the only components of the operating system that are stored in this partition. The remaining are stored in /System). Without this partition, the device will simply not be able to boot. Wiping this partition from recovery should only be done if absolutely required and once done, the device must NOT be rebooted before installing a new one, which can be done by installing a ROM that includes a /boot partition.

    /system

    This partition basically contains the entire operating system, except the kernel and the RAMDISK (as mentioned in /boot explanation). This includes the Android User Interface as well as all the system applications that come pre-installed on the device. Wiping this partition will remove Android from the device without rendering it unbootable, but you will still be able to boot into the /recovery partition to install a new ROM.

    /recovery

    The recovery partition can be considered as an alternative boot partition that lets you boot the device into a recovery console for performing advanced recovery and maintenance operations on it. Think of this like a proprietary recovery partition that PC companies put on prebuilt PCs. When you flash a custom recovery such as TWRP or CWM, you are overwriting this partition.

    /data

    Also called userdata, the data partition contains the user’s data – this is where your contacts, messages, settings and apps that you have installed go. Wiping this partition essentially performs a factory reset on your device, restoring it to the way it was when you first booted it, or the way it was after the last official or custom ROM installation. When you perform a wipe data/factory reset from recovery, it is this partition that you are wiping.

    /cache

    This is the partition where Android stores frequently accessed data and app components. Wiping the cache doesn’t effect your personal data but simply gets rid of the existing data there, which gets automatically rebuilt as you continue using the device.

    /misc


    This partition contains miscellaneous system settings in form of on/off switches. These settings may include CID (Carrier or Region ID), USB configuration and certain hardware settings etc. This is an important partition and if it is corrupt or missing, several of the device’s features will will not function normally.

    /sdcard

    This is not a partition on the internal memory of the device but rather the SD card. In terms of usage, this is your storage space to store your media, documents, downloads, pictures, videos, ROMs etc. on it. It is like the equivalent of the ' Users/[Username] ' folder in Windows and ' /home/~ ' folder in x86 Linux. Wiping it is perfectly safe as long as you backup all the data you require from it, to your computer first. Though several user-installed apps save their data and settings on the SD card and wiping this partition will make you lose all that data.

    On devices with both an internal and an external SD card – devices like the Samsung Galaxy S and several tablets – the /sdcard partition is always used to refer to the internal SD card. For the external SD card – if present – an alternative partition is used, which differs from device to device. In case of Samsung Galaxy S series devices, it is /sdcard/sd while in many other devices, it is /sdcard2. Unlike /sdcard, no system or app data whatsoever is stored automatically on this external SD card and everything present on it has been added there by the user. You can safely wipe it after backing up any data from it that you need to save.

    /sd-ext

    This is not a standard Android partition, but has become popular in the custom ROM scene. It is basically an additional partition on your SD card that acts as the /data partition when used with certain ROMs that have special features called APP2SD+ or data2ext enabled. It is especially useful on devices with little internal memory allotted to the /data partition. Thus, users who want to install more programs than the internal memory allows can make this partition and use it with a custom ROM that supports this feature, to get additional storage for installing their apps. Wiping this partition is essentially the same as wiping the /data partition – you lose your contacts, SMS, market apps and settings.


    /Boot (Is NOT viewable in Android)
    /Recovery (Is NOT viewable in Android)
    /Data (Userdata) (Is viewable in Android)
    /Cache (Is viewable in Android)
    /System (Is viewable in Android)
    /Misc (Is NOT viewable in Android)
    6
    The OP looks like it came from
    https://www.addictivetips.com/mobil...plained-boot-system-recovery-data-cache-misc/

    Almost word-for-word for some sections. That article is dated May 19, 2011.