]>
Commit | Line | Data |
---|---|---|
917cc808 LP |
1 | <?xml version='1.0'?> <!--*-nxml-*--> |
2 | <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN" | |
3 | "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"> | |
db9ecf05 | 4 | <!-- SPDX-License-Identifier: LGPL-2.1-or-later --> |
917cc808 | 5 | |
2d37ea5c | 6 | <refentry id="systemd-repart" conditional='ENABLE_REPART' |
917cc808 LP |
7 | xmlns:xi="http://www.w3.org/2001/XInclude"> |
8 | ||
9 | <refentryinfo> | |
10 | <title>systemd-repart</title> | |
11 | <productname>systemd</productname> | |
12 | </refentryinfo> | |
13 | ||
14 | <refmeta> | |
15 | <refentrytitle>systemd-repart</refentrytitle> | |
16 | <manvolnum>8</manvolnum> | |
17 | </refmeta> | |
18 | ||
19 | <refnamediv> | |
20 | <refname>systemd-repart</refname> | |
21 | <refname>systemd-repart.service</refname> | |
22 | <refpurpose>Automatically grow and add partitions</refpurpose> | |
23 | </refnamediv> | |
24 | ||
25 | <refsynopsisdiv> | |
26 | <cmdsynopsis> | |
27 | <command>systemd-repart</command> | |
28 | <arg choice="opt" rep="repeat">OPTIONS</arg> | |
29 | <arg choice="opt" rep="repeat"><replaceable><optional>BLOCKDEVICE</optional></replaceable></arg> | |
30 | </cmdsynopsis> | |
31 | ||
32 | <para><filename>systemd-repart.service</filename></para> | |
33 | </refsynopsisdiv> | |
34 | ||
35 | <refsect1> | |
36 | <title>Description</title> | |
37 | ||
38 | <para><command>systemd-repart</command> grows and adds partitions to a partition table, based on the | |
39 | configuration files described in | |
40 | <citerefentry><refentrytitle>repart.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>. | |
41 | </para> | |
42 | ||
252d6267 LP |
43 | <para>If invoked with no arguments, it operates on the block device backing the root file system |
44 | partition of the running OS, thus growing and adding partitions of the booted OS image itself. If | |
45 | <varname>--image=</varname> is used it will operate on the specified image file. When called in the | |
b66a6e1a ZJS |
46 | initrd it operates on the block device backing <filename>/sysroot/</filename> instead, i.e. on the block |
47 | device the system will soon transition into. The <filename>systemd-repart.service</filename> service is | |
48 | generally run at boot in the initrd, in order to augment the partition table of the OS before its | |
49 | partitions are mounted. <command>systemd-repart</command> (mostly) operates in a purely incremental mode: | |
50 | it only grows existing and adds new partitions; it does not shrink, delete or move existing partitions. | |
51 | The service is intended to be run on every boot, but when it detects that the partition table already | |
52 | matches the installed <filename>repart.d/*.conf</filename> configuration files, it executes no | |
53 | operation.</para> | |
917cc808 LP |
54 | |
55 | <para><command>systemd-repart</command> is intended to be used when deploying OS images, to automatically | |
56 | adjust them to the system they are running on, during first boot. This way the deployed image can be | |
57 | minimal in size and may be augmented automatically at boot when needed, taking possession of disk space | |
58 | available but not yet used. Specifically the following use cases are among those covered:</para> | |
59 | ||
60 | <itemizedlist> | |
e9dd6984 ZJS |
61 | <listitem><para>The root partition may be grown to cover the whole available disk space.</para></listitem> |
62 | <listitem><para>A <filename>/home/</filename>, swap or <filename>/srv/</filename> partition can be | |
63 | added.</para></listitem> | |
64 | <listitem><para>A second (or third, …) root partition may be added, to cover A/B style setups | |
917cc808 LP |
65 | where a second version of the root file system is alternatingly used for implementing update |
66 | schemes. The deployed image would carry only a single partition ("A") but on first boot a second | |
67 | partition ("B") for this purpose is automatically created.</para></listitem> | |
68 | </itemizedlist> | |
69 | ||
70 | <para>The algorithm executed by <command>systemd-repart</command> is roughly as follows:</para> | |
71 | ||
72 | <orderedlist> | |
73 | <listitem><para>The <filename>repart.d/*.conf</filename> configuration files are loaded and parsed, | |
ddf25931 RP |
74 | and ordered by filename (without the directory prefix). For each configuration file, |
75 | drop-in files are looked for in directories with same name as the configuration file | |
76 | with a suffix ".d" added.</para></listitem> | |
917cc808 LP |
77 | |
78 | <listitem><para>The partition table already existing on the block device is loaded and | |
79 | parsed.</para></listitem> | |
80 | ||
81 | <listitem><para>The existing partitions in the partition table are matched up with the | |
82 | <filename>repart.d/*.conf</filename> files by GPT partition type UUID. The first existing partition | |
83 | of a specific type is assigned the first configuration file declaring the same type. The second | |
84 | existing partition of a specific type is then assigned the second configuration file declaring the same | |
85 | type, and so on. After this iterative assigning is complete any left-over existing partitions that have | |
86 | no matching configuration file are considered "foreign" and left as they are. And any configuration | |
df738801 ZJS |
87 | files for which no partition currently exists are understood as a request to create such a partition. |
88 | </para></listitem> | |
89 | ||
90 | <listitem><para>Partitions that shall be created are now allocated on the disk, taking the size | |
91 | constraints and weights declared in the configuration files into account. Free space is used within the | |
92 | limits set by size and padding requests. In addition, existing partitions that should be grown are | |
93 | grown. New partitions are always appended to the end of the partition table, taking the first partition | |
94 | table slot whose index is greater than the indexes of all existing partitions. Partitions are never | |
95 | reordered and thus partition numbers remain stable. When partitions are created, they are placed in the | |
96 | smallest area of free space that is large enough to satisfy the size and padding limits. This means | |
24945c28 | 97 | that partitions might have different order on disk than in the partition table. Note that this |
b66a6e1a | 98 | allocation happens in memory only, the partition table on disk is not updated yet.</para></listitem> |
917cc808 LP |
99 | |
100 | <listitem><para>All existing partitions for which configuration files exist and which currently have no | |
101 | GPT partition label set will be assigned a label, either explicitly configured in the configuration or | |
b66a6e1a ZJS |
102 | — if that's missing — derived automatically from the partition type. The same is done for all |
103 | partitions that are newly created. These assignments are done in memory only, too, the disk is not | |
104 | updated yet.</para></listitem> | |
917cc808 LP |
105 | |
106 | <listitem><para>Similarly, all existing partitions for which configuration files exist and which | |
107 | currently have an all-zero identifying UUID will be assigned a new UUID. This UUID is cryptographically | |
108 | hashed from a common seed value together with the partition type UUID (and a counter in case multiple | |
109 | partitions of the same type are defined), see below. The same is done for all partitions that are | |
b66a6e1a ZJS |
110 | created anew. These assignments are done in memory only, too, the disk is not updated yet. |
111 | </para></listitem> | |
917cc808 LP |
112 | |
113 | <listitem><para>Similarly, if the disk's volume UUID is all zeroes it is also initialized, also | |
b66a6e1a ZJS |
114 | cryptographically hashed from the same common seed value. This is done in memory only too. |
115 | </para></listitem> | |
917cc808 | 116 | |
b66a6e1a ZJS |
117 | <listitem><para>The disk space assigned to new partitions (i.e. what was previously free space) is now |
118 | erased. Specifically, all file system signatures are removed, and if the device supports it, the | |
119 | <constant>BLKDISCARD</constant> I/O control command is issued to inform the hardware that the space is | |
120 | now empty. In addition any "padding" between partitions and at the end of the device is similarly | |
121 | erased.</para></listitem> | |
917cc808 LP |
122 | |
123 | <listitem><para>The new partition table is finally written to disk. The kernel is asked to reread the | |
124 | partition table.</para></listitem> | |
125 | </orderedlist> | |
126 | ||
127 | <para>As exception to the normally strictly incremental operation, when called in a special "factory | |
e9dd6984 | 128 | reset" mode, <command>systemd-repart</command> may also be used to erase existing partitions to |
917cc808 LP |
129 | reset an installation back to vendor defaults. This mode of operation is used when either the |
130 | <option>--factory-reset=yes</option> switch is passed on the tool's command line, or the | |
131 | <option>systemd.factory_reset=yes</option> option specified on the kernel command line, or the | |
132 | <varname>FactoryReset</varname> EFI variable (vendor UUID | |
133 | <constant>8cf2644b-4b0b-428f-9387-6d876050dc67</constant>) is set to "yes". It alters the algorithm above | |
e9dd6984 | 134 | slightly: between the 3rd and the 4th step above any partition marked explicitly via the |
917cc808 LP |
135 | <varname>FactoryReset=</varname> boolean is deleted, and the algorithm restarted, thus immediately |
136 | re-creating these partitions anew empty.</para> | |
137 | ||
e17076b9 LB |
138 | <para>Note that <command>systemd-repart</command> by default only changes partition tables, it does not |
139 | create or resize any file systems within these partitions, unless the <varname>Format=</varname> | |
140 | configuration option is specified. Also note that there are also separate mechanisms available for this | |
141 | purpose, for example | |
917cc808 LP |
142 | <citerefentry><refentrytitle>systemd-growfs</refentrytitle><manvolnum>8</manvolnum></citerefentry> and |
143 | <command>systemd-makefs</command>.</para> | |
144 | ||
145 | <para>The UUIDs identifying the new partitions created (or assigned to existing partitions that have no | |
146 | UUID yet), as well as the disk as a whole are hashed cryptographically from a common seed value. This | |
147 | seed value is usually the | |
148 | <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry> of the | |
149 | system, so that the machine ID reproducibly determines the UUIDs assigned to all partitions. If the | |
150 | machine ID cannot be read (or the user passes <option>--seed=random</option>, see below) the seed is | |
151 | generated randomly instead, so that the partition UUIDs are also effectively random. The seed value may | |
152 | also be set explicitly, formatted as UUID via the <option>--seed=</option> option. By hashing these UUIDs | |
153 | from a common seed images prepared with this tool become reproducible and the result of the algorithm | |
154 | above deterministic.</para> | |
96deebbc LP |
155 | |
156 | <para>The positional argument should specify the block device to operate on. Instead of a block device | |
157 | node path a regular file may be specified too, in which case the command operates on it like it would if | |
158 | a loopback block device node was specified with the file attached. If <option>--empty=create</option> is | |
159 | specified the specified path is created as regular file, which is useful for generating disk images from | |
160 | scratch.</para> | |
917cc808 LP |
161 | </refsect1> |
162 | ||
163 | <refsect1> | |
164 | <title>Options</title> | |
165 | ||
166 | <para>The following options are understood:</para> | |
167 | ||
168 | <variablelist> | |
169 | <varlistentry> | |
170 | <term><option>--dry-run=</option></term> | |
171 | <listitem><para>Takes a boolean. If this switch is not specified <option>--dry-run=yes</option> is | |
172 | the implied default. Controls whether <filename>systemd-repart</filename> executes the requested | |
173 | re-partition operations or whether it should only show what it would do. Unless | |
174 | <option>--dry-run=no</option> is specified <filename>systemd-repart</filename> will not actually | |
ec07c3c8 AK |
175 | touch the device's partition table.</para> |
176 | ||
177 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
917cc808 LP |
178 | </varlistentry> |
179 | ||
180 | <varlistentry> | |
181 | <term><option>--empty=</option></term> | |
182 | <listitem><para>Takes one of <literal>refuse</literal>, <literal>allow</literal>, | |
96deebbc LP |
183 | <literal>require</literal>, <literal>force</literal> or <literal>create</literal>. Controls how to |
184 | operate on block devices that are entirely empty, i.e. carry no partition table/disk label yet. If | |
185 | this switch is not specified the implied default is <literal>refuse</literal>.</para> | |
917cc808 LP |
186 | |
187 | <para>If <literal>refuse</literal> <command>systemd-repart</command> requires that the block device | |
188 | it shall operate on already carries a partition table and refuses operation if none is found. If | |
189 | <literal>allow</literal> the command will extend an existing partition table or create a new one if | |
190 | none exists. If <literal>require</literal> the command will create a new partition table if none | |
191 | exists so far, and refuse operation if one already exists. If <literal>force</literal> it will create | |
192 | a fresh partition table unconditionally, erasing the disk fully in effect. If | |
193 | <literal>force</literal> no existing partitions will be taken into account or survive the | |
96deebbc LP |
194 | operation. Hence: use with care, this is a great way to lose all your data. If |
195 | <literal>create</literal> a new loopback file is create under the path passed via the device node | |
ec07c3c8 AK |
196 | parameter, of the size indicated with <option>--size=</option>, see below.</para> |
197 | ||
198 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
917cc808 LP |
199 | </varlistentry> |
200 | ||
201 | <varlistentry> | |
202 | <term><option>--discard=</option></term> | |
203 | ||
204 | <listitem><para>Takes a boolean. If this switch is not specified <option>--discard=yes</option> is | |
205 | the implied default. Controls whether to issue the <constant>BLKDISCARD</constant> I/O control | |
206 | command on the space taken up by any added partitions or on the space in between them. Usually, it's | |
207 | a good idea to issue this request since it tells the underlying hardware that the covered blocks | |
96deebbc | 208 | shall be considered empty, improving performance. If operating on a regular file instead of a block |
ec07c3c8 AK |
209 | device node, a sparse file is generated.</para> |
210 | ||
211 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
96deebbc LP |
212 | </varlistentry> |
213 | ||
214 | <varlistentry> | |
215 | <term><option>--size=</option></term> | |
216 | ||
dfb4d0ae LP |
217 | <listitem><para>Takes a size in bytes, using the usual K, M, G, T suffixes, or the special value |
218 | <literal>auto</literal>. If used the specified device node path must refer to a regular file, which | |
219 | is then grown to the specified size if smaller, before any change is made to the partition table. If | |
220 | specified as <literal>auto</literal> the minimal size for the disk image is automatically determined | |
221 | (i.e. the minimal sizes of all partitions are summed up, taking space for additional metadata into | |
222 | account). This switch is not supported if the specified node is a block device. This switch has no | |
223 | effect if the file is already as large as the specified size or larger. The specified size is | |
224 | implicitly rounded up to multiples of 4096. When used with <option>--empty=create</option> this | |
225 | specifies the initial size of the loopback file to create.</para> | |
226 | ||
227 | <para>The <option>--size=auto</option> option takes the sizes of pre-existing partitions into | |
69e3234d | 228 | account. However, it does not accommodate for partition tables that are not tightly packed: the |
dfb4d0ae LP |
229 | configured partitions might still not fit into the backing device if empty space exists between |
230 | pre-existing partitions (or before the first partition) that cannot be fully filled by partitions to | |
231 | grow or create.</para> | |
232 | ||
233 | <para>Also note that the automatic size determination does not take files or directories specified | |
234 | with <option>CopyFiles=</option> into account: operation might fail if the specified files or | |
235 | directories require more disk space then the configured per-partition minimal size | |
ec07c3c8 AK |
236 | limit.</para> |
237 | ||
238 | <xi:include href="version-info.xml" xpointer="v246"/></listitem> | |
917cc808 LP |
239 | </varlistentry> |
240 | ||
241 | <varlistentry> | |
242 | <term><option>--factory-reset=</option></term> | |
243 | ||
244 | <listitem><para>Takes boolean. If this switch is not specified <option>--factory=reset=no</option> is | |
245 | the implied default. Controls whether to operate in "factory reset" mode, see above. If set to true | |
246 | this will remove all existing partitions marked with <varname>FactoryReset=</varname> set to yes | |
247 | early while executing the re-partitioning algorithm. Use with care, this is a great way to lose all | |
248 | your data. Note that partition files need to explicitly turn <varname>FactoryReset=</varname> on, as | |
249 | the option defaults to off. If no partitions are marked for factory reset this switch has no | |
250 | effect. Note that there are two other methods to request factory reset operation: via the kernel | |
ec07c3c8 AK |
251 | command line and via an EFI variable, see above.</para> |
252 | ||
253 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
917cc808 LP |
254 | </varlistentry> |
255 | ||
256 | <varlistentry> | |
257 | <term><option>--can-factory-reset</option></term> | |
258 | ||
259 | <listitem><para>If this switch is specified the disk is not re-partitioned. Instead it is determined | |
260 | if any existing partitions are marked with <varname>FactoryReset=</varname>. If there are the tool | |
261 | will exit with exit status zero, otherwise non-zero. This switch may be used to quickly determine | |
262 | whether the running system supports a factory reset mechanism built on | |
ec07c3c8 AK |
263 | <command>systemd-repart</command>.</para> |
264 | ||
265 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
917cc808 LP |
266 | </varlistentry> |
267 | ||
268 | <varlistentry> | |
269 | <term><option>--root=</option></term> | |
270 | ||
271 | <listitem><para>Takes a path to a directory to use as root file system when searching for | |
252d6267 LP |
272 | <filename>repart.d/*.conf</filename> files, for the machine ID file to use as seed and for the |
273 | <varname>CopyFiles=</varname> and <varname>CopyBlocks=</varname> source files and directories. By | |
274 | default when invoked on the regular system this defaults to the host's root file system | |
b66a6e1a ZJS |
275 | <filename>/</filename>. If invoked from the initrd this defaults to <filename>/sysroot/</filename>, |
276 | so that the tool operates on the configuration and machine ID stored in the root file system later | |
ec07c3c8 AK |
277 | transitioned into itself.</para> |
278 | ||
279 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
917cc808 LP |
280 | </varlistentry> |
281 | ||
252d6267 LP |
282 | <varlistentry> |
283 | <term><option>--image=</option></term> | |
284 | ||
285 | <listitem><para>Takes a path to a disk image file or device to mount and use in a similar fashion to | |
ec07c3c8 AK |
286 | <option>--root=</option>, see above.</para> |
287 | ||
288 | <xi:include href="version-info.xml" xpointer="v249"/></listitem> | |
252d6267 LP |
289 | </varlistentry> |
290 | ||
9ea81191 LP |
291 | <xi:include href="standard-options.xml" xpointer="image-policy-open" /> |
292 | ||
917cc808 LP |
293 | <varlistentry> |
294 | <term><option>--seed=</option></term> | |
295 | ||
296 | <listitem><para>Takes a UUID as argument or the special value <constant>random</constant>. If a UUID | |
297 | is specified the UUIDs to assign to partitions and the partition table itself are derived via | |
298 | cryptographic hashing from it. If not specified it is attempted to read the machine ID from the host | |
299 | (or more precisely, the root directory configured via <option>--root=</option>) and use it as seed | |
300 | instead, falling back to a randomized seed otherwise. Use <option>--seed=random</option> to force a | |
301 | randomized seed. Explicitly specifying the seed may be used to generated strictly reproducible | |
ec07c3c8 AK |
302 | partition tables.</para> |
303 | ||
304 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
917cc808 LP |
305 | </varlistentry> |
306 | ||
307 | <varlistentry> | |
308 | <term><option>--pretty=</option></term> | |
309 | ||
310 | <listitem><para>Takes a boolean argument. If this switch is not specified, it defaults to on when | |
311 | called from an interactive terminal and off otherwise. Controls whether to show a user friendly table | |
ec07c3c8 AK |
312 | and graphic illustrating the changes applied.</para> |
313 | ||
314 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
a015fbe7 TH |
315 | </varlistentry> |
316 | ||
917cc808 LP |
317 | <varlistentry> |
318 | <term><option>--definitions=</option></term> | |
319 | ||
e9dd6984 ZJS |
320 | <listitem><para>Takes a file system path. If specified the <filename>*.conf</filename> files are read |
321 | from the specified directory instead of searching in <filename>/usr/lib/repart.d/*.conf</filename>, | |
322 | <filename>/etc/repart.d/*.conf</filename>, | |
ea2aaff8 RP |
323 | <filename>/run/repart.d/*.conf</filename>.</para> |
324 | ||
ec07c3c8 AK |
325 | <para>This parameter can be specified multiple times.</para> |
326 | ||
327 | <xi:include href="version-info.xml" xpointer="v245"/></listitem> | |
917cc808 LP |
328 | </varlistentry> |
329 | ||
dfb4d0ae LP |
330 | <varlistentry> |
331 | <term><option>--key-file=</option></term> | |
332 | ||
333 | <listitem><para>Takes a file system path. Configures the encryption key to use when setting up LUKS2 | |
cf1e172d LP |
334 | volumes configured with the <varname>Encrypt=key-file</varname> setting in partition files. Should |
335 | refer to a regular file containing the key, or an <constant>AF_UNIX</constant> stream socket in the | |
336 | file system. In the latter case a connection is made to it and the key read from it. If this switch | |
337 | is not specified the empty key (i.e. zero length key) is used. This behaviour is useful for setting | |
338 | up encrypted partitions during early first boot that receive their user-supplied password only in a | |
ec07c3c8 AK |
339 | later setup step.</para> |
340 | ||
341 | <xi:include href="version-info.xml" xpointer="v247"/></listitem> | |
cf1e172d | 342 | </varlistentry> |
ba4a5eff P |
343 | |
344 | <varlistentry> | |
345 | <term><option>--private-key=</option></term> | |
346 | ||
347 | <listitem><para>Takes a file system path. Configures the signing key to use when creating verity | |
348 | signature partitions with the <varname>Verity=signature</varname> setting in partition files. | |
ec07c3c8 AK |
349 | </para> |
350 | ||
351 | <xi:include href="version-info.xml" xpointer="v252"/></listitem> | |
ba4a5eff P |
352 | </varlistentry> |
353 | ||
354 | <varlistentry> | |
355 | <term><option>--certificate=</option></term> | |
356 | ||
357 | <listitem><para>Takes a file system path. Configures the PEM encoded X.509 certificate to use when | |
358 | creating verity signature partitions with the <varname>Verity=signature</varname> setting in | |
ec07c3c8 AK |
359 | partition files.</para> |
360 | ||
361 | <xi:include href="version-info.xml" xpointer="v252"/></listitem> | |
ba4a5eff | 362 | </varlistentry> |
cf1e172d LP |
363 | |
364 | <varlistentry> | |
365 | <term><option>--tpm2-device=</option></term> | |
366 | <term><option>--tpm2-pcrs=</option></term> | |
367 | ||
368 | <listitem><para>Configures the TPM2 device and list of PCRs to use for LUKS2 volumes configured with | |
369 | the <varname>Encrypt=tpm2</varname> option. These options take the same parameters as the identically | |
370 | named options to | |
371 | <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
ec07c3c8 AK |
372 | and have the same effect on partitions where TPM2 enrollment is requested.</para> |
373 | ||
374 | <xi:include href="version-info.xml" xpointer="v248"/></listitem> | |
dfb4d0ae | 375 | </varlistentry> |
02ef97cd LP |
376 | |
377 | <varlistentry> | |
378 | <term><option>--tpm2-public-key=</option><arg>PATH</arg></term> | |
379 | <term><option>--tpm2-public-key-pcrs=</option><arg rep="repeat">PCR</arg></term> | |
380 | ||
381 | <listitem><para>Configures a TPM2 signed PCR policy to bind encryption to. See | |
382 | <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
ec07c3c8 AK |
383 | for details on these two options.</para> |
384 | ||
385 | <xi:include href="version-info.xml" xpointer="v252"/></listitem> | |
02ef97cd | 386 | </varlistentry> |
4cee8333 DDM |
387 | |
388 | <varlistentry> | |
389 | <term><option>--split=</option><arg>BOOL</arg></term> | |
390 | ||
391 | <listitem><para>Enables generation of split artifacts from partitions configured with | |
392 | <varname>SplitName=</varname>. If enabled, for each partition with <varname>SplitName=</varname> set, | |
393 | a separate output file containing just the contents of that partition is generated. The output | |
394 | filename consists of the loopback filename suffixed with the name configured with | |
395 | <varname>SplitName=</varname>. If the loopback filename ends with <literal>.raw</literal>, the suffix | |
396 | is inserted before the <literal>.raw</literal> extension instead.</para> | |
397 | ||
398 | <para>Note that <option>--split</option> is independent from <option>--dry-run</option>. Even if | |
399 | <option>--dry-run</option> is enabled, split artifacts will still be generated from an existing image | |
ec07c3c8 AK |
400 | if <option>--split</option> is enabled.</para> |
401 | ||
402 | <xi:include href="version-info.xml" xpointer="v252"/></listitem> | |
4cee8333 | 403 | </varlistentry> |
81d1098b DDM |
404 | |
405 | <varlistentry> | |
406 | <term><option>--include-partitions=</option><arg rep="repeat">PARTITION</arg></term> | |
407 | <term><option>--exclude-partitions=</option><arg rep="repeat">PARTITION</arg></term> | |
408 | ||
409 | <listitem><para>These options specify which partition types <command>systemd-repart</command> should | |
410 | operate on. If <option>--include-partitions=</option> is used, all partitions that aren't specified | |
411 | are excluded. If <option>--exclude-partitions=</option> is used, all partitions that are specified | |
412 | are excluded. Both options take a comma separated list of GPT partition type UUIDs or identifiers | |
413 | (see <varname>Type=</varname> in | |
7d505753 | 414 | <citerefentry><refentrytitle>repart.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>). |
ec07c3c8 AK |
415 | </para> |
416 | ||
417 | <xi:include href="version-info.xml" xpointer="v253"/></listitem> | |
7d505753 DDM |
418 | </varlistentry> |
419 | ||
420 | <varlistentry> | |
8275334b | 421 | <term><option>--defer-partitions=</option><arg rep="repeat">PARTITION</arg></term> |
7d505753 | 422 | |
84a4d23f DDM |
423 | <listitem><para>This option specifies for which partition types <command>systemd-repart</command> |
424 | should defer. All partitions that are deferred using this option are still taken into account when | |
425 | calculating the sizes and offsets of other partitions, but aren't actually written to the disk image. | |
8fb35004 ZJS |
426 | The net effect of this option is that if you run <command>systemd-repart</command> again without this |
427 | option, the missing partitions will be added as if they had not been deferred the first time | |
ec07c3c8 AK |
428 | <command>systemd-repart</command> was executed.</para> |
429 | ||
430 | <xi:include href="version-info.xml" xpointer="v253"/></listitem> | |
81d1098b | 431 | </varlistentry> |
e1878ef7 DDM |
432 | |
433 | <varlistentry> | |
434 | <term><option>--sector-size=</option><arg>BYTES</arg></term> | |
435 | ||
436 | <listitem><para>This option allows configuring the sector size of the image produced by | |
437 | <command>systemd-repart</command>. It takes a value that is a power of <literal>2</literal> between | |
438 | <literal>512</literal> and <literal>4096</literal>. This option is useful when building images for | |
ec07c3c8 AK |
439 | disks that use a different sector size as the disk on which the image is produced.</para> |
440 | ||
441 | <xi:include href="version-info.xml" xpointer="v253"/></listitem> | |
e1878ef7 | 442 | </varlistentry> |
9786dfe6 DDM |
443 | |
444 | <varlistentry> | |
445 | <term><option>--architecture=</option><arg>ARCH</arg></term> | |
446 | ||
447 | <listitem><para>This option allows overriding the architecture used for architecture specific | |
448 | partition types. For example, if set to <literal>arm64</literal> a partition type of | |
449 | <literal>root-x86-64</literal> referenced in <filename>repart.d/</filename> drop-ins will be patched | |
450 | dynamically to refer to <literal>root-arm64</literal> instead. Takes one of | |
451 | <literal>alpha</literal>, | |
452 | <literal>arc</literal>, | |
453 | <literal>arm</literal>, | |
454 | <literal>arm64</literal>, | |
455 | <literal>ia64</literal>, | |
456 | <literal>loongarch64</literal>, | |
457 | <literal>mips-le</literal>, | |
458 | <literal>mips64-le</literal>, | |
459 | <literal>parisc</literal>, | |
460 | <literal>ppc</literal>, | |
461 | <literal>ppc64</literal>, | |
462 | <literal>ppc64-le</literal>, | |
463 | <literal>riscv32</literal>, | |
464 | <literal>riscv64</literal>, | |
465 | <literal>s390</literal>, | |
466 | <literal>s390x</literal>, | |
467 | <literal>tilegx</literal>, | |
468 | <literal>x86</literal> or | |
ec07c3c8 AK |
469 | <literal>x86-64</literal>.</para> |
470 | ||
471 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
9786dfe6 | 472 | </varlistentry> |
fc10b158 DDM |
473 | |
474 | <varlistentry> | |
475 | <term><option>--offline=</option><arg>BOOL</arg></term> | |
476 | ||
477 | <listitem><para>Instructs <command>systemd-repart</command> to build the image offline. Takes a | |
478 | boolean or <literal>auto</literal>. Defaults to <literal>auto</literal>. If enabled, the image is | |
479 | built without using loop devices. This is useful to build images unprivileged or when loop devices | |
480 | are not available. If disabled, the image is always built using loop devices. If | |
481 | <literal>auto</literal>, <command>systemd-repart</command> will build the image online if possible | |
482 | and fall back to building the image offline if loop devices are not available or cannot be accessed | |
ec07c3c8 AK |
483 | due to missing permissions.</para> |
484 | ||
485 | <xi:include href="version-info.xml" xpointer="v254"/></listitem> | |
fc10b158 | 486 | </varlistentry> |
1e46985a DDM |
487 | |
488 | <varlistentry> | |
489 | <term><option>--copy-from=</option><arg>IMAGE</arg></term> | |
490 | ||
39b4649f | 491 | <listitem><para>Instructs <command>systemd-repart</command> to synthesize partition definitions from |
e1536d1f DDM |
492 | the partition table in the given image. This option can be specified multiple times to synthesize |
493 | definitions from each of the given images. The generated definitions will copy the partitions into | |
494 | the destination partition table. The copied partitions will have the same size, metadata and contents | |
495 | but might have a different partition number and might be located at a different offset in the | |
496 | destination partition table. These definitions can be combined with partition definitions read from | |
497 | regular partition definition files. The synthesized definitions take precedence over the definitions | |
ec07c3c8 AK |
498 | read from partition definition files.</para> |
499 | ||
500 | <xi:include href="version-info.xml" xpointer="v255"/></listitem> | |
1e46985a | 501 | </varlistentry> |
dfb4d0ae | 502 | |
917cc808 LP |
503 | <xi:include href="standard-options.xml" xpointer="help" /> |
504 | <xi:include href="standard-options.xml" xpointer="version" /> | |
896e678b LP |
505 | <xi:include href="standard-options.xml" xpointer="no-pager" /> |
506 | <xi:include href="standard-options.xml" xpointer="no-legend" /> | |
8d0d1a30 | 507 | <xi:include href="standard-options.xml" xpointer="json" /> |
917cc808 LP |
508 | </variablelist> |
509 | </refsect1> | |
510 | ||
cf1e172d LP |
511 | <refsect1> |
512 | <title>Exit status</title> | |
513 | ||
514 | <para>On success, 0 is returned, a non-zero failure code otherwise.</para> | |
515 | </refsect1> | |
516 | ||
917cc808 LP |
517 | <refsect1> |
518 | <title>See Also</title> | |
519 | <para> | |
520 | <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>, | |
521 | <citerefentry><refentrytitle>repart.d</refentrytitle><manvolnum>5</manvolnum></citerefentry>, | |
cf1e172d LP |
522 | <citerefentry><refentrytitle>machine-id</refentrytitle><manvolnum>5</manvolnum></citerefentry>, |
523 | <citerefentry><refentrytitle>systemd-cryptenroll</refentrytitle><manvolnum>1</manvolnum></citerefentry> | |
917cc808 LP |
524 | </para> |
525 | </refsect1> | |
526 | ||
527 | </refentry> |