A/B system updates, also called seamless updates, are an update scheme in which a device keeps two copies of its system partitions, labeled slot A and slot B, and writes a new operating system version to the inactive slot while the active one keeps running. In OS updates & maintenance, the approach turns a risky in-place overwrite into a simple slot switch at reboot, with an automatic fallback to the previous version if the new one fails to boot.
The design is best known from Android, where it became standard on many devices, but the same principle appears in ChromeOS, embedded Linux distributions, automotive control units and several immutable operating system designs. Its value lies less in speed than in recoverability: a failed or interrupted update should never leave the machine unbootable.
How A/B system updates switch between slots
An A/B system update works by duplicating the bootable partitions and letting the bootloader choose which copy to start. Partitions such as boot, system, vendor and the kernel image exist twice, with suffixes like _a and _b, while user data normally exists only once and is shared by both slots.
The update engine downloads a payload and streams it into the inactive slot in the background. When writing finishes, it verifies the result with cryptographic hashes, marks the new slot as bootable but not yet successful, and asks the bootloader to try it on the next start. The user experiences only an ordinary reboot instead of a long installation screen.
The following table summarizes the stages of a typical update cycle and the state of each slot during it.
| Stage | Active slot | Inactive slot | User impact |
|---|---|---|---|
| Download | Running normally | Unchanged | None |
| Install | Running normally | Receiving new image | Minor background load |
| Verification | Running normally | Hashes checked | None |
| Reboot | Marked as fallback | Marked as pending | One restart |
| Boot confirmation | Kept as backup | Marked successful | None |
Boot counters and automatic rollback
The safety of A/B updates depends on slot metadata stored in a small control area that the bootloader reads at every start. Each slot carries flags such as bootable, successful and a retry counter, typically set to a small value such as three to seven attempts.
On each attempt to start a pending slot, the bootloader decrements the retry counter. If the operating system reaches a healthy state, a userspace service marks the slot as successful and the counter stops mattering. If the counter reaches zero first, the bootloader marks the slot as unbootable and returns to the previous slot, which still contains the old, known-good system. This is the mechanism behind update rollback without user intervention.
Slot flags and their roles are shown below.
| Flag | Meaning | Set by |
|---|---|---|
| Bootable | Slot may be tried at startup | Update engine |
| Successful | Slot booted and passed health checks | Userspace service |
| Retry counter | Remaining start attempts before fallback | Update engine, then bootloader |
| Priority | Which bootable slot is tried first | Update engine |
Rollback covers failures that prevent the system from becoming healthy. It does not protect against subtle bugs that appear only after the slot has been marked successful, such as a faulty application or a performance regression discovered days later.
Variants: classic, virtual and delta-based layouts
Several A/B variants exist because the classic layout doubles storage for system partitions, which is costly on devices with small flash memory. Engineers therefore developed schemes that keep the reliability benefit while reducing the space penalty.
- Classic A/B reserves two full, fixed-size partition sets and offers the simplest, most predictable behavior.
- Virtual A/B keeps one physical copy and builds the second slot from copy-on-write snapshots, merging changes into the base after a successful boot.
- Delta payloads transmit only changed blocks, which reduces download size but requires the source slot to match the expected version exactly.
- Full payloads contain the whole image and work from any starting version, at the cost of larger downloads.
The comparison below shows how the main layouts balance storage, complexity and recovery.
| Layout | Extra storage | Rollback window | Complexity |
|---|---|---|---|
| Classic A/B | Full second copy | Until next update | Low |
| Virtual A/B | Snapshot space only | Until snapshot merge | High |
| Single-slot with recovery | Small recovery image | None for system | Low |
How A/B updates compare with other update methods
A/B updates differ from a traditional in-place upgrade because they never overwrite the running system. An in-place method replaces files while the old version is partially active or from a special recovery environment, so an interruption by power loss can leave the device in a broken intermediate state.
Compared with live patching, which modifies a running kernel without any reboot, A/B updates always require one restart but can replace the entire system image, including the bootloader-loaded kernel and vendor components. Compared with a full system image restore, they are automatic and preserve user data, while an image restore is a manual recovery tool.
| Method | Downtime | Failure recovery | Scope of change |
|---|---|---|---|
| A/B system updates | One reboot | Automatic slot fallback | Whole system image |
| In-place upgrade | Long install screen | Manual repair or reinstall | Files and packages |
| Live patching | None | Unload the patch | Selected kernel functions |
| Recovery-mode flashing | Device unusable during flash | Recovery image only | Whole system image |
Limitations and common mistakes
A/B updates reduce but do not remove update risk. The shared data partition is the most important weak point: if a new version migrates application databases or settings to a newer format, a rollback to the old slot may meet data it cannot read. Careful vendors keep data migrations backward compatible for at least one version.
- Assuming A/B replaces backups: the scheme protects the system, not personal files, so a separate system backup remains necessary.
- Ignoring storage cost: classic layouts consume space that could otherwise serve users.
- Weak health checks: if the success flag is set too early, a broken system is accepted and rollback no longer triggers.
- Mismatched delta payloads: modified system partitions, for example after manual rooting, cause delta installation to fail verification.
Security is another consideration. Because the old slot remains bootable, vendors pair A/B updates with anti-rollback protection in verified boot, so an attacker cannot deliberately return the device to an older version with known vulnerabilities.
A non-technical view
Imagine a house with two identical kitchens. While you keep cooking in one, workers quietly renovate the other. When they finish, you simply walk into the new kitchen. If the new oven does not work, you step back into the old kitchen, which is still exactly as you left it.
That is what A/B system updates do for a phone or computer. The new system is installed in a spare space while you keep working, and a quick restart moves you over. If the new version fails, the device returns to the old one by itself, so an update should never leave you with a device that will not start.
A concrete example
A company manages a fleet of 2,000 rugged Android tablets used by delivery drivers. The devices receive a monthly security update overnight while they charge. Each tablet downloads a delta payload of roughly 300 to 600 megabytes, writes it to the inactive slot during the evening, and verifies it before scheduling a restart for 3 a.m.
In one month, a vendor driver in the new build fails to initialize on an older hardware revision. About 150 tablets with that revision cannot complete startup. After three failed attempts, their bootloaders mark the new slot as unbootable and fall back to the previous version automatically. The drivers start their shifts with working devices, and the IT team pauses the rollout for that hardware group until a corrected build arrives. No tablet required a manual repair or a return to the depot.