Debian Codegraph @

upstream/debian-trixie/man1/systemd-dissect.1

raw
1 '\" t
2 .TH "SYSTEMD\-DISSECT" "1" "" "systemd 257.13" "systemd-dissect"
3 .\" -----------------------------------------------------------------
4 .\" * Define some portability stuff
5 .\" -----------------------------------------------------------------
6 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 .\" http://bugs.debian.org/507673
8 .\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
9 .\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
10 .ie \n(.g .ds Aq \(aq
11 .el .ds Aq '
12 .\" -----------------------------------------------------------------
13 .\" * set default formatting
14 .\" -----------------------------------------------------------------
15 .\" disable hyphenation
16 .nh
17 .\" disable justification (adjust text to left margin only)
18 .ad l
19 .\" -----------------------------------------------------------------
20 .\" * MAIN CONTENT STARTS HERE *
21 .\" -----------------------------------------------------------------
22 .SH "NAME"
23 systemd-dissect, mount.ddi \- Dissect Discoverable Disk Images (DDIs)
24 .SH "SYNOPSIS"
25 .HP \w'\fBsystemd\-dissect\fR\ 'u
26 \fBsystemd\-dissect\fR [OPTIONS...] \fIIMAGE\fR
27 .HP \w'\fBsystemd\-dissect\fR\ 'u
28 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-mount] \fIIMAGE\fR \fIPATH\fR
29 .HP \w'\fBsystemd\-dissect\fR\ 'u
30 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-umount] \fIPATH\fR
31 .HP \w'\fBsystemd\-dissect\fR\ 'u
32 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-attach] \fIIMAGE\fR
33 .HP \w'\fBsystemd\-dissect\fR\ 'u
34 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-detach] \fIPATH\fR
35 .HP \w'\fBsystemd\-dissect\fR\ 'u
36 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-list] \fIIMAGE\fR
37 .HP \w'\fBsystemd\-dissect\fR\ 'u
38 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-mtree] \fIIMAGE\fR
39 .HP \w'\fBsystemd\-dissect\fR\ 'u
40 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-with] \fIIMAGE\fR [\fICOMMAND\fR...]
41 .HP \w'\fBsystemd\-dissect\fR\ 'u
42 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-copy\-from] \fIIMAGE\fR \fIPATH\fR [\fITARGET\fR]
43 .HP \w'\fBsystemd\-dissect\fR\ 'u
44 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-copy\-to] \fIIMAGE\fR [\fISOURCE\fR] \fIPATH\fR
45 .HP \w'\fBsystemd\-dissect\fR\ 'u
46 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-make\-archive] \fIIMAGE\fR [\fITARGET\fR]
47 .HP \w'\fBsystemd\-dissect\fR\ 'u
48 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-discover]
49 .HP \w'\fBsystemd\-dissect\fR\ 'u
50 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-validate] \fIIMAGE\fR
51 .SH "DESCRIPTION"
52 .PP
53 \fBsystemd\-dissect\fR
54 is a tool for introspecting and interacting with file system OS disk images, specifically Discoverable Disk Images (DDIs)\&. It supports four different operations:
55 .sp
56 .RS 4
57 .ie n \{\
58 \h'-04' 1.\h'+01'\c
59 .\}
60 .el \{\
61 .sp -1
62 .IP " 1." 4.2
63 .\}
64 Show general OS image information, including the image\*(Aqs
65 \fBos-release\fR(5)
66 data, machine ID, partition information and more\&.
67 .RE
68 .sp
69 .RS 4
70 .ie n \{\
71 \h'-04' 2.\h'+01'\c
72 .\}
73 .el \{\
74 .sp -1
75 .IP " 2." 4.2
76 .\}
77 Mount an OS image to a local directory\&. In this mode it will dissect the OS image and mount the included partitions according to their designation onto a directory and possibly sub\-directories\&.
78 .RE
79 .sp
80 .RS 4
81 .ie n \{\
82 \h'-04' 3.\h'+01'\c
83 .\}
84 .el \{\
85 .sp -1
86 .IP " 3." 4.2
87 .\}
88 Unmount an OS image from a local directory\&. In this mode it will recursively unmount the mounted partitions and remove the underlying loop device, including all the partition sub\-devices\&.
89 .RE
90 .sp
91 .RS 4
92 .ie n \{\
93 \h'-04' 4.\h'+01'\c
94 .\}
95 .el \{\
96 .sp -1
97 .IP " 4." 4.2
98 .\}
99 Copy files and directories in and out of an OS image\&.
100 .RE
101 .PP
102 The tool may operate on three types of OS images:
103 .sp
104 .RS 4
105 .ie n \{\
106 \h'-04' 1.\h'+01'\c
107 .\}
108 .el \{\
109 .sp -1
110 .IP " 1." 4.2
111 .\}
112 OS disk images containing a GPT partition table envelope, with partitions marked according to the
113 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
114 .RE
115 .sp
116 .RS 4
117 .ie n \{\
118 \h'-04' 2.\h'+01'\c
119 .\}
120 .el \{\
121 .sp -1
122 .IP " 2." 4.2
123 .\}
124 OS disk images containing just a plain file\-system without an enveloping partition table\&. (This file system is assumed to be the root file system of the OS\&.)
125 .RE
126 .sp
127 .RS 4
128 .ie n \{\
129 \h'-04' 3.\h'+01'\c
130 .\}
131 .el \{\
132 .sp -1
133 .IP " 3." 4.2
134 .\}
135 OS disk images containing a GPT or MBR partition table, with a single partition only\&. (This partition is assumed to contain the root file system of the OS\&.)
136 .RE
137 .PP
138 OS images may use any kind of Linux\-supported file systems\&. In addition they may make use of LUKS disk encryption, and contain Verity integrity information\&. Note that qualifying OS images may be booted with
139 \fBsystemd-nspawn\fR(1)\*(Aqs
140 \fB\-\-image=\fR
141 switch, and be used as root file system for system service using the
142 \fIRootImage=\fR
143 unit file setting, see
144 \fBsystemd.exec\fR(5)\&.
145 .PP
146 Note that the partition table shown when invoked without command switch (as listed below) does not necessarily show all partitions included in the image, but just the partitions that are understood and considered part of an OS disk image\&. Specifically, partitions of unknown types are ignored, as well as duplicate partitions (i\&.e\&. more than one per partition type), as are root and
147 /usr/
148 partitions of architectures not compatible with the local system\&. In other words: this tool will display what it operates with when mounting the image\&. To display the complete list of partitions use a tool such as
149 \fBfdisk\fR(8)\&.
150 .PP
151 The
152 \fBsystemd\-dissect\fR
153 command may be invoked as
154 \fBmount\&.ddi\fR
155 in which case it implements the
156 \fBmount\fR(8)
157 "external helper" interface\&. This ensures disk images compatible with
158 \fBsystemd\-dissect\fR
159 can be mounted directly by
160 \fBmount\fR
161 and
162 \fBfstab\fR(5)\&. For details see below\&.
163 .PP
164 In place of the image path a
165 "\&.v/"
166 versioned directory may be specified, see
167 \fBsystemd.v\fR(7)
168 for details\&.
169 .SH "COMMANDS"
170 .PP
171 If neither of the command switches listed below are passed the specified disk image is opened and general information about the image and the contained partitions and their use is shown\&.
172 .PP
173 \fB\-\-mount\fR, \fB\-m\fR
174 .RS 4
175 Mount the specified OS image to the specified directory\&. This will dissect the image, determine the OS root file system \(em as well as possibly other partitions \(em and mount them to the specified directory\&. If the OS image contains multiple partitions marked with the
176 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2
177 multiple nested mounts are established\&. This command expects two arguments: a path to an image file and a path to a directory where to mount the image\&.
178 .sp
179 To unmount an OS image mounted like this use the
180 \fB\-\-umount\fR
181 operation\&.
182 .sp
183 When the OS image contains LUKS encrypted or Verity integrity protected file systems appropriate volumes are automatically set up and marked for automatic disassembly when the image is unmounted\&.
184 .sp
185 The OS image may either be specified as path to an OS image stored in a regular file or may refer to block device node (in the latter case, the block device must be the "whole" device, i\&.e\&. not a partition device)\&. (The other supported commands described here support this, too\&.)
186 .sp
187 All mounted file systems are checked with the appropriate
188 \fBfsck\fR(8)
189 implementation in automatic fixing mode, unless explicitly turned off (\fB\-\-fsck=no\fR) or read\-only operation is requested (\fB\-\-read\-only\fR)\&.
190 .sp
191 Note that this functionality is also available in
192 \fBmount\fR(8)
193 via a command such as
194 \fBmount \-t ddi myimage\&.raw targetdir/\fR, as well as in
195 \fBfstab\fR(5)\&. For details, see below\&.
196 .sp
197 Added in version 247\&.
198 .RE
199 .PP
200 \fB\-M\fR
201 .RS 4
202 This is a shortcut for
203 \fB\-\-mount \-\-mkdir\fR\&.
204 .sp
205 Added in version 247\&.
206 .RE
207 .PP
208 \fB\-\-umount\fR, \fB\-u\fR
209 .RS 4
210 Unmount an OS image from the specified directory\&. This command expects one argument: a directory where an OS image was mounted\&.
211 .sp
212 All mounted partitions will be recursively unmounted, and the underlying loop device will be removed, along with all its partition sub\-devices\&.
213 .sp
214 Added in version 252\&.
215 .RE
216 .PP
217 \fB\-U\fR
218 .RS 4
219 This is a shortcut for
220 \fB\-\-umount \-\-rmdir\fR\&.
221 .sp
222 Added in version 252\&.
223 .RE
224 .PP
225 \fB\-\-attach\fR
226 .RS 4
227 Attach the specified disk image to an automatically allocated loopback block device, and print the path to the loopback block device to standard output\&. This is similar to an invocation of
228 \fBlosetup \-\-find \-\-show\fR, but will validate the image as DDI before attaching, and derive the correct sector size to use automatically\&. Moreover, it ensures the per\-partition block devices are created before returning\&. Takes a path to a disk image file\&.
229 .sp
230 Added in version 254\&.
231 .RE
232 .PP
233 \fB\-\-detach\fR
234 .RS 4
235 Detach the specified disk image from a loopback block device\&. This undoes the effect of
236 \fB\-\-attach\fR
237 above\&. This expects either a path to a loopback block device as an argument, or the path to the backing image file\&. In the latter case, it will automatically determine the right device to detach\&.
238 .sp
239 Added in version 254\&.
240 .RE
241 .PP
242 \fB\-\-list\fR, \fB\-l\fR
243 .RS 4
244 Prints the paths of all the files and directories in the specified OS image or directory to standard output\&.
245 .sp
246 Added in version 253\&.
247 .RE
248 .PP
249 \fB\-\-mtree\fR
250 .RS 4
251 Generates a BSD
252 \fBmtree\fR(8)
253 compatible file manifest of the specified disk image or directory\&. This is useful for comparing image contents in detail, including inode information and other metadata\&. While the generated manifest will contain detailed inode information, it currently excludes extended attributes, file system capabilities, MAC labels,
254 \fBchattr\fR(1)
255 file flags,
256 \fBbtrfs\fR(5)
257 subvolume information, and various other file metadata\&. File content information is shown via a SHA256 digest\&. Additional fields might be added in future\&. Note that inode information such as link counts, inode numbers and timestamps is excluded from the output on purpose, as it typically complicates reproducibility\&.
258 .sp
259 Added in version 253\&.
260 .RE
261 .PP
262 \fB\-\-with\fR
263 .RS 4
264 Runs the specified command with the specified OS image mounted\&. This will mount the image to a temporary directory, switch the current working directory to it, and invoke the specified command line as child process\&. Once the process ends it will unmount the image again, and remove the temporary directory\&. If no command is specified a shell is invoked\&. The image is mounted writable, use
265 \fB\-\-read\-only\fR
266 to switch to read\-only operation\&. The invoked process will have the
267 \fI$SYSTEMD_DISSECT_ROOT\fR
268 environment variable set, containing the absolute path name of the temporary mount point, i\&.e\&. the same directory that is set as the current working directory\&. It will also have the
269 \fI$SYSTEMD_DISSECT_DEVICE\fR
270 environment variable set, containing the absolute path name of the loop device the image was attached to\&.
271 .sp
272 Added in version 253\&.
273 .RE
274 .PP
275 \fB\-\-copy\-from\fR, \fB\-x\fR
276 .RS 4
277 Copies a file or directory from the specified OS image or directory into the specified location on the host file system\&. Expects three arguments: a path to an image file or directory, a source path (relative to the image\*(Aqs root directory) and a destination path (relative to the current working directory, or an absolute path, both outside of the image)\&. If the destination path is omitted or specified as dash ("\-"), the specified file is written to standard output\&. If the source path in the image file system refers to a regular file it is copied to the destination path\&. In this case, access mode, extended attributes and timestamps are copied as well, but file ownership is not\&. If the source path in the image refers to a directory, it is copied to the destination path, recursively with all containing files and directories\&. In this case, the file ownership is copied too\&.
278 .sp
279 Added in version 247\&.
280 .RE
281 .PP
282 \fB\-\-copy\-to\fR, \fB\-a\fR
283 .RS 4
284 Copies a file or directory from the specified location in the host file system into the specified OS image or directory\&. Expects three arguments: a path to an image file or directory, a source path (relative to the current working directory, or an absolute path, both outside of the image) and a destination path (relative to the image\*(Aqs root directory)\&. If the source path is omitted or specified as dash ("\-"), the data to write is read from standard input\&. If the source path in the host file system refers to a regular file, it is copied to the destination path\&. In this case, access mode, extended attributes and timestamps are copied as well, but file ownership is not\&. If the source path in the host file system refers to a directory it is copied to the destination path, recursively with all containing files and directories\&. In this case, the file ownership is copied too\&.
285 .sp
286 As with
287 \fB\-\-mount\fR
288 file system checks are implicitly run before the copy operation begins\&.
289 .sp
290 Added in version 247\&.
291 .RE
292 .PP
293 \fB\-\-make\-archive\fR
294 .RS 4
295 Generates an archive file from the specified disk image\&. Expects two arguments: the path to the disk image and optionally the output archive file path\&. If the latter is omitted the archive is written to standard output\&. The archive file format is determined automatically from the specified output archive file name, e\&.g\&. any path suffixed with
296 "\&.tar\&.xz"
297 will result in an xz compressed UNIX tarball (if the path is omitted an uncompressed UNIX tarball is created)\&. See
298 \fBlibarchive\fR(3)
299 for a list of supported archive formats and compression schemes\&.
300 .sp
301 Added in version 256\&.
302 .RE
303 .PP
304 \fB\-\-discover\fR
305 .RS 4
306 Show a list of DDIs in well\-known directories\&. This will show machine, portable service and system/configuration extension disk images in the usual directories
307 /usr/lib/machines/,
308 /usr/lib/portables/,
309 /usr/lib/confexts/,
310 /var/lib/machines/,
311 /var/lib/portables/,
312 /var/lib/extensions/
313 and so on\&.
314 .sp
315 Added in version 253\&.
316 .RE
317 .PP
318 \fB\-\-validate\fR
319 .RS 4
320 Validates the partition arrangement of a disk image (DDI), and ensures it matches the image policy specified via
321 \fB\-\-image\-policy=\fR, if one is specified\&. This parses the partition table and probes the file systems in the image, but does not attempt to mount them (nor to set up disk encryption/authentication via LUKS/Verity)\&. It does this taking the configured image dissection policy into account\&. Since this operation does not mount file systems, this command \(en unlike all other commands implemented by this tool \(en requires no privileges other than the ability to access the specified file\&. Prints "OK" and returns zero if the image appears to be in order and matches the specified image dissection policy\&. Otherwise, prints an error message and returns non\-zero\&.
322 .sp
323 Added in version 254\&.
324 .RE
325 .PP
326 \fB\-h\fR, \fB\-\-help\fR
327 .RS 4
328 Print a short help text and exit\&.
329 .RE
330 .PP
331 \fB\-\-version\fR
332 .RS 4
333 Print a short version string and exit\&.
334 .RE
335 .SH "OPTIONS"
336 .PP
337 The following options are understood:
338 .PP
339 \fB\-\-read\-only\fR, \fB\-r\fR
340 .RS 4
341 Operate in read\-only mode\&. By default,
342 \fB\-\-mount\fR
343 will establish writable mount points\&. If this option is specified they are established in read\-only mode instead\&.
344 .sp
345 Added in version 247\&.
346 .RE
347 .PP
348 \fB\-\-fsck=no\fR
349 .RS 4
350 Turn off automatic file system checking\&. By default, when an image is accessed for writing (by
351 \fB\-\-mount\fR
352 or
353 \fB\-\-copy\-to\fR) the file systems contained in the OS image are automatically checked using the appropriate
354 \fBfsck\fR(8)
355 command, in automatic fixing mode\&. This behavior may be switched off using
356 \fB\-\-fsck=no\fR\&.
357 .sp
358 Added in version 247\&.
359 .RE
360 .PP
361 \fB\-\-growfs=no\fR
362 .RS 4
363 Turn off automatic growing of accessed file systems to their partition size, if marked for that in the GPT partition table\&. By default, when an image is accessed for writing (by
364 \fB\-\-mount\fR
365 or
366 \fB\-\-copy\-to\fR) the file systems contained in the OS image are automatically grown to their partition sizes, if bit 59 in the GPT partition flags is set for partition types that are defined by the
367 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&. This behavior may be switched off using
368 \fB\-\-growfs=no\fR\&. File systems are grown automatically on access if all of the following conditions are met:
369 .sp
370 .RS 4
371 .ie n \{\
372 \h'-04' 1.\h'+01'\c
373 .\}
374 .el \{\
375 .sp -1
376 .IP " 1." 4.2
377 .\}
378 The file system is mounted writable
379 .RE
380 .sp
381 .RS 4
382 .ie n \{\
383 \h'-04' 2.\h'+01'\c
384 .\}
385 .el \{\
386 .sp -1
387 .IP " 2." 4.2
388 .\}
389 The file system currently is smaller than the partition it is contained in (and thus can be grown)
390 .RE
391 .sp
392 .RS 4
393 .ie n \{\
394 \h'-04' 3.\h'+01'\c
395 .\}
396 .el \{\
397 .sp -1
398 .IP " 3." 4.2
399 .\}
400 The image contains a GPT partition table
401 .RE
402 .sp
403 .RS 4
404 .ie n \{\
405 \h'-04' 4.\h'+01'\c
406 .\}
407 .el \{\
408 .sp -1
409 .IP " 4." 4.2
410 .\}
411 The file system is stored on a partition defined by the Discoverable Partitions Specification
412 .RE
413 .sp
414 .RS 4
415 .ie n \{\
416 \h'-04' 5.\h'+01'\c
417 .\}
418 .el \{\
419 .sp -1
420 .IP " 5." 4.2
421 .\}
422 Bit 59 of the GPT partition flags for this partition is set, as per specification
423 .RE
424 .sp
425 .RS 4
426 .ie n \{\
427 \h'-04' 6.\h'+01'\c
428 .\}
429 .el \{\
430 .sp -1
431 .IP " 6." 4.2
432 .\}
433 The
434 \fB\-\-growfs=no\fR
435 option is not passed\&.
436 .RE
437 .sp
438 Added in version 249\&.
439 .RE
440 .PP
441 \fB\-\-mkdir\fR
442 .RS 4
443 If combined with
444 \fB\-\-mount\fR
445 the directory to mount the OS image to is created if it is missing\&. Note that the directory is not automatically removed when the disk image is unmounted again\&.
446 .sp
447 Added in version 247\&.
448 .RE
449 .PP
450 \fB\-\-rmdir\fR
451 .RS 4
452 If combined with
453 \fB\-\-umount\fR
454 the specified directory where the OS image is mounted is removed after unmounting the OS image\&.
455 .sp
456 Added in version 252\&.
457 .RE
458 .PP
459 \fB\-\-discard=\fR
460 .RS 4
461 Takes one of
462 "disabled",
463 "loop",
464 "all",
465 "crypto"\&. If
466 "disabled"
467 the image is accessed with empty block discarding turned off\&. If
468 "loop"
469 discarding is enabled if operating on a regular file\&. If
470 "crypt"
471 discarding is enabled even on encrypted file systems\&. If
472 "all"
473 discarding is unconditionally enabled\&.
474 .sp
475 Added in version 247\&.
476 .RE
477 .PP
478 \fB\-\-in\-memory\fR
479 .RS 4
480 If specified an in\-memory copy of the specified disk image is used\&. This may be used to operate with write\-access on a (possibly read\-only) image, without actually modifying the original file\&. This may also be used in order to operate on a disk image without keeping the originating file system busy, in order to allow it to be unmounted\&.
481 .sp
482 Added in version 253\&.
483 .RE
484 .PP
485 \fB\-\-root\-hash=\fR, \fB\-\-root\-hash\-sig=\fR, \fB\-\-verity\-data=\fR
486 .RS 4
487 Configure various aspects of Verity data integrity for the OS image\&. Option
488 \fB\-\-root\-hash=\fR
489 specifies a hex\-encoded top\-level Verity hash to use for setting up the Verity integrity protection\&. Option
490 \fB\-\-root\-hash\-sig=\fR
491 specifies the path to a file containing a PKCS#7 signature for the hash\&. This signature is passed to the kernel during activation, which will match it against signature keys available in the kernel keyring\&. Option
492 \fB\-\-verity\-data=\fR
493 specifies a path to a file with the Verity data to use for the OS image, in case it is stored in a detached file\&. It is recommended to embed the Verity data directly in the image, using the Verity mechanisms in the
494 \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
495 .sp
496 Added in version 247\&.
497 .RE
498 .PP
499 \fB\-\-loop\-ref=\fR
500 .RS 4
501 Configures the "reference" string the kernel shall report as backing file for the loopback block device\&. While this is supposed to be a path or filename referencing the backing file, this is not enforced and the kernel accepts arbitrary free\-form strings, chosen by the user\&. Accepts arbitrary strings up to a length of 63 characters\&. This sets the kernel\*(Aqs
502 "\&.lo_file_name"
503 field for the block device\&. Note this is distinct from the
504 /sys/class/block/loopX/loop/backing_file
505 attribute file that always reports a path referring to the actual backing file\&. The latter is subject to mount namespace translation, the former is not\&.
506 .sp
507 This setting is particularly useful in combination with the
508 \fB\-\-attach\fR
509 command, as it allows later referencing the allocated loop device via
510 /dev/disk/by\-loop\-ref/\&...
511 symlinks\&. Example: first, set up the loopback device via
512 \fBsystemd\-dissect attach \-\-loop\-ref=quux foo\&.raw\fR, and then reference it in a command via the specified filename:
513 \fBcfdisk /dev/disk/by\-loop\-ref/quux\fR\&.
514 .sp
515 Added in version 254\&.
516 .RE
517 .PP
518 \fB\-\-mtree\-hash=no\fR
519 .RS 4
520 If combined with
521 \fB\-\-mtree\fR, turns off inclusion of file hashes in the mtree output\&. This makes the
522 \fB\-\-mtree\fR
523 faster when operating on large images\&.
524 .sp
525 Added in version 254\&.
526 .RE
527 .PP
528 \fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR
529 .RS 4
530 Takes an image policy string as argument, as per
531 \fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via
532 \fB\-\-image=\fR, see above\&. If not specified, defaults to the
533 "*"
534 policy, i\&.e\&. all recognized file systems in the image are used\&.
535 .RE
536 .PP
537 \fB\-\-no\-pager\fR
538 .RS 4
539 Do not pipe output into a pager\&.
540 .RE
541 .PP
542 \fB\-\-no\-legend\fR
543 .RS 4
544 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
545 .RE
546 .PP
547 \fB\-\-json=\fR\fB\fIMODE\fR\fR
548 .RS 4
549 Shows output formatted as JSON\&. Expects one of
550 "short"
551 (for the shortest possible output without any redundant whitespace or line breaks),
552 "pretty"
553 (for a pretty version of the same, with indentation and line breaks) or
554 "off"
555 (to turn off JSON output, the default)\&.
556 .RE
557 .SH "EXIT STATUS"
558 .PP
559 On success, 0 is returned, a non\-zero failure code otherwise\&. If the
560 \fB\-\-with\fR
561 command is used the exit status of the invoked command is propagated\&.
562 .SH "INVOCATION AS /SBIN/MOUNT\&.DDI"
563 .PP
564 The
565 \fBsystemd\-dissect\fR
566 executable may be symlinked to
567 /sbin/mount\&.ddi\&. If invoked through that it implements
568 \fBmount\fR(8)\*(Aqs "external helper" interface for the (pseudo) file system type
569 "ddi"\&. This means conformant disk images may be mounted directly via
570 .sp
571 .if n \{\
572 .RS 4
573 .\}
574 .nf
575 # mount \-t ddi myimage\&.raw targetdir/
576 .fi
577 .if n \{\
578 .RE
579 .\}
580 .PP
581 in a fashion mostly equivalent to:
582 .sp
583 .if n \{\
584 .RS 4
585 .\}
586 .nf
587 # systemd\-dissect \-\-mount myimage\&.raw targetdir/
588 .fi
589 .if n \{\
590 .RE
591 .\}
592 .PP
593 Note that since a single DDI may contain multiple file systems it should later be unmounted with
594 \fBumount \-R targetdir/\fR, for recursive operation\&.
595 .PP
596 This functionality is particularly useful to mount DDIs automatically at boot via simple
597 /etc/fstab
598 entries\&. For example:
599 .sp
600 .if n \{\
601 .RS 4
602 .\}
603 .nf
604 /path/to/myimage\&.raw /images/myimage/ ddi defaults 0 0
605 .fi
606 .if n \{\
607 .RE
608 .\}
609 .PP
610 When invoked this way the mount options
611 "ro",
612 "rw",
613 "discard",
614 "nodiscard"
615 map to the corresponding options listed above (i\&.e\&.
616 \fB\-\-read\-only\fR,
617 \fB\-\-discard=all\fR,
618 \fB\-\-discard=disabled\fR)\&. Mount options are
619 \fInot\fR
620 generically passed on to the file systems inside the images\&.
621 .SH "EXAMPLES"
622 .PP
623 \fBExample\ \&1.\ \&Generate a tarball from an OS disk image (\-\-with)\fR
624 .sp
625 .if n \{\
626 .RS 4
627 .\}
628 .nf
629 # systemd\-dissect \-\-with foo\&.raw tar cz \&. >foo\&.tar\&.gz
630 .fi
631 .if n \{\
632 .RE
633 .\}
634 .PP
635 or alternatively just:
636 .PP
637 \fBExample\ \&2.\ \&Generate a tarball from an OS disk image (\-\-make\-archive)\fR
638 .sp
639 .if n \{\
640 .RS 4
641 .\}
642 .nf
643 # systemd\-dissect \-\-make\-archive foo\&.raw foo\&.tar\&.gz
644 .fi
645 .if n \{\
646 .RE
647 .\}
648 .SH "SEE ALSO"
649 .PP
650 \fBsystemd\fR(1), \fBsystemd-nspawn\fR(1), \fBsystemd.exec\fR(5), \fBsystemd.v\fR(7), \m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2, \fBmount\fR(8), \fBumount\fR(8), \fBfdisk\fR(8)
651 .SH "NOTES"
652 .IP " 1." 4
653 Discoverable Partitions Specification
654 .RS 4
655 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
656 .RE