Virtual A/B Partitions in Android Explained
In this article
Virtual A/B partitions in Android are a system update mechanism that enables seamless, background over-the-air (OTA) updates without requiring the device to reboot into recovery mode. Instead of updating the currently running system, Android uses two sets of system partitions—A and B—where only one is active at a time. With virtual A/B, the update is applied to the inactive partition while the user continues using the device normally. After the update completes, the next reboot switches to the updated partition, minimizing downtime and reducing the risk of a failed update leaving the device unbootable.
Background and Evolution of A/B Partitions
The concept of A/B partitioning was introduced in Android 7.0 Nougat as part of Project Treble, a major redesign aimed at simplifying and accelerating Android updates. Traditional OTA updates required downloading a full or differential update, then rebooting into recovery to apply it. During this process, the device was unusable for several minutes, and if the update failed, the device could become unbootable (a "bricked" state).
A/B partitioning solved this by duplicating critical system partitions—such as system, vendor, and boot—into two copies: slot A and slot B. Only one slot is active and booted at any time. When an update is available, it is downloaded and written to the inactive slot. Once verified, the device reboots into the updated slot. This method significantly improved update reliability and user experience.
How Virtual A/B Partitions Work
Virtual A/B is an evolution of the original A/B model, introduced in Android 11. Unlike traditional A/B, which requires full duplicate partitions, virtual A/B uses a combination of logical partitioning and copy-on-write (CoW) technology to save storage space. Instead of maintaining two full copies of the system partition, virtual A/B dynamically creates a virtual second partition using a snapshot mechanism.
Here’s how it works:
- An OTA update is downloaded to the device.
- A snapshot of the current system partition is created using the device-mapper snapshot feature in the Linux kernel.
- The update is applied to this snapshot (representing the inactive slot) in the background.
- The user continues using the device normally on the active partition.
- After the update is fully applied and verified, the device marks the updated slot as the new boot target.
- On reboot, the device boots into the updated system.
- If the update fails or the new system doesn’t boot, the device automatically rolls back to the previous slot.
This approach reduces the storage overhead of A/B updates by eliminating the need to reserve space for a full duplicate system partition.
Storage Efficiency and Device Compatibility
One of the main advantages of virtual A/B is its efficient use of storage. Traditional A/B requires roughly 10–15% more storage space to accommodate the second set of system partitions. On devices with limited storage (such as budget phones with 32 GB or less), this can be a significant constraint. Virtual A/B reduces this overhead by using thin provisioning—only the blocks that change during the update are stored in the snapshot.
Virtual A/B is supported on devices running Android 11 or later and requires:
- A Linux kernel with device-mapper snapshot support
- File-based encryption (FBE)
- Dynamic partitions (introduced in Android 10)
Because it relies on modern Android infrastructure, virtual A/B is primarily found on mid-range and flagship devices released from 2020 onward. It is not available on older devices or those running Android 10 or earlier.
Benefits Compared to Traditional OTA Updates
Virtual A/B offers several key improvements over legacy update methods:
- Faster reboots: The update is already applied before reboot, so the device starts up quickly with the new system.
- Rollback safety: Failed updates do not leave the device unbootable; the device can fall back to the previous system.
- User continuity: Users can continue using the device during the update process, rather than being locked out during installation.
- Reduced storage cost: Unlike full A/B, virtual A/B does not require double the system partition space.
These benefits make virtual A/B particularly valuable for enterprise devices, always-on services, and users who rely on uninterrupted device access.
Common Issues and Limitations
While virtual A/B improves reliability, it is not without challenges:
- Storage fragmentation: The snapshot mechanism can lead to storage inefficiencies over time, especially if updates are large or frequent.
- Kernel dependency: Devices must support device-mapper snapshots at the kernel level, which may not be present on all custom or older builds.
- Update verification delays: The system performs integrity checks after applying the update, which can delay the availability of the “reboot now” prompt.
- Rollback window: Android allows rollback only within a limited time after an update (typically until the new system has been booted successfully a few times).
If an update fails during the snapshot phase, the device will typically retry or cancel the update, preserving the current system. Users won’t lose data, but may need to manually retry the update later.
Alternatives to Virtual A/B
For devices that do not support virtual A/B, Android offers other update mechanisms:
- Legacy OTA (non-A/B): Downloads and applies updates in recovery mode. Requires downtime and carries a higher risk of failure.
- Traditional A/B: Uses full duplicate partitions. Available on Android 7.0+ but requires more storage.
- Google Play System Updates: For certain system components (like media codecs or security patches), Google delivers modular updates via the Play Store, independent of full OS updates.
Each method has trade-offs in speed, storage, and reliability. Virtual A/B represents the current best practice for full OS updates on modern Android devices.
Frequently Asked Questions
Is virtual A/B the same as regular A/B partitioning?
No. Regular A/B requires two full copies of system partitions, while virtual A/B uses a snapshot-based approach to simulate a second partition, saving storage space. Virtual A/B is more efficient and is used in Android 11 and later.
Do all Android phones use virtual A/B partitions?
No. Only devices running Android 11 or later with support for dynamic partitions and device-mapper snapshots can use virtual A/B. Many budget and older devices still use traditional OTA or full A/B updates.
Can I disable virtual A/B on my phone?
No, virtual A/B is a low-level system feature controlled by the device manufacturer and Android OS. It cannot be disabled or modified by users without root access, which is not recommended and may void warranties.
Does virtual A/B affect app data or personal files?
No. Virtual A/B only affects system partitions. User data, apps, and personal files are stored in separate partitions (like userdata) and are not impacted during updates.
Why does my phone still take time to update if virtual A/B works in the background?
While the update is applied in the background, the device still needs to verify the new system, generate rollback protection, and prepare for the switch. The final reboot also includes first-boot optimizations, which can take time.
Can a failed virtual A/B update brick my phone?
It is extremely unlikely. Virtual A/B is designed with rollback protection. If the new system fails to boot, the device automatically reverts to the previous slot, preserving functionality.