Debian Codegraph @

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

raw
1 '\" t
2 .TH "SYSTEMD\-DISSECT" "1" "" "systemd 261~rc3" "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 .HP \w'\fBsystemd\-dissect\fR\ 'u
52 \fBsystemd\-dissect\fR [OPTIONS...] [\-\-shift] \fIIMAGE\fR \fIUIDBASE\fR
53 .SH "DESCRIPTION"
54 .PP
55 \fBsystemd\-dissect\fR
56 is a tool for introspecting and interacting with file system OS disk images, specifically Discoverable Disk Images (DDIs)\&. It supports four different operations:
57 .sp
58 .RS 4
59 .ie n \{\
60 \h'-04' 1.\h'+01'\c
61 .\}
62 .el \{\
63 .sp -1
64 .IP " 1." 4.2
65 .\}
66 Show general OS image information, including the image\*(Aqs
67 \fBos-release\fR(5)
68 data, machine ID, partition information and more\&.
69 .RE
70 .sp
71 .RS 4
72 .ie n \{\
73 \h'-04' 2.\h'+01'\c
74 .\}
75 .el \{\
76 .sp -1
77 .IP " 2." 4.2
78 .\}
79 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\&.
80 .RE
81 .sp
82 .RS 4
83 .ie n \{\
84 \h'-04' 3.\h'+01'\c
85 .\}
86 .el \{\
87 .sp -1
88 .IP " 3." 4.2
89 .\}
90 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\&.
91 .RE
92 .sp
93 .RS 4
94 .ie n \{\
95 \h'-04' 4.\h'+01'\c
96 .\}
97 .el \{\
98 .sp -1
99 .IP " 4." 4.2
100 .\}
101 Copy files and directories in and out of an OS image\&.
102 .RE
103 .PP
104 The tool may operate on three types of OS images:
105 .sp
106 .RS 4
107 .ie n \{\
108 \h'-04' 1.\h'+01'\c
109 .\}
110 .el \{\
111 .sp -1
112 .IP " 1." 4.2
113 .\}
114 OS disk images containing a GPT partition table envelope, with partitions marked according to the
115 \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
116 .RE
117 .sp
118 .RS 4
119 .ie n \{\
120 \h'-04' 2.\h'+01'\c
121 .\}
122 .el \{\
123 .sp -1
124 .IP " 2." 4.2
125 .\}
126 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\&.)
127 .RE
128 .sp
129 .RS 4
130 .ie n \{\
131 \h'-04' 3.\h'+01'\c
132 .\}
133 .el \{\
134 .sp -1
135 .IP " 3." 4.2
136 .\}
137 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\&.)
138 .RE
139 .PP
140 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
141 \fBsystemd-nspawn\fR(1)\*(Aqs
142 \fB\-\-image=\fR
143 switch, and be used as root file system for system service using the
144 \fIRootImage=\fR
145 unit file setting, see
146 \fBsystemd.exec\fR(5)\&.
147 .PP
148 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
149 /usr/
150 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
151 \fBfdisk\fR(8)\&.
152 .PP
153 The
154 \fBsystemd\-dissect\fR
155 command may be invoked as
156 \fBmount\&.ddi\fR
157 in which case it implements the
158 \fBmount\fR(8)
159 "external helper" interface\&. This ensures disk images compatible with
160 \fBsystemd\-dissect\fR
161 can be mounted directly by
162 \fBmount\fR
163 and
164 \fBfstab\fR(5)\&. For details see below\&.
165 .PP
166 In place of the image path a
167 "\&.v/"
168 versioned directory may be specified, see
169 \fBsystemd.v\fR(7)
170 for details\&.
171 .SH "COMMANDS"
172 .PP
173 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\&.
174 .PP
175 \fB\-\-mount\fR, \fB\-m\fR
176 .RS 4
177 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
178 \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2
179 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\&.
180 .sp
181 To unmount an OS image mounted like this use the
182 \fB\-\-umount\fR
183 operation\&.
184 .sp
185 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\&.
186 .sp
187 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\&.)
188 .sp
189 All mounted file systems are checked with the appropriate
190 \fBfsck\fR(8)
191 implementation in automatic fixing mode, unless explicitly turned off (\fB\-\-fsck=no\fR) or read\-only operation is requested (\fB\-\-read\-only\fR)\&.
192 .sp
193 Note that this functionality is also available in
194 \fBmount\fR(8)
195 via a command such as
196 \fBmount \-t ddi myimage\&.raw targetdir/\fR, as well as in
197 \fBfstab\fR(5)\&. For details, see below\&.
198 .sp
199 Added in version 247\&.
200 .RE
201 .PP
202 \fB\-M\fR
203 .RS 4
204 This is a shortcut for
205 \fB\-\-mount \-\-mkdir\fR\&.
206 .sp
207 Added in version 247\&.
208 .RE
209 .PP
210 \fB\-\-umount\fR, \fB\-u\fR
211 .RS 4
212 Unmount an OS image from the specified directory\&. This command expects one argument: a directory where an OS image was mounted\&.
213 .sp
214 All mounted partitions will be recursively unmounted, and the underlying loop device will be removed, along with all its partition sub\-devices\&.
215 .sp
216 Added in version 252\&.
217 .RE
218 .PP
219 \fB\-U\fR
220 .RS 4
221 This is a shortcut for
222 \fB\-\-umount \-\-rmdir\fR\&.
223 .sp
224 Added in version 252\&.
225 .RE
226 .PP
227 \fB\-\-attach\fR
228 .RS 4
229 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
230 \fBlosetup \-\-find \-\-show \-\-partscan\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 and attempts to enable direct IO mode, if possible\&. Takes a path to a disk image file\&.
231 .sp
232 If combined with
233 \fB\-\-quiet\fR
234 output of the block device name is suppressed\&.
235 .sp
236 Added in version 254\&.
237 .RE
238 .PP
239 \fB\-\-detach\fR
240 .RS 4
241 Detach the specified disk image from a loopback block device\&. This undoes the effect of
242 \fB\-\-attach\fR
243 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\&.
244 .sp
245 Added in version 254\&.
246 .RE
247 .PP
248 \fB\-\-list\fR, \fB\-l\fR
249 .RS 4
250 Prints the paths of all the files and directories in the specified OS image or directory to standard output\&.
251 .sp
252 Added in version 253\&.
253 .RE
254 .PP
255 \fB\-\-mtree\fR
256 .RS 4
257 Generates a BSD
258 \fBmtree\fR(8)
259 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,
260 \fBchattr\fR(1)
261 file flags,
262 \fBbtrfs\fR(5)
263 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\&.
264 .sp
265 Added in version 253\&.
266 .RE
267 .PP
268 \fB\-\-with\fR
269 .RS 4
270 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
271 \fB\-\-read\-only\fR
272 to switch to read\-only operation\&. The invoked process will have the
273 \fI$SYSTEMD_DISSECT_ROOT\fR
274 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
275 \fI$SYSTEMD_DISSECT_DEVICE\fR
276 environment variable set, containing the absolute path name of the loop device the image was attached to\&.
277 .sp
278 Added in version 253\&.
279 .RE
280 .PP
281 \fB\-\-copy\-from\fR, \fB\-x\fR
282 .RS 4
283 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, merging into existing directories and updating already existing files\&. In this case, the file ownership is copied too\&.
284 .sp
285 Added in version 247\&.
286 .RE
287 .PP
288 \fB\-\-copy\-to\fR, \fB\-a\fR
289 .RS 4
290 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, merging into existing directories and updating already existing files\&.\&. In this case, the file ownership is copied too\&.
291 .sp
292 As with
293 \fB\-\-mount\fR
294 file system checks are implicitly run before the copy operation begins\&.
295 .sp
296 Added in version 247\&.
297 .RE
298 .PP
299 \fB\-\-make\-archive\fR
300 .RS 4
301 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
302 "\&.tar\&.xz"
303 will result in an xz compressed UNIX tarball (if the path is omitted an uncompressed UNIX tarball is created)\&. See
304 \fBlibarchive\fR(3)
305 for a list of supported archive formats and compression schemes\&.
306 .sp
307 Added in version 256\&.
308 .RE
309 .PP
310 \fB\-\-discover\fR
311 .RS 4
312 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
313 /usr/lib/machines/,
314 /usr/lib/portables/,
315 /usr/lib/confexts/,
316 /var/lib/machines/,
317 /var/lib/portables/,
318 /var/lib/extensions/
319 and so on\&.
320 .sp
321 Added in version 253\&.
322 .RE
323 .PP
324 \fB\-\-validate\fR
325 .RS 4
326 Validates the partition arrangement of a disk image (DDI), and ensures it matches the image policy specified via
327 \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\&.
328 .sp
329 Added in version 254\&.
330 .RE
331 .PP
332 \fB\-\-shift\fR
333 .RS 4
334 Recursively iterates through all inodes of the specified image and shifts the UIDs and GIDs the inodes are owned by into the specified UID range\&. Takes an image path and a UID base as parameter\&. The UID base can be specified numerically (in which case it must be a multiple of 65536, and either 0 or within the container or foreign UID range, as per
335 \m[blue]\fBUsers, Groups, UIDs and GIDs on systemd Systems\fR\m[]\&\s-2\u[2]\d\s+2), or as the symbolic identifier
336 "foreign"
337 which is shorthand to the foreign UID base\&. This command is useful for preparing directory container images for unprivileged use\&. Note that this command is intended for images that use the 16bit UIDs/GIDs range only, and it always ignores the upper 16bit of the current UID/GID ownership, combining the lower 16 bit with the target UID base\&.
338 .sp
339 Use
340 \fBsystemd\-dissect \-\-shift /some/container/tree foreign\fR
341 to shift a container image into the foreign UID range, or
342 \fBsystemd\-dissect \-\-shift /some/container/tree 0\fR
343 to shift it to host UID range\&.
344 .sp
345 Added in version 258\&.
346 .RE
347 .PP
348 \fB\-h\fR, \fB\-\-help\fR
349 .RS 4
350 Print a short help text and exit\&.
351 .RE
352 .PP
353 \fB\-\-version\fR
354 .RS 4
355 Print a short version string and exit\&.
356 .RE
357 .SH "OPTIONS"
358 .PP
359 The following options are understood:
360 .PP
361 \fB\-\-read\-only\fR, \fB\-r\fR
362 .RS 4
363 Operate in read\-only mode\&. By default,
364 \fB\-\-mount\fR
365 will establish writable mount points\&. If this option is specified they are established in read\-only mode instead\&.
366 .sp
367 Added in version 247\&.
368 .RE
369 .PP
370 \fB\-\-fsck=no\fR
371 .RS 4
372 Turn off automatic file system checking\&. By default, when an image is accessed for writing (by
373 \fB\-\-mount\fR
374 or
375 \fB\-\-copy\-to\fR) the file systems contained in the OS image are automatically checked using the appropriate
376 \fBfsck\fR(8)
377 command, in automatic fixing mode\&. This behavior may be switched off using
378 \fB\-\-fsck=no\fR\&.
379 .sp
380 Added in version 247\&.
381 .RE
382 .PP
383 \fB\-\-growfs=no\fR
384 .RS 4
385 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
386 \fB\-\-mount\fR
387 or
388 \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
389 \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&. This behavior may be switched off using
390 \fB\-\-growfs=no\fR\&. File systems are grown automatically on access if all of the following conditions are met:
391 .sp
392 .RS 4
393 .ie n \{\
394 \h'-04' 1.\h'+01'\c
395 .\}
396 .el \{\
397 .sp -1
398 .IP " 1." 4.2
399 .\}
400 The file system is mounted writable
401 .RE
402 .sp
403 .RS 4
404 .ie n \{\
405 \h'-04' 2.\h'+01'\c
406 .\}
407 .el \{\
408 .sp -1
409 .IP " 2." 4.2
410 .\}
411 The file system currently is smaller than the partition it is contained in (and thus can be grown)
412 .RE
413 .sp
414 .RS 4
415 .ie n \{\
416 \h'-04' 3.\h'+01'\c
417 .\}
418 .el \{\
419 .sp -1
420 .IP " 3." 4.2
421 .\}
422 The image contains a GPT partition table
423 .RE
424 .sp
425 .RS 4
426 .ie n \{\
427 \h'-04' 4.\h'+01'\c
428 .\}
429 .el \{\
430 .sp -1
431 .IP " 4." 4.2
432 .\}
433 The file system is stored on a partition defined by the Discoverable Partitions Specification
434 .RE
435 .sp
436 .RS 4
437 .ie n \{\
438 \h'-04' 5.\h'+01'\c
439 .\}
440 .el \{\
441 .sp -1
442 .IP " 5." 4.2
443 .\}
444 Bit 59 of the GPT partition flags for this partition is set, as per specification
445 .RE
446 .sp
447 .RS 4
448 .ie n \{\
449 \h'-04' 6.\h'+01'\c
450 .\}
451 .el \{\
452 .sp -1
453 .IP " 6." 4.2
454 .\}
455 The
456 \fB\-\-growfs=no\fR
457 option is not passed\&.
458 .RE
459 .sp
460 Added in version 249\&.
461 .RE
462 .PP
463 \fB\-\-mkdir\fR
464 .RS 4
465 If combined with
466 \fB\-\-mount\fR
467 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\&.
468 .sp
469 Added in version 247\&.
470 .RE
471 .PP
472 \fB\-\-rmdir\fR
473 .RS 4
474 If combined with
475 \fB\-\-umount\fR
476 the specified directory where the OS image is mounted is removed after unmounting the OS image\&.
477 .sp
478 Added in version 252\&.
479 .RE
480 .PP
481 \fB\-\-discard=\fR
482 .RS 4
483 Takes one of
484 "disabled",
485 "loop",
486 "all",
487 "crypto"\&. If
488 "disabled"
489 the image is accessed with empty block discarding turned off\&. If
490 "loop"
491 discarding is enabled if operating on a regular file\&. If
492 "crypt"
493 discarding is enabled even on encrypted file systems\&. If
494 "all"
495 discarding is unconditionally enabled\&.
496 .sp
497 Added in version 247\&.
498 .RE
499 .PP
500 \fB\-\-in\-memory\fR
501 .RS 4
502 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\&.
503 .sp
504 Added in version 253\&.
505 .RE
506 .PP
507 \fB\-\-root\-hash=\fR, \fB\-\-root\-hash\-sig=\fR, \fB\-\-verity\-data=\fR
508 .RS 4
509 Configure various aspects of Verity data integrity for the OS image\&. Option
510 \fB\-\-root\-hash=\fR
511 specifies a hex\-encoded top\-level Verity hash to use for setting up the Verity integrity protection\&. Option
512 \fB\-\-root\-hash\-sig=\fR
513 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
514 \fB\-\-verity\-data=\fR
515 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
516 \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
517 .sp
518 Added in version 247\&.
519 .RE
520 .PP
521 \fB\-\-usr\-hash=\fR, \fB\-\-usr\-hash\-sig=\fR
522 .RS 4
523 Similar to
524 \fB\-\-root\-hash=\fR
525 and
526 \fB\-\-root\-hash\-sig=\fR, but specifies hash and signature for the
527 /usr/
528 partition\&. Note that either the options for the root partition may be used or the ones for the
529 /usr/, but not both in combination\&.
530 .sp
531 Added in version 258\&.
532 .RE
533 .PP
534 \fB\-\-loop\-ref=\fR
535 .RS 4
536 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
537 "\&.lo_file_name"
538 field for the block device\&. Note this is distinct from the
539 /sys/class/block/loopX/loop/backing_file
540 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\&.
541 .sp
542 This setting is particularly useful in combination with the
543 \fB\-\-attach\fR
544 command, as it allows later referencing the allocated loop device via
545 /dev/disk/by\-loop\-ref/\&...
546 symlinks\&. Example: first, set up the loopback device via
547 \fBsystemd\-dissect attach \-\-loop\-ref=quux foo\&.raw\fR, and then reference it in a command via the specified filename:
548 \fBcfdisk /dev/disk/by\-loop\-ref/quux\fR\&.
549 .sp
550 Added in version 254\&.
551 .RE
552 .PP
553 \fB\-\-loop\-ref\-auto\fR
554 .RS 4
555 Similar to
556 \fB\-\-loop\-ref=\fR, but automatically derive the reference string from the specified backing filename, truncating it if necessary\&.
557 .sp
558 Added in version 258\&.
559 .RE
560 .PP
561 \fB\-\-mtree\-hash=no\fR
562 .RS 4
563 If combined with
564 \fB\-\-mtree\fR, turns off inclusion of file hashes in the mtree output\&. This makes the
565 \fB\-\-mtree\fR
566 faster when operating on large images\&.
567 .sp
568 Added in version 254\&.
569 .RE
570 .PP
571 \fB\-\-copy\-ownership=\fR
572 .RS 4
573 Controls whether file ownership (user and group) is preserved when copying files with
574 \fB\-\-copy\-from\fR
575 or
576 \fB\-\-copy\-to\fR\&. Takes a boolean, or
577 \fBauto\fR\&. If
578 "yes", ownership is always preserved\&. If
579 "no", ownership is never preserved and the current user\*(Aqs UID/GID is used instead\&. If not specified or
580 \fBauto\fR, ownership is preserved when copying directory trees, but not when copying individual regular files\&.
581 .sp
582 Added in version 260\&.
583 .RE
584 .PP
585 \fB\-\-system\fR, \fB\-\-user\fR
586 .RS 4
587 When used together with
588 \fB\-\-discover\fR
589 controls whether to search for images installed system\-wide or in the user\*(Aqs directories in
590 \fI$HOME\fR\&. If neither switch is specified, will search within both scopes\&.
591 .sp
592 Added in version 258\&.
593 .RE
594 .PP
595 \fB\-\-all\fR
596 .RS 4
597 If combined with
598 \fB\-\-discover\fR, also shows images that start with a dot, i\&.e\&. hidden images\&.
599 .sp
600 Added in version 258\&.
601 .RE
602 .PP
603 \fB\-\-quiet\fR, \fB\-q\fR
604 .RS 4
605 If combined with
606 \fB\-\-attach\fR, suppresses output of the used loopback block device path\&.
607 .sp
608 Added in version 258\&.
609 .RE
610 .PP
611 \fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR
612 .RS 4
613 Takes an image policy string as argument, as per
614 \fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via
615 \fB\-\-image=\fR, see above\&. If not specified, defaults to the
616 "*"
617 policy, i\&.e\&. all recognized file systems in the image are used\&.
618 .RE
619 .PP
620 \fB\-\-image\-filter=\fR\fB\fIfilter\fR\fR
621 .RS 4
622 Takes an image filter string as argument, as per
623 \fBsystemd.image-filter\fR(7)\&. The filter is taken into consideration when operating on the disk image specified via
624 \fB\-\-image=\fR, see above\&. If not specified no filtering is applied\&.
625 .RE
626 .PP
627 \fB\-\-no\-pager\fR
628 .RS 4
629 Do not pipe output into a pager\&.
630 .RE
631 .PP
632 \fB\-\-no\-legend\fR
633 .RS 4
634 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
635 .RE
636 .PP
637 \fB\-\-json=\fR\fB\fIMODE\fR\fR
638 .RS 4
639 Shows output formatted as JSON\&. Expects one of
640 "short"
641 (for the shortest possible output without any redundant whitespace or line breaks),
642 "pretty"
643 (for a pretty version of the same, with indentation and line breaks) or
644 "off"
645 (to turn off JSON output, the default)\&.
646 .RE
647 .SH "EXIT STATUS"
648 .PP
649 On success, 0 is returned, a non\-zero failure code otherwise\&. If the
650 \fB\-\-with\fR
651 command is used the exit status of the invoked command is propagated\&.
652 .SH "INVOCATION AS /SBIN/MOUNT\&.DDI"
653 .PP
654 The
655 \fBsystemd\-dissect\fR
656 executable may be symlinked to
657 /sbin/mount\&.ddi\&. If invoked through that it implements
658 \fBmount\fR(8)\*(Aqs "external helper" interface for the (pseudo) file system type
659 "ddi"\&. This means conformant disk images may be mounted directly via
660 .sp
661 .if n \{\
662 .RS 4
663 .\}
664 .nf
665 # mount \-t ddi myimage\&.raw targetdir/
666 .fi
667 .if n \{\
668 .RE
669 .\}
670 .PP
671 in a fashion mostly equivalent to:
672 .sp
673 .if n \{\
674 .RS 4
675 .\}
676 .nf
677 # systemd\-dissect \-\-mount myimage\&.raw targetdir/
678 .fi
679 .if n \{\
680 .RE
681 .\}
682 .PP
683 Note that since a single DDI may contain multiple file systems it should later be unmounted with
684 \fBumount \-R targetdir/\fR, for recursive operation\&.
685 .PP
686 This functionality is particularly useful to mount DDIs automatically at boot via simple
687 /etc/fstab
688 entries\&. For example:
689 .sp
690 .if n \{\
691 .RS 4
692 .\}
693 .nf
694 /path/to/myimage\&.raw /images/myimage/ ddi defaults 0 0
695 .fi
696 .if n \{\
697 .RE
698 .\}
699 .PP
700 When invoked this way the mount options
701 "ro",
702 "rw",
703 "discard",
704 "nodiscard"
705 map to the corresponding options listed above (i\&.e\&.
706 \fB\-\-read\-only\fR,
707 \fB\-\-discard=all\fR,
708 \fB\-\-discard=disabled\fR)\&. Mount options are
709 \fInot\fR
710 generically passed on to the file systems inside the images\&.
711 .SH "EXAMPLES"
712 .PP
713 \fBExample\ \&1.\ \&Generate a tarball from an OS disk image (\-\-with)\fR
714 .sp
715 .if n \{\
716 .RS 4
717 .\}
718 .nf
719 # systemd\-dissect \-\-with foo\&.raw tar cz \&. >foo\&.tar\&.gz
720 .fi
721 .if n \{\
722 .RE
723 .\}
724 .PP
725 or alternatively just:
726 .PP
727 \fBExample\ \&2.\ \&Generate a tarball from an OS disk image (\-\-make\-archive)\fR
728 .sp
729 .if n \{\
730 .RS 4
731 .\}
732 .nf
733 # systemd\-dissect \-\-make\-archive foo\&.raw foo\&.tar\&.gz
734 .fi
735 .if n \{\
736 .RE
737 .\}
738 .SH "SEE ALSO"
739 .PP
740 \fBsystemd\fR(1), \fBsystemd-nspawn\fR(1), \fBsystemd.exec\fR(5), \fBsystemd.v\fR(7), \m[blue]\fBUAPI\&.2 Discoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2, \fBmount\fR(8), \fBumount\fR(8), \fBfdisk\fR(8)
741 .SH "NOTES"
742 .IP " 1." 4
743 UAPI.2 Discoverable Partitions Specification
744 .RS 4
745 \%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
746 .RE
747 .IP " 2." 4
748 Users, Groups, UIDs and GIDs on systemd Systems
749 .RS 4
750 \%https://systemd.io/UIDS-GIDS/
751 .RE