Mender blog

Converting a live device to a robust dual rootfs device

Have you ever wanted to robustly update a bunch of devices, but you can't because they're already in the field, and they are not configured for a robust dual root filesystem layout? Today, we are exploring converting live devices from stock single partition devices into robust dual partition devices.

There has been a thread Mender Hub about live migration of devices to the dual partition devices, but today we focus on a method that leverages Update Modules, which were not available when that post was written. Note that this is still highly experimental, and it has only been tested with Beaglebone Black so far. Still, the methods outlined are quite generic, and with adjustments it can be made to work on most boards.

The way it works is this. You start with a device that has a single root filesystem:

Device with single root filesystem

The problem is that you cannot make any changes to the partition table of a running system, much less to the partitions inside of it! So we need to get off the root filesystem somehow. What the module does is that it extracts a mini operating system on the device's RAM, and then switches over to running from there after shutting down all processes on the system. This gives it full access to the partition table and the raw partitions inside it:

Full access to partitions

From here we can make any modification we want, including moving, resizing and creating new partitions, which is exactly what we need. The Update Module proceeds by creating the standard Mender partition layout, and moving and resizing the existing partition to fit within it:

New partition layout

After this it switches off the root filesystem partition B, and then reboots the system. It should now be back in a state where it looks more or less exactly like before, except it now runs with a Mender partition layout:

Running new partition layout

This looks cool, but what about trying it yourself? As mentioned before, this has only been tested on Beaglebone Black, so you will need one of those if you expect things to work out of the box. Head over to the Dual Rootfs Partitioner Update Module on Mender Hub to find instructions!

If you want to experiment with your own board, then you may consider going directly to the Update Module repository to learn more about how it works internally.

Recent articles

An Overview of EU Cyber Resilience Act (CRA) Compliance

An Overview of EU Cyber Resilience Act (CRA) Compliance

Learn how the EU Cyber Resilience Act (CRA) enforces stringent cybersecurity requirements for PDEs. Explore compliance essentials in part 1 of 4
Mender versioning: New releases by component

Mender versioning: New releases by component

Explore Mender's shift to independent component releases and versioning, designed to enhance update speed and user clarity.
Driving secure innovation: ISO/SAE 21434 & UNECE compliance

Driving secure innovation: ISO/SAE 21434 & UNECE compliance

ISO/SAE 21434 and UNECE R155/R156 standards reshape cybersecurity in software-defined vehicles. Compliance with these frameworks is essential for protecting consumers, ensuring vehicle safety, and driving innovation in the automotive industry.
View more articles

Learn why leading companies choose Mender

Discover how Mender empowers both you and your customers with secure and reliable over-the-air updates for IoT devices. Focus on your product, and benefit from specialized OTA expertise and best practices.

 
sales-pipeline_295756365