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:

bc2797dee8ecf44ef7a81d5ec41149f49e80edc3-dual-rootfs-repartition-blog-post-2-3@770-430

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:

7ff678deb13331ca8b08e75737e42e457d8cbc68-dual-rootfs-repartition-blog-post-3-3@770-430

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:

7b234637fc313069f13768cdc8971cfa875c2dc5-dual-rootfs-repartition-blog-post-4-3@770-430

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

Managing software updates for the complete software-defined product

Managing software updates for the complete software-defined product

Explore the complexities of managing software updates for connected products, emphasizing the need for advanced strategies in today's diverse IoT landscape.
New in Mender: Significantly smaller delta updates, now for containers too

New in Mender: Significantly smaller delta updates, now for containers too

Discover Mender Client 6.1.0, featuring smaller delta updates for containers, multi-tenant flexibility, and optimized networking for improved IoT device management.
Building AI for the physical world:

Building AI for the physical world:

Discover how to effectively manage edge AI deployment with robust lifecycle strategies, ensuring safety and compliance in the physical world of IoT.
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