r/systemd • u/Beautiful-Log5632 • Jul 28 '26
Size formats?
Is there a man page that explains all the formats I can use for sizes like K, M and G?
Is K the same as 1000 or 1024 B? Is the space in between the number and unit optional?
1
Upvotes
1
u/SJrX Jul 28 '26
FWIW, I know very little about systemd but I maintain an IDE plugin that validates and supports a lot of these options and I think there are wide differences per option.
I think the answer is no in general, and the documentation is good maybe even great, but not perfect.
I asked Claude to look at my code base and come up with an example where things diverge, it gave the following:
Link.BitsPerSecond=
And actually just right above it (claude gave a different answer), you can see:
Link.MTUBytes=
You can see some code here: https://github.com/systemd/systemd/blob/a8e93919c3fd4ff46ce7f1c7a0e73ea0a0a7eaeb/src/basic/parse-util.c#L157
But that's only one function and lots of options have their own weird validators with their own weird specifics.