[systemd-devel] confusion with systemd-repart

Xogium contact at xogium.me
Thu May 30 12:59:50 UTC 2024


So, I use systemd-repart in an embedded system of mine. This system runs 
systemd 254.9 and is custom made using buildroot.

I am attempting to do the following:
* Create a second root-arm partition with SecondaryRootfs label of 128 
MB, and fill it with the content of the PrimaryRootfs partition.
* Add a partition of 200 MB, formatted with an ext4 filesystem, and 
create the directories needed for use with an overlayfs filesystem.

Here are my repart.d files:
01-root-arm.conf
[Partition]
Type=root-arm
CopyBlocks=/dev/mmcblk0p6
Label=SecondaryRootfs
SizeMinBytes=128M
SizeMaxBytes=128M

10-overlayfs.conf
[Partition]
FactoryReset=yes
Format=ext4
Label=overlayfs
MakeDirectories=/lower /upper /work
SizeMinBytes=200M
SizeMaxBytes=200M
Type=linux-generic

However, no matter what I try,, systemd-repart refuses to modify my 
disk. I even tried on the original disk image as well as the hardware 
itself, no go. All I am getting is this output, which I can't make sense 
of:
Starting Repartition Root Disk...
TYPE                                 LABEL               UUID                                 
FILE              NODE                 SIZE         PADDING
root-arm                             PrimaryRootfs       
db5635a9-a31f-4716-beed-086a7f0ae139 01-root-arm.conf  /dev/mmcblk0p6     
128.0M 357.9M → 357.9M
linux-generic                        fsbl1               
30ec351f-5967-4b0a-9138-b732a7a3410f 10-overlayfs.conf /dev/mmcblk0p1     
512.0K              0B
linux-generic                        fsbl2               
76bc9ab5-a80c-4db4-bbb5-9ee3456b1fe9                   /dev/mmcblk0p2     
512.0K              0B
linux-generic                        fip                 
bbc2fe82-1829-477a-b0bd-bccbc825b440                   /dev/mmcblk0p3       
2.0M              0B
linux-generic                        barebox-environment 
d5761c32-7c8d-4467-aa06-ccc31f024522                   /dev/mmcblk0p4       
2.0K              0B
4778ed65-bf42-45fa-9c5b-287a1dc4aab1 barebox-state       
4cb5e026-9bce-4ccc-af3a-66afd3642430                   /dev/mmcblk0p5       
1.0K              0B
                                                                                                                               Σ 
= 131.0M      Σ = 357.9M
 ▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒▒░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
 ├─ barebox-state
 ├─ barebox-environment
 ├─ fip
 ├─ fsbl2
 ├─ 10-overlayfs.conf
 └─ 01-root-arm.conf
No changes.
Finished Repartition Root Disk.

>From what I understand of this output, it matches my overlayfs.conf with 
the very first linux-generic partition it encounters, sees it is 512 KB 
and stops there. It also match my already present rootfs and would try 
to grow it instead of what I actually want it to do.

I'm using systemd-repart like so:
/usr/bin/systemd-repart --dry-run=no --root=/ 
--seed=a0a76bbf793051c3d4f2d24abe84676a /dev/mmcblk0

I've made an actual instantiated unit to target specifically mmcbkl0, as 
I run from the initramfs, before /sysroot is ever set up let alone 
mounted, as I am creating the required partition for doing so using 
repart.

So I guess my question here is, what am I dong wrong so that repart 
doesn't understand I want it to create those partition, not match on 
existing ones? Am I supposed to create file for PrimaryRootfs also, even 
if it does already exist, so that repart understand SecondaryRootfs has 
to be created? What, exactly, am I doing incorrectly, because I'm sure 
it is me not using the tool properly here, and no actual bug...

Thanks!


More information about the systemd-devel mailing list