I have an A/B system and would like to know if it is possible to modify partitions which are on the same disk as the root partition before an update.
For instance, the layout would be as follows:
$ lsblk -o NAME,PARTLABEL,SIZE,TYPE,MOUNTPOINTS
NAME PARTLABEL SIZE TYPE MOUNTPOINTS
nvme0n1 55.9G disk
|-nvme0n1p1 boot 32M part /mnt/boot
|-nvme0n1p2 root-a 4G part /
|-nvme0n1p3 root-b 4G part
`-nvme0n1p4 data 47.9G part /data
The active partition is "root-a".
With the next update, I would like to:
- wipe & split the "data" partition into two, e.g:
- "data-a": 32M
- "data-b": 32M
- write the new update image to "root-b"
In my sw-description I have described the new partitioning as follows:
partitions": {
"type": "diskpart",
"device": "/dev/nvme0n1",
"properties": {
"labeltype": "gpt",
"noinuse": "true",
"nolock": "true",
"partition-1": [
"size=32M",
"name=boot",
"start=2048",
"type=C12A7328-F81F-11D2-BA4B-00A0C93EC93B",
"fstype=vfat",
"flags=boot"
],
"partition-2": [
"size=4096M",
"name=root-a",
"start=67584",
"type=0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"fstype=ext4"
],
"partition-3": [
"size=4096M",
"name=root-b",
"start=8456192",
"type=0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"fstype=ext4"
],
"partition-4": [
"size=32M",
"name=data-a",
"start=16844800",
"type=0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"fstype=ext4",
"force=true"
],
"partition-5": [
"size=32M",
"name=data-b",
"start=16910336",
"type=0FC63DAF-8483-4772-8E79-3D69D8477DE4",
"fstype=ext4",
"force=true"
]
}
},
However, when running swupdate, I get this error:
[TRACE] : SWUPDATE running : [install_single_image] : Found installer for stream diskpart
[TRACE] : SWUPDATE running : [diskpart] : Force flag explicitly mentioned, value 1
[TRACE] : SWUPDATE running : [diskpart] : partition-5:data-b size 33554432 start 16910336 type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 partuuid automatic
[TRACE] : SWUPDATE running : [diskpart] : Force flag explicitly mentioned, value 1
[TRACE] : SWUPDATE running : [diskpart] : partition-4:data-a size 33554432 start 16844800 type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 partuuid automatic
[TRACE] : SWUPDATE running : [diskpart] : partition-3:root-b size 4294967296 start 8456192 type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 partuuid automatic
[TRACE] : SWUPDATE running : [diskpart] : partition-2:root-a size 4294967296 start 67584 type 0FC63DAF-8483-4772-8E79-3D69D8477DE4 partuuid automatic
[TRACE] : SWUPDATE running : [diskpart] : partition-1:boot size 33554432 start 2048 type C12A7328-F81F-11D2-BA4B-00A0C93EC93B partuuid automatic
[TRACE] : SWUPDATE running : [diskpart_table_cmp] : Number of partitions differs on disk: 4 <--> requested: 5
[TRACE] : SWUPDATE running : [diskpart_write_table] : Partitions on disk differ, write to disk;
[WARN ] : SWUPDATE running : [diskpart_blkdev_lock] : /dev/nvme0n1: device is in use, force set
[TRACE] : SWUPDATE running : [install_single_image] : Installer for diskpart not successful !
[ERROR] : SWUPDATE failed [1] Installation failed !
Obviously I don't want to modify the active root partition during the update.
But, regarding the change on the "data" partition, can I even modify it with swupdate, if it is on the same disk as my "active" rootfs?
How would one go about such a scenario?
Thanks & BR,
Christian
thanks for the explanation and the hint to get the exact sector numbers with "sfdisk -d /dev/nvme0n1".
I too think using a rescue system is definitely the safer option with fewer headaches; will do that :)
BR, Christian
________________________________________
From: Stefano Babic <stefan...@swupdate.org>
Sent: Tuesday, August 25, 2026 09:52
To: Christian Schaefer <christian...@at.abb.com>; swup...@googlegroups.com <swup...@googlegroups.com>
Subject: Re: [swupdate] Repartition partitions on "active" disk