summaryrefslogtreecommitdiffstats
path: root/upstream/opensuse-leap-15-6/man1/systemd-dissect.1
blob: 9606c8d367b43686a17dc91ba298a80fd06e51e6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
'\" t
.TH "SYSTEMD\-DISSECT" "1" "" "systemd 254" "systemd-dissect"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el       .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.SH "NAME"
systemd-dissect, mount.ddi \- Dissect Discoverable Disk Images (DDIs)
.SH "SYNOPSIS"
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fIIMAGE\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fIIMAGE\fR\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-mount\fR\fR\fB\ \fR\fB\fIIMAGE\fR\fR\fB\ \fR\fB\fIPATH\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-mount\fR\fR\fB \fR\fB\fIIMAGE\fR\fR\fB \fR\fB\fIPATH\fR\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-umount\fR\fR\fB\ \fR\fB\fIPATH\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-umount\fR\fR\fB \fR\fB\fIPATH\fR\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-attach\fR\fR\fB\ \fR\fB\fIIMAGE\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-attach\fR\fR\fB \fR\fB\fIIMAGE\fR\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-detach\fR\fR\fB\ \fR\fB\fIPATH\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-detach\fR\fR\fB \fR\fB\fIPATH\fR\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-list\fR\fR\fB\ \fR\fB\fIIMAGE\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-list\fR\fR\fB \fR\fB\fIIMAGE\fR\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-mtree\fR\fR\fB\ \fR\fB\fIIMAGE\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-mtree\fR\fR\fB \fR\fB\fIIMAGE\fR\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-with\fR\fR\fB\ \fR\fB\fIIMAGE\fR\fR\fB\ \fR\fB[\fICOMMAND\fR...]\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-with\fR\fR\fB \fR\fB\fIIMAGE\fR\fR\fB \fR\fB[\fICOMMAND\fR...]\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-copy\-from\fR\fR\fB\ \fR\fB\fIIMAGE\fR\fR\fB\ \fR\fB\fIPATH\fR\fR\fB\ \fR\fB[\fITARGET\fR]\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-copy\-from\fR\fR\fB \fR\fB\fIIMAGE\fR\fR\fB \fR\fB\fIPATH\fR\fR\fB \fR\fB[\fITARGET\fR]\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-copy\-to\fR\fR\fB\ \fR\fB\fIIMAGE\fR\fR\fB\ \fR\fB[\fISOURCE\fR]\fR\fB\ \fR\fB\fIPATH\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-copy\-to\fR\fR\fB \fR\fB\fIIMAGE\fR\fR\fB \fR\fB[\fISOURCE\fR]\fR\fB \fR\fB\fIPATH\fR\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-discover\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-discover\fR\fR
.HP \w'\fBsystemd\-dissect\ \fR\fB[OPTIONS...]\fR\fB\ \fR\fB\fB\-\-validate\fR\fR\fB\ \fR\fB\fIIMAGE\fR\fR\ 'u
\fBsystemd\-dissect \fR\fB[OPTIONS...]\fR\fB \fR\fB\fB\-\-validate\fR\fR\fB \fR\fB\fIIMAGE\fR\fR
.SH "DESCRIPTION"
.PP
\fBsystemd\-dissect\fR
is a tool for introspecting and interacting with file system OS disk images, specifically Discoverable Disk Images (DDIs)\&. It supports four different operations:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  1." 4.2
.\}
Show general OS image information, including the image\*(Aqs
\fBos-release\fR(5)
data, machine ID, partition information and more\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  2." 4.2
.\}
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\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  3." 4.2
.\}
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\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  4." 4.2
.\}
Copy files and directories in and out of an OS image\&.
.RE
.PP
The tool may operate on three types of OS images:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  1." 4.2
.\}
OS disk images containing a GPT partition table envelope, with partitions marked according to the
\m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  2." 4.2
.\}
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\&.)
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  3." 4.2
.\}
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\&.)
.RE
.PP
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
\fBsystemd-nspawn\fR(1)\*(Aqs
\fB\-\-image=\fR
switch, and be used as root file system for system service using the
\fIRootImage=\fR
unit file setting, see
\fBsystemd.exec\fR(5)\&.
.PP
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
/usr/
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
\fBfdisk\fR(8)\&.
.PP
The
\fBsystemd\-dissect\fR
command may be invoked as
\fBmount\&.ddi\fR
in which case it implements the
\fBmount\fR(8)
"external helper" interface\&. This ensures disk images compatible with
\fBsystemd\-dissect\fR
can be mounted directly by
\fBmount\fR
and
\fBfstab\fR(5)\&. For details see below\&.
.SH "COMMANDS"
.PP
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\&.
.PP
\fB\-\-mount\fR, \fB\-m\fR
.RS 4
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
\m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2
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\&.
.sp
To unmount an OS image mounted like this use the
\fB\-\-umount\fR
operation\&.
.sp
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\&.
.sp
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\&.)
.sp
All mounted file systems are checked with the appropriate
\fBfsck\fR(8)
implementation in automatic fixing mode, unless explicitly turned off (\fB\-\-fsck=no\fR) or read\-only operation is requested (\fB\-\-read\-only\fR)\&.
.sp
Note that this functionality is also available in
\fBmount\fR(8)
via a command such as
\fBmount \-t ddi myimage\&.raw targetdir/\fR, as well as in
\fBfstab\fR(5)\&. For details, see below\&.
.RE
.PP
\fB\-M\fR
.RS 4
This is a shortcut for
\fB\-\-mount \-\-mkdir\fR\&.
.RE
.PP
\fB\-\-umount\fR, \fB\-u\fR
.RS 4
Unmount an OS image from the specified directory\&. This command expects one argument: a directory where an OS image was mounted\&.
.sp
All mounted partitions will be recursively unmounted, and the underlying loop device will be removed, along with all its partition sub\-devices\&.
.RE
.PP
\fB\-U\fR
.RS 4
This is a shortcut for
\fB\-\-umount \-\-rmdir\fR\&.
.RE
.PP
\fB\-\-attach\fR
.RS 4
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
\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\&.
.RE
.PP
\fB\-\-detach\fR
.RS 4
Detach the specified disk image from a loopback block device\&. This undoes the effect of
\fB\-\-attach\fR
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\&.
.RE
.PP
\fB\-\-list\fR, \fB\-l\fR
.RS 4
Prints the paths of all the files and directories in the specified OS image or directory to standard output\&.
.RE
.PP
\fB\-\-mtree\fR
.RS 4
Generates a BSD
\fBmtree\fR(8)
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,
\fBchattr\fR(1)
file flags,
\fBbtrfs\fR(5)
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\&.
.RE
.PP
\fB\-\-with\fR
.RS 4
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
\fB\-\-read\-only\fR
to switch to read\-only operation\&. The invoked process will have the
\fI$SYSTEMD_DISSECT_ROOT\fR
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\&.
.RE
.PP
\fB\-\-copy\-from\fR, \fB\-x\fR
.RS 4
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\&.
.RE
.PP
\fB\-\-copy\-to\fR, \fB\-a\fR
.RS 4
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\&.
.sp
As with
\fB\-\-mount\fR
file system checks are implicitly run before the copy operation begins\&.
.RE
.PP
\fB\-\-discover\fR
.RS 4
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
/usr/lib/machines/,
/usr/lib/portables/,
/usr/lib/confexts/,
/var/lib/machines/,
/var/lib/portables/,
/var/lib/extensions/
and so on\&.
.RE
.PP
\fB\-\-validate\fR
.RS 4
Validates the partition arrangement of a disk image (DDI), and ensures it matches the image policy specified via
\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\&.
.RE
.PP
\fB\-h\fR, \fB\-\-help\fR
.RS 4
Print a short help text and exit\&.
.RE
.PP
\fB\-\-version\fR
.RS 4
Print a short version string and exit\&.
.RE
.SH "OPTIONS"
.PP
The following options are understood:
.PP
\fB\-\-read\-only\fR, \fB\-r\fR
.RS 4
Operate in read\-only mode\&. By default
\fB\-\-mount\fR
will establish writable mount points\&. If this option is specified they are established in read\-only mode instead\&.
.RE
.PP
\fB\-\-fsck=no\fR
.RS 4
Turn off automatic file system checking\&. By default when an image is accessed for writing (by
\fB\-\-mount\fR
or
\fB\-\-copy\-to\fR) the file systems contained in the OS image are automatically checked using the appropriate
\fBfsck\fR(8)
command, in automatic fixing mode\&. This behavior may be switched off using
\fB\-\-fsck=no\fR\&.
.RE
.PP
\fB\-\-growfs=no\fR
.RS 4
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
\fB\-\-mount\fR
or
\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
\m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&. This behavior may be switched off using
\fB\-\-growfs=no\fR\&. File systems are grown automatically on access if all of the following conditions are met:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  1." 4.2
.\}
The file system is mounted writable
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  2." 4.2
.\}
The file system currently is smaller than the partition it is contained in (and thus can be grown)
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  3." 4.2
.\}
The image contains a GPT partition table
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  4." 4.2
.\}
The file system is stored on a partition defined by the Discoverable Partitions Specification
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 5.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  5." 4.2
.\}
Bit 59 of the GPT partition flags for this partition is set, as per specification
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 6.\h'+01'\c
.\}
.el \{\
.sp -1
.IP "  6." 4.2
.\}
The
\fB\-\-growfs=no\fR
option is not passed\&.
.RE
.RE
.PP
\fB\-\-mkdir\fR
.RS 4
If combined with
\fB\-\-mount\fR
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\&.
.RE
.PP
\fB\-\-rmdir\fR
.RS 4
If combined with
\fB\-\-umount\fR
the specified directory where the OS image is mounted is removed after unmounting the OS image\&.
.RE
.PP
\fB\-\-discard=\fR
.RS 4
Takes one of
"disabled",
"loop",
"all",
"crypto"\&. If
"disabled"
the image is accessed with empty block discarding turned off\&. If
"loop"
discarding is enabled if operating on a regular file\&. If
"crypt"
discarding is enabled even on encrypted file systems\&. If
"all"
discarding is unconditionally enabled\&.
.RE
.PP
\fB\-\-in\-memory\fR
.RS 4
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\&.
.RE
.PP
\fB\-\-root\-hash=\fR, \fB\-\-root\-hash\-sig=\fR, \fB\-\-verity\-data=\fR
.RS 4
Configure various aspects of Verity data integrity for the OS image\&. Option
\fB\-\-root\-hash=\fR
specifies a hex\-encoded top\-level Verity hash to use for setting up the Verity integrity protection\&. Option
\fB\-\-root\-hash\-sig=\fR
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
\fB\-\-verity\-data=\fR
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
\m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2\&.
.RE
.PP
\fB\-\-loop\-ref=\fR
.RS 4
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
"\&.lo_file_name"
field for the block device\&. Note this is distinct from the
/sys/class/block/loopX/loop/backing_file
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\&.
.RE
.PP
\fB\-\-mtree\-hash=no\fR
.RS 4
If combined with
\fB\-\-mtree\fR, turns off inclusion of file hashes in the mtree output\&. This makes the
\fB\-\-mtree\fR
faster when operating on large images\&.
.RE
.PP
\fB\-\-image\-policy=\fR\fB\fIpolicy\fR\fR
.RS 4
Takes an image policy string as argument, as per
\fBsystemd.image-policy\fR(7)\&. The policy is enforced when operating on the disk image specified via
\fB\-\-image=\fR, see above\&. If not specified defaults to the
"*"
policy, i\&.e\&. all recognized file systems in the image are used\&.
.RE
.PP
\fB\-\-no\-pager\fR
.RS 4
Do not pipe output into a pager\&.
.RE
.PP
\fB\-\-no\-legend\fR
.RS 4
Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
.RE
.PP
\fB\-\-json=\fR\fIMODE\fR
.RS 4
Shows output formatted as JSON\&. Expects one of
"short"
(for the shortest possible output without any redundant whitespace or line breaks),
"pretty"
(for a pretty version of the same, with indentation and line breaks) or
"off"
(to turn off JSON output, the default)\&.
.RE
.SH "EXIT STATUS"
.PP
On success, 0 is returned, a non\-zero failure code otherwise\&. If the
\fB\-\-with\fR
command is used the exit status of the invoked command is propagated\&.
.SH "INVOCATION AS /SBIN/MOUNT\&.DDI"
.PP
The
\fBsystemd\-dissect\fR
executable may be symlinked to
/sbin/mount\&.ddi\&. If invoked through that it implements
\fBmount\fR(8)\*(Aqs "external helper" interface for the (pseudo) file system type
"ddi"\&. This means conformant disk images may be mounted directly via
.sp
.if n \{\
.RS 4
.\}
.nf
# mount \-t ddi myimage\&.raw targetdir/
.fi
.if n \{\
.RE
.\}
.PP
in a fashion mostly equivalent to:
.sp
.if n \{\
.RS 4
.\}
.nf
# systemd\-dissect \-\-mount myimage\&.raw targetdir/
.fi
.if n \{\
.RE
.\}
.PP
Note that since a single DDI may contain multiple file systems it should later be unmounted with
\fBumount \-R targetdir/\fR, for recursive operation\&.
.PP
This functionality is particularly useful to mount DDIs automatically at boot via simple
/etc/fstab
entries\&. For example:
.sp
.if n \{\
.RS 4
.\}
.nf
/path/to/myimage\&.raw /images/myimage/ ddi defaults 0 0
.fi
.if n \{\
.RE
.\}
.PP
When invoked this way the mount options
"ro",
"rw",
"discard",
"nodiscard"
map to the corresponding options listed above (i\&.e\&.
\fB\-\-read\-only\fR,
\fB\-\-discard=all\fR,
\fB\-\-discard=disabled\fR)\&. Mount options are
\fInot\fR
generically passed on to the file systems inside the images\&.
.SH "EXAMPLES"
.PP
\fBExample\ \&1.\ \&Generate a tarball from an OS disk image\fR
.sp
.if n \{\
.RS 4
.\}
.nf
# systemd\-dissect \-\-with foo\&.raw tar cz \&. >foo\&.tar\&.gz
.fi
.if n \{\
.RE
.\}
.SH "SEE ALSO"
.PP
\fBsystemd\fR(1),
\fBsystemd-nspawn\fR(1),
\fBsystemd.exec\fR(5),
\m[blue]\fBDiscoverable Partitions Specification\fR\m[]\&\s-2\u[1]\d\s+2,
\fBmount\fR(8),
\fBumount\fR(8),
\fBfdisk\fR(8)
.SH "NOTES"
.IP " 1." 4
Discoverable Partitions Specification
.RS 4
\%https://uapi-group.org/specifications/specs/discoverable_partitions_specification
.RE