File: systemd-mstack.xml

package info (click to toggle)
systemd 260~rc1-2
  • links: PTS, VCS
  • area: main
  • in suites:
  • size: 114,856 kB
  • sloc: ansic: 741,078; xml: 122,218; sh: 36,483; python: 36,381; cpp: 947; makefile: 277; awk: 126; lisp: 13; sed: 1
file content (218 lines) | stat: -rw-r--r-- 9,610 bytes parent folder | download | duplicates (3)
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
<?xml version='1.0'?> <!--*-nxml-*-->
<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
  "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
<!-- SPDX-License-Identifier: LGPL-2.1-or-later -->

<refentry id="systemd-mstack"
    xmlns:xi="http://www.w3.org/2001/XInclude">

  <refentryinfo>
    <title>systemd-mstack</title>
    <productname>systemd</productname>
  </refentryinfo>

  <refmeta>
    <refentrytitle>systemd-mstack</refentrytitle>
    <manvolnum>1</manvolnum>
  </refmeta>

  <refnamediv>
    <refname>systemd-mstack</refname>
    <refname>mount.mstack</refname>
    <refpurpose>Mstack Discoverable Disk Images (DDIs)</refpurpose>
  </refnamediv>

  <refsynopsisdiv>
    <cmdsynopsis>
      <command>systemd-mstack</command> <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain"><replaceable>IMAGE</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>systemd-mstack</command> <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>--mount</arg> <arg choice="plain"><replaceable>IMAGE</replaceable></arg> <arg choice="plain"><replaceable>PATH</replaceable></arg>
    </cmdsynopsis>
    <cmdsynopsis>
      <command>systemd-mstack</command> <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>--umount</arg> <arg choice="plain"><replaceable>PATH</replaceable></arg>
    </cmdsynopsis>
  </refsynopsisdiv>

  <refsect1>
    <title>Description</title>

    <para><command>systemd-mstack</command> is a tool for introspecting and interacting with
    <filename>.mstack/</filename> mount stack directories, as described in
    <citerefentry><refentrytitle>systemd.mstack</refentrytitle><manvolnum>7</manvolnum></citerefentry>. It
    supports three different operations:</para>

    <orderedlist>
      <listitem><para>Show general mount stack information, including all described
      <literal>overlayfs</literal> layers and bind mounts.</para></listitem>

      <listitem><para>Mount a mount stack to a local directory.</para></listitem>

      <listitem><para>Unmount a mount stack from a local directory.</para></listitem>
    </orderedlist>

    <para>The <command>systemd-mstack</command> command may be invoked as <command>mount.mstack</command> in
    which case it implements the <citerefentry
    project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> "external
    helper" interface. This ensures mount stack directories compatible with <command>systemd-mstack</command>
    can be mounted directly by <command>mount</command> and <citerefentry
    project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
    details see below.</para>

    <xi:include href="vpick.xml" xpointer="image"/>
  </refsect1>

  <refsect1>
    <title>Commands</title>

    <para>If neither of the command switches listed below are passed the specified mount stack is opened and
    general information about it is shown, including a list of all defined layers.</para>

    <variablelist>
      <varlistentry>
        <term><option>--mount</option></term>
        <term><option>-m</option></term>

        <listitem><para>Mount the specified mount stack to the specified directory.</para>

        <para>To unmount a mount stack directory mounted like this use the <option>--umount</option> operation.</para>

        <para>Note that this functionality is also available in <citerefentry
        project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> via a
        command such as <command>mount -t mstack mystack.mstack targetdir/</command>, as well as in <citerefentry
        project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
        details, see below.</para>

        <xi:include href="version-info.xml" xpointer="v260"/></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-M</option></term>

        <listitem><para>This is a shortcut for <option>--mount --mkdir</option>.</para>

        <xi:include href="version-info.xml" xpointer="v260"/></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--umount</option></term>
        <term><option>-u</option></term>

        <listitem><para>Unmount a mount stack from the specified directory. This command expects one argument:
        a directory where mount stack was mounted.</para>

        <para>All mounted mounts will be recursively unmounted</para>

        <xi:include href="version-info.xml" xpointer="v260"/></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>-U</option></term>

        <listitem><para>This is a shortcut for <option>--umount --rmdir</option>.</para>

        <xi:include href="version-info.xml" xpointer="v260"/></listitem>
      </varlistentry>

      <xi:include href="standard-options.xml" xpointer="help" />
      <xi:include href="standard-options.xml" xpointer="version" />
    </variablelist>

  </refsect1>

  <refsect1>
    <title>Options</title>

    <para>The following options are understood:</para>

    <variablelist>
      <varlistentry>
        <term><option>--read-only</option></term>
        <term><option>-r</option></term>

        <listitem><para>Operate in read-only mode. By default, <option>--mount</option> will establish
        writable mount points. If this option is specified they are established in read-only mode
        instead.</para>

        <xi:include href="version-info.xml" xpointer="v260"/></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--mkdir</option></term>

        <listitem><para>If combined with <option>--mount</option> the directory to mount the mount stack to
        is created if it is missing. Note that the directory is not automatically removed when the mount
        stack is unmounted again.</para>

        <xi:include href="version-info.xml" xpointer="v260"/></listitem>
      </varlistentry>

      <varlistentry>
        <term><option>--rmdir</option></term>

        <listitem><para>If combined with <option>--umount</option> the specified directory where the mount stack
        is mounted is removed after unmounting it.</para>

        <xi:include href="version-info.xml" xpointer="v260"/></listitem>
      </varlistentry>

      <xi:include href="standard-options.xml" xpointer="image-policy-open" />
      <xi:include href="standard-options.xml" xpointer="image-filter" />
      <xi:include href="standard-options.xml" xpointer="no-pager" />
      <xi:include href="standard-options.xml" xpointer="no-legend" />
      <xi:include href="standard-options.xml" xpointer="json" />
    </variablelist>
  </refsect1>

  <refsect1>
    <title>Exit status</title>

    <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
  </refsect1>

  <refsect1>
    <title>Invocation as <command>/sbin/mount.mstack</command></title>

    <!-- In case you are wondering why this is spelled out with the /sbin/ prefix, rather than /usr/bin/ or
         so, or omitting the prefix entirely: it's simply because util-linux mount always uses precisely this
         spelling in their API docs. For example open mount(8), and grep for '/sbin/mount', and you see a ton
         of occurrences. We just inherit this spelling here, to make clear this is just an instantiation of
         their plugin mechanism. -->

    <para>The <command>systemd-mstack</command> executable may be symlinked to
    <filename>/sbin/mount.mstack</filename>. If invoked through that it implements <citerefentry
    project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
    "external helper" interface for the (pseudo) file system type <literal>mstack</literal>. This means
    conformant mount stack directories  may be mounted directly via</para>

    <programlisting># mount -t mstack mystack.mstack targetdir/</programlisting>

    <para>in a fashion mostly equivalent to:</para>

    <programlisting># systemd-mstack --mount mystack.mstack targetdir/</programlisting>

    <para>Note that since a single mount stack may contain multiple mount points it should later be unmounted with
    <command>umount -R targetdir/</command>, for recursive operation.</para>

    <para>This functionality is particularly useful to mount mount stacks automatically at boot via simple
    <filename>/etc/fstab</filename> entries. For example:</para>

    <programlisting>/path/to/mystack.nspawn /images/mystack/ mstack defaults 0 0</programlisting>

    <para>When invoked this way the mount options <literal>ro</literal>, <literal>rw</literal> map to the
    corresponding options listed above (i.e. <option>--read-only</option>).</para>
  </refsect1>

  <refsect1>
    <title>See Also</title>
    <para><simplelist type="inline">
      <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
      <member><citerefentry><refentrytitle>systemd.mstack</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
      <member><citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
      <member><citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
      <member><citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
      <member><citerefentry project='man-pages'><refentrytitle>umount</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
    </simplelist></para>
  </refsect1>

</refentry>