# A/B partitions

**URL:** <https://hub.mender.io/t/a-b-partitions/7983>\
**Category:** Debian family\
**Created:** [September 2, 2025, 8:02am UTC](https://hub.mender.io/t/a-b-partitions/7983 "2025-09-02T08:02:20Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![ethan](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@ethan](https://hub.mender.io/u/ethan)\
**Post date:** [September 2, 2025, 8:02am UTC](https://hub.mender.io/t/a-b-partitions/7983/1 "2025-09-02T08:02:20Z")

</div>

Hi Experts,

I have a question: For doing A/B partitions, do I have to combine kernelA.img + rootfsA.img into a single rootfsA, and combine kernelB.img + rootfsB.img into rootfsB? Or can I use separate partitions like kernelA, kernelB, rootfsA, rootfsB and still integrate them into the Mender update mechanism?

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [September 2, 2025, 9:04am UTC](https://hub.mender.io/t/a-b-partitions/7983/2 "2025-09-02T09:04:32Z")

</div>

Hi @ethan,

Thanks for reaching out! The standard approach is to have the kernel on the matching root filesystem, so thats what the bootloader scripts and update modules expect respectively handle out of the box.

However there’s nothing that keeps you from going a different route via customization. You’ll probably have to adjust the integration for your bootloader so it can handle two distinct partitions for kernel loading and passing as rootfs, and the `rootfs-image` update module to put the kernel into a different place as the filesystem. Not rocket science, but needs a bit of care.

The one thing which requires consideration is, how do you want kernel/rootfs partitions to be connected in terms of identification? Mender offers “just” A and B, so you need to define a way to derive the other partition. Like, A/B is the kernel partition, and the rootfs partition is +1 one. Example:

```auto
mmcblk0p1 = boot
mmcblk0p2 = kernel A
mmcblk0p3 = rootfs A
mmcblk0p4 = kernel B
mmcblk0p5 = rootfs B
mmcblk0p6 = data

```

The partition generation part of image creation obviously needs to be adjusted accordingly.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![ethan](https://avatars.discourse-cdn.com/v4/letter/e/8dc957/32.png) [@ethan](https://hub.mender.io/u/ethan)\
**Post date:** [September 2, 2025, 9:16am UTC](https://hub.mender.io/t/a-b-partitions/7983/3 "2025-09-02T09:16:30Z")

</div>

@TheYoctoJester

Thanks for clarifying! We are considering the customized approach with separate kernel and rootfs partitions. We will look into adjusting the bootloader integration and update module accordingly.

Do you have any best practices or examples for managing the mapping between kernel A/B and rootfs A/B in this setup?

---

<div class="post-metadata">

**Author:** ![Stan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/stan/32/2571_2.png) [@Stan](https://hub.mender.io/u/Stan)\
**Post date:** [October 9, 2025, 10:07am UTC](https://hub.mender.io/t/a-b-partitions/7983/4 "2025-10-09T10:07:20Z")

</div>

Hi,

I’m very interested to know if you succeeded and if so, how.

Have a nice day.

Stan

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [October 9, 2025, 12:56pm UTC](https://hub.mender.io/t/a-b-partitions/7983/5 "2025-10-09T12:56:26Z")

</div>

Hi @Ethan and @Stan,

Sorry this fell a bit behind.  
Concerning best practices, there are none so far. My personal approach would be to us the `kernel A` and `kernel B` partitions as the A and B partitions for the Mender configuration, as thats what the bootloader integration logic already knows about and can handle. It might need a little adjustment to be aware of kernel/fitImage/… loading instead of kernel+dtb+rootfs over cmdline, but certainly it’s not rocket science.  
The startup script inside this external startup filesystem then needs a bit of logic to identify the matching rootfs partition, like partition number + 1 or so, and act accordingly.  
If you have a proof of concept or early stage implementation somewhere visible, I’m also happy to review, test and possibly help with it.

Greetz,  
Josef

---

<div class="post-metadata">

**Author:** ![Stan](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/stan/32/2571_2.png) [@Stan](https://hub.mender.io/u/Stan)\
**Post date:** [October 9, 2025, 1:03pm UTC](https://hub.mender.io/t/a-b-partitions/7983/6 "2025-10-09T13:03:23Z")

</div>

I see, thank you for your response. I came across this GitHub repo today, which might be useful. I’m not sure yet how it works, and I’m getting compatibility errors during integration.

> **[GitHub - coreycothrum/meta-mender-kernel: mender with separate A/B kernel partitions](https://github.com/coreycothrum/meta-mender-kernel/)**
>
> mender with separate A/B kernel partitions

---

<div class="post-metadata">

**Author:** ![TheYoctoJester](https://yyz2.discourse-cdn.com/flex036/user_avatar/hub.mender.io/theyoctojester/32/1444_2.png) [@TheYoctoJester](https://hub.mender.io/u/TheYoctoJester)\
**Post date:** [October 9, 2025, 1:08pm UTC](https://hub.mender.io/t/a-b-partitions/7983/7 "2025-10-09T13:08:27Z")

</div>

Hi @Stan,

Yeah, I know the repository. However I never got it to actually build, so my suggestion is to take it with caution more as inspiration, unfortunately.

Greetz,  
Josef
