Debian Codegraph @

upstream/debian-unstable/man1/storagectl.1

raw
1 '\" t
2 .TH "STORAGECTL" "1" "" "systemd 261~rc3" "storagectl"
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 storagectl, mount.storage \- Enumerate and mount storage volumes provided by storage providers
24 .SH "SYNOPSIS"
25 .HP \w'\fBstoragectl\fR\ 'u
26 \fBstoragectl\fR [OPTIONS...] {COMMAND} [NAME...]
27 .HP \w'\fBmount\fR\ 'u
28 \fBmount\fR \-t storage \fIPROVIDER\fR:\fIVOLUME\fR \fIDIRECTORY\fR
29 .HP \w'\fBmount\fR\ 'u
30 \fBmount\fR \-t storage\&.\fIFSTYPE\fR \fIPROVIDER\fR:\fIVOLUME\fR \fIDIRECTORY\fR
31 .SH "DESCRIPTION"
32 .PP
33 \fBstoragectl\fR
34 may be used to inspect storage providers and the storage volumes they expose\&. A storage provider is a service implementing the
35 \fBio\&.systemd\&.StorageProvider\fR
36 \m[blue]\fBVarlink\fR\m[]\&\s-2\u[1]\d\s+2
37 interface, registered as an AF_UNIX socket below the well\-known socket directory
38 /run/systemd/io\&.systemd\&.StorageProvider/
39 (in system mode) or
40 \fI$XDG_RUNTIME_DIR\fR/systemd/io\&.systemd\&.StorageProvider/
41 (in user mode)\&. The two storage providers shipped with systemd are
42 \[email protected]\fR(8), which exposes the system\*(Aqs block devices, and
43 \[email protected]\fR(8), which exposes regular files and directories from a backing file system\&.
44 .PP
45 The tool also provides a
46 \fBmount\fR(8)
47 helper for the file system type
48 "storage", which permits mounting storage volumes to arbitrary places\&. See "Use as a mount helper" below for details\&.
49 .SH "COMMANDS"
50 .PP
51 The following commands are understood:
52 .PP
53 \fBvolumes\fR [\fIGLOB\fR]
54 .RS 4
55 List storage volumes provided by all storage providers running on the system (or, with
56 \fB\-\-user\fR, in the user runtime)\&. The optional
57 \fIGLOB\fR
58 argument is a shell\-style pattern (see
59 \fBfnmatch\fR(3)) that filters the result by volume name\&. The output is a table containing the providing service, the volume name, its type ("blk",
60 "reg"
61 or
62 "dir"), whether it is read\-only, and \(em if known \(em its size and the number of bytes used\&.
63 .sp
64 This is the default command if none is specified\&.
65 .sp
66 Added in version 261\&.
67 .RE
68 .PP
69 \fBtemplates\fR [\fIGLOB\fR]
70 .RS 4
71 List volume templates supported by the running storage providers\&. Templates encapsulate a configuration to use when creating volumes on\-the\-fly, when they are acquired\&. Template support is an optional feature for providers, and only applies to providers that allow creation of volumes on\-the\-fly\&. See the respective provider documentation for details, for example
72 \[email protected]\fR(8)\&. The optional
73 \fIGLOB\fR
74 argument filters by template name\&. Storage providers that do not implement template\-based volume creation (such as the block\-device provider) do not contribute to this output\&.
75 .sp
76 Added in version 261\&.
77 .RE
78 .PP
79 \fBproviders\fR
80 .RS 4
81 List the storage providers known to the system\&. This is determined by scanning the well\-known socket directory for
82 \fBAF_UNIX\fR
83 sockets that look like
84 \fBio\&.systemd\&.StorageProvider\fR
85 endpoints\&. For each provider it is also reported whether the socket can currently be connected to\&.
86 .sp
87 Added in version 261\&.
88 .RE
89 .SH "OPTIONS"
90 .PP
91 The following options are understood:
92 .PP
93 \fB\-\-system\fR
94 .RS 4
95 Operate on system\-wide storage providers\&. Sockets are looked for in
96 /run/systemd/io\&.systemd\&.StorageProvider/\&. This is the default\&.
97 .sp
98 Added in version 261\&.
99 .RE
100 .PP
101 \fB\-\-user\fR
102 .RS 4
103 Operate on per\-user storage providers\&. Sockets are looked for in
104 $XDG_RUNTIME_DIR/systemd/io\&.systemd\&.StorageProvider/\&.
105 .sp
106 Added in version 261\&.
107 .RE
108 .PP
109 \fB\-\-json=\fR\fB\fIMODE\fR\fR
110 .RS 4
111 Shows output formatted as JSON\&. Expects one of
112 "short"
113 (for the shortest possible output without any redundant whitespace or line breaks),
114 "pretty"
115 (for a pretty version of the same, with indentation and line breaks) or
116 "off"
117 (to turn off JSON output, the default)\&.
118 .RE
119 .PP
120 \fB\-\-no\-pager\fR
121 .RS 4
122 Do not pipe output into a pager\&.
123 .RE
124 .PP
125 \fB\-\-no\-legend\fR
126 .RS 4
127 Do not print the legend, i\&.e\&. column headers and the footer with hints\&.
128 .RE
129 .PP
130 \fB\-\-no\-ask\-password\fR
131 .RS 4
132 Do not query the user for authentication for privileged operations\&.
133 .RE
134 .PP
135 \fB\-h\fR, \fB\-\-help\fR
136 .RS 4
137 Print a short help text and exit\&.
138 .RE
139 .PP
140 \fB\-\-version\fR
141 .RS 4
142 Print a short version string and exit\&.
143 .RE
144 .SH "USE AS A MOUNT HELPER"
145 .PP
146 The tool provides the
147 \fB/sbin/mount\&.storage\fR
148 alias, implementing the
149 \fBmount\fR(8)
150 "external helper" interface, allowing storage volumes to be mounted with the regular
151 \fBmount\fR
152 command\&. The volume to mount is encoded as the source of the mount, in the form
153 "\fIPROVIDER\fR:\fIVOLUME\fR", where
154 \fIPROVIDER\fR
155 is the name of a storage provider (as listed by
156 \fBstoragectl providers\fR) and
157 \fIVOLUME\fR
158 is the volume name\&. Two file system type spellings are recognized:
159 .PP
160 "storage"
161 .RS 4
162 Acquires a directory volume and bind\-mounts its directory tree onto the target\&.
163 .sp
164 Added in version 261\&.
165 .RE
166 .PP
167 "storage\&.\fIFSTYPE\fR"
168 .RS 4
169 Acquires a regular file or block device volume and mounts it as a file system of type
170 \fIFSTYPE\fR
171 (for example
172 "storage\&.ext4",
173 "storage\&.btrfs", \&...)\&.
174 .sp
175 Added in version 261\&.
176 .RE
177 .PP
178 The standard
179 \fB\-o\fR
180 mount options are forwarded to
181 \fBmount\fR\&. In addition, the following
182 "storage\&."\-prefixed options are interpreted by
183 \fBmount\&.storage\fR
184 itself and stripped from the forwarded list:
185 .PP
186 \fBstorage\&.create=\fR\fIMODE\fR
187 .RS 4
188 Takes one of
189 "any"
190 (open if it exists, otherwise create \(em the default),
191 "open"
192 (fail if the volume does not yet exist) or
193 "new"
194 (fail if the volume already exists)\&.
195 .sp
196 Added in version 261\&.
197 .RE
198 .PP
199 \fBstorage\&.template=\fR\fINAME\fR
200 .RS 4
201 The template to use when creating a new volume, if it is missing and the provider supports on\-the\-fly creation of volumes\&.
202 .sp
203 Added in version 261\&.
204 .RE
205 .PP
206 \fBstorage\&.create\-size=\fR\fIBYTES\fR
207 .RS 4
208 When creating a new volume on\-the\-fly, the size in bytes to allocate\&. Accepts the usual
209 "K"/"M"/"G"/"T"
210 suffixes (base 1024)\&. Required when creating a regular file volume\&.
211 .sp
212 Added in version 261\&.
213 .RE
214 .SH "EXAMPLES"
215 .PP
216 \fBExample\ \&1.\ \&Enumerate available storage providers, volumes and templates\fR
217 .sp
218 .if n \{\
219 .RS 4
220 .\}
221 .nf
222 $ storagectl providers
223 $ storagectl volumes
224 $ storagectl volumes \*(Aq*foo*\*(Aq
225 $ storagectl templates
226 .fi
227 .if n \{\
228 .RE
229 .\}
230 .PP
231 \fBExample\ \&2.\ \&Mount a directory volume from the file system provider\fR
232 .sp
233 .if n \{\
234 .RS 4
235 .\}
236 .nf
237 # mount \-t storage fs:myvol /mnt/myvol
238 .fi
239 .if n \{\
240 .RE
241 .\}
242 .PP
243 If the volume
244 "myvol"
245 does not yet exist, it will be created using the default
246 "subvolume"
247 template\&.
248 .PP
249 \fBExample\ \&3.\ \&Create and mount an ext4 file system from a regular file\&.\fR
250 .sp
251 .if n \{\
252 .RS 4
253 .\}
254 .nf
255 # mount \-t storage\&.ext4 fs:scratch /mnt/scratch \-o loop
256 .fi
257 .if n \{\
258 .RE
259 .\}
260 .PP
261 \fBExample\ \&4.\ \&Mount a block device volume read\-only\fR
262 .sp
263 .if n \{\
264 .RS 4
265 .\}
266 .nf
267 # mount \-t storage\&.ext4 \-o ro block:/dev/disk/by\-id/usb\-foo /mnt/foo
268 .fi
269 .if n \{\
270 .RE
271 .\}
272 .SH "EXIT STATUS"
273 .PP
274 On success, 0 is returned, a non\-zero failure code otherwise\&.
275 .SH "ENVIRONMENT"
276 .PP
277 \fI$SYSTEMD_LOG_LEVEL\fR
278 .RS 4
279 The maximum log level of emitted messages (messages with a higher log level, i\&.e\&. less important ones, will be suppressed)\&. Takes a comma\-separated list of values\&. A value may be either one of (in order of decreasing importance)
280 \fBemerg\fR,
281 \fBalert\fR,
282 \fBcrit\fR,
283 \fBerr\fR,
284 \fBwarning\fR,
285 \fBnotice\fR,
286 \fBinfo\fR,
287 \fBdebug\fR, or an integer in the range 0\&...7\&. See
288 \fBsyslog\fR(3)
289 for more information\&. Each value may optionally be prefixed with one of
290 \fBconsole\fR,
291 \fBsyslog\fR,
292 \fBkmsg\fR
293 or
294 \fBjournal\fR
295 followed by a colon to set the maximum log level for that specific log target (e\&.g\&.
296 \fBSYSTEMD_LOG_LEVEL=debug,console:info\fR
297 specifies to log at debug level except when logging to the console which should be at info level)\&. Note that the global maximum log level takes priority over any per target maximum log levels\&.
298 .RE
299 .PP
300 \fI$SYSTEMD_LOG_COLOR\fR
301 .RS 4
302 A boolean\&. If true, messages written to the tty will be colored according to priority\&.
303 .sp
304 This setting is only useful when messages are written directly to the terminal, because
305 \fBjournalctl\fR(1)
306 and other tools that display logs will color messages based on the log level on their own\&.
307 .RE
308 .PP
309 \fI$SYSTEMD_LOG_TIME\fR
310 .RS 4
311 A boolean\&. If true, console log messages will be prefixed with a timestamp\&.
312 .sp
313 This setting is only useful when messages are written directly to the terminal or a file, because
314 \fBjournalctl\fR(1)
315 and other tools that display logs will attach timestamps based on the entry metadata on their own\&.
316 .RE
317 .PP
318 \fI$SYSTEMD_LOG_LOCATION\fR
319 .RS 4
320 A boolean\&. If true, messages will be prefixed with a filename and line number in the source code where the message originates\&.
321 .sp
322 Note that the log location is often attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
323 .RE
324 .PP
325 \fI$SYSTEMD_LOG_TID\fR
326 .RS 4
327 A boolean\&. If true, messages will be prefixed with the current numerical thread ID (TID)\&.
328 .sp
329 Note that the this information is attached as metadata to journal entries anyway\&. Including it directly in the message text can nevertheless be convenient when debugging programs\&.
330 .RE
331 .PP
332 \fI$SYSTEMD_LOG_TARGET\fR
333 .RS 4
334 The destination for log messages\&. One of
335 \fBconsole\fR
336 (log to the attached tty),
337 \fBconsole\-prefixed\fR
338 (log to the attached tty but with prefixes encoding the log level and "facility", see
339 \fBsyslog\fR(3),
340 \fBkmsg\fR
341 (log to the kernel circular log buffer),
342 \fBjournal\fR
343 (log to the journal),
344 \fBjournal\-or\-kmsg\fR
345 (log to the journal if available, and to kmsg otherwise),
346 \fBauto\fR
347 (determine the appropriate log target automatically, the default),
348 \fBnull\fR
349 (disable log output)\&.
350 .RE
351 .PP
352 \fI$SYSTEMD_LOG_RATELIMIT_KMSG\fR
353 .RS 4
354 Whether to ratelimit kmsg or not\&. Takes a boolean\&. Defaults to
355 "true"\&. If disabled, systemd will not ratelimit messages written to kmsg\&.
356 .RE
357 .PP
358 \fI$SYSTEMD_PAGER\fR, \fI$PAGER\fR
359 .RS 4
360 Pager to use when
361 \fB\-\-no\-pager\fR
362 is not given\&.
363 \fI$SYSTEMD_PAGER\fR
364 is used if set; otherwise
365 \fI$PAGER\fR
366 is used\&. If neither
367 \fI$SYSTEMD_PAGER\fR
368 nor
369 \fI$PAGER\fR
370 are set, a set of well\-known pager implementations is tried in turn, including
371 \fBless\fR(1)
372 and
373 \fBmore\fR(1), until one is found\&. If no pager implementation is discovered, no pager is invoked\&. Setting those environment variables to an empty string or the value
374 "cat"
375 is equivalent to passing
376 \fB\-\-no\-pager\fR\&.
377 .sp
378 Note: if
379 \fI$SYSTEMD_PAGERSECURE\fR
380 is not set,
381 \fI$SYSTEMD_PAGER\fR
382 and
383 \fI$PAGER\fR
384 can only be used to disable the pager (with
385 "cat"
386 or
387 ""), and are otherwise ignored\&.
388 .RE
389 .PP
390 \fI$SYSTEMD_LESS\fR
391 .RS 4
392 Override the options passed to
393 \fBless\fR
394 (by default
395 "FRSXMK")\&.
396 .sp
397 Users might want to change two options in particular:
398 .PP
399 \fBK\fR
400 .RS 4
401 This option instructs the pager to exit immediately when
402 Ctrl+C
403 is pressed\&. To allow
404 \fBless\fR
405 to handle
406 Ctrl+C
407 itself to switch back to the pager command prompt, unset this option\&.
408 .sp
409 If the value of
410 \fI$SYSTEMD_LESS\fR
411 does not include
412 "K", and the pager that is invoked is
413 \fBless\fR,
414 Ctrl+C
415 will be ignored by the executable, and needs to be handled by the pager\&.
416 .RE
417 .PP
418 \fBX\fR
419 .RS 4
420 This option instructs the pager to not send termcap initialization and deinitialization strings to the terminal\&. It is set by default to allow command output to remain visible in the terminal even after the pager exits\&. Nevertheless, this prevents some pager functionality from working, in particular paged output cannot be scrolled with the mouse\&.
421 .RE
422 .sp
423 Note that setting the regular
424 \fI$LESS\fR
425 environment variable has no effect for
426 \fBless\fR
427 invocations by systemd tools\&.
428 .sp
429 See
430 \fBless\fR(1)
431 for more discussion\&.
432 .RE
433 .PP
434 \fI$SYSTEMD_LESSCHARSET\fR
435 .RS 4
436 Override the charset passed to
437 \fBless\fR
438 (by default
439 "utf\-8", if the invoking terminal is determined to be UTF\-8 compatible)\&.
440 .sp
441 Note that setting the regular
442 \fI$LESSCHARSET\fR
443 environment variable has no effect for
444 \fBless\fR
445 invocations by systemd tools\&.
446 .RE
447 .PP
448 \fI$SYSTEMD_PAGERSECURE\fR
449 .RS 4
450 Common pager commands like
451 \fBless\fR(1), in addition to "paging", i\&.e\&. scrolling through the output, support opening of or writing to other files and running arbitrary shell commands\&. When commands are invoked with elevated privileges, for example under
452 \fBsudo\fR(8)
453 or
454 \fBpkexec\fR(1), the pager becomes a security boundary\&. Care must be taken that only programs with strictly limited functionality are used as pagers, and unintended interactive features like opening or creation of new files or starting of subprocesses are not allowed\&. "Secure mode" for the pager may be enabled as described below,
455 \fIif the pager supports that\fR
456 (most pagers are not written in a way that takes this into consideration)\&. It is recommended to either explicitly enable "secure mode" or to completely disable the pager using
457 \fB\-\-no\-pager\fR
458 or
459 \fIPAGER=cat\fR
460 when allowing untrusted users to execute commands with elevated privileges\&.
461 .sp
462 This option takes a boolean argument\&. When set to true, the "secure mode" of the pager is enabled\&. In "secure mode",
463 \fBLESSSECURE=1\fR
464 will be set when invoking the pager, which instructs the pager to disable commands that open or create new files or start new subprocesses\&. Currently only
465 \fBless\fR(1)
466 is known to understand this variable and implement "secure mode"\&.
467 .sp
468 When set to false, no limitation is placed on the pager\&. Setting
469 \fISYSTEMD_PAGERSECURE=0\fR
470 or not removing it from the inherited environment may allow the user to invoke arbitrary commands\&.
471 .sp
472 When
473 \fI$SYSTEMD_PAGERSECURE\fR
474 is not set, systemd tools attempt to automatically figure out if "secure mode" should be enabled and whether the pager supports it\&. "Secure mode" is enabled if the effective UID is not the same as the owner of the login session, see
475 \fBgeteuid\fR(2)
476 and
477 \fBsd_pid_get_owner_uid\fR(3), or when running under
478 \fBsudo\fR(8)
479 or similar tools (\fI$SUDO_UID\fR
480 is set
481 \&\s-2\u[2]\d\s+2)\&. In those cases,
482 \fISYSTEMD_PAGERSECURE=1\fR
483 will be set and pagers which are not known to implement "secure mode" will not be used at all\&. Note that this autodetection only covers the most common mechanisms to elevate privileges and is intended as convenience\&. It is recommended to explicitly set
484 \fI$SYSTEMD_PAGERSECURE\fR
485 or disable the pager\&.
486 .sp
487 Note that if the
488 \fI$SYSTEMD_PAGER\fR
489 or
490 \fI$PAGER\fR
491 variables are to be honoured, other than to disable the pager,
492 \fI$SYSTEMD_PAGERSECURE\fR
493 must be set too\&.
494 .RE
495 .PP
496 \fI$SYSTEMD_COLORS\fR
497 .RS 4
498 Takes a boolean argument, or a special value\&. By default (unset),
499 \fBsystemd\fR
500 and related utilities will use colors in their output if possible\&. If
501 \fI$COLORTERM\fR
502 is set to
503 "truecolor"
504 or
505 "24bit", 24\-bit colors will be enabled, 256 colors otherwise, unless
506 \fI$NO_COLOR\fR
507 or
508 \fI$TERM\fR
509 indicates colors are disabled\&.
510 .PP
511 \fBtrue\fR
512 .RS 4
513 Same as unset, except that
514 \fI$NO_COLOR\fR
515 is ignored\&.
516 .RE
517 .PP
518 \fBfalse\fR
519 .RS 4
520 The output will be monochrome\&.
521 .RE
522 .PP
523 "16", "256", "24bit"
524 .RS 4
525 Always use the base 16 ANSI colors, 256 colors, or 24 bit color, respectively\&.
526 .RE
527 .PP
528 "auto\-16", "auto\-256", "auto\-24bit"
529 .RS 4
530 Use the given quantity of colours, subject to
531 \fI$TERM\fR, and what the console is connected to\&.
532 .RE
533 .RE
534 .PP
535 \fI$SYSTEMD_URLIFY\fR
536 .RS 4
537 The value must be a boolean\&. Controls whether clickable links should be generated in the output for terminal emulators supporting this\&. This can be specified to override the decision that
538 \fBsystemd\fR
539 makes based on
540 \fI$TERM\fR
541 and other conditions\&.
542 .RE
543 .SH "SEE ALSO"
544 .PP
545 \fBsystemd\fR(1), \[email protected]\fR(8), \[email protected]\fR(8), \fBvarlinkctl\fR(1), \fBmount\fR(8)
546 .SH "NOTES"
547 .IP " 1." 4
548 Varlink
549 .RS 4
550 \%https://varlink.org/
551 .RE
552 .IP " 2." 4
553 It is recommended for other tools to set and check
554 \fI$SUDO_UID\fR
555 as appropriate, treating it is a common interface.
556