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

How over-the-air (OTA) updates help emergency response teams

How over-the-air (OTA) updates help emergency response teams

There’s no getting around it—we live in a connected world where almost every industry is dependent on the Internet of Things (IoT).
What’s hot in the open source and embedded community?

What’s hot in the open source and embedded community?

AI, robotics, IoT, AVs, and more – 2024 is proving to be an exciting year for technology. And the open source and embedded tech community is no exception.
How to use over-the-air (OTA) updates & NVIDIA Jetson Microservices

How to leverage over-the-air (OTA) updates with NVIDIA Microservices for Jetson

Mender, in collaboration with NVIDIA, published two critical use cases, providing a step-by-step guide to over-the-air (OTA) updates with NVIDIA Jetson.
View more articles

Learn more about Mender

Explore our Resource Center to discover more about how Mender empowers both you and your customers with secure and reliable over-the-air updates for IoT devices.

 
sales-pipeline_295756365