Debian Codegraph @

man/systemd-mstack.xml

raw
1 <?xml version='1.0'?> <!--*-nxml-*-->
2 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
3 "http://www.oasis-open.org/docbook/xml/4.5/docbookx.dtd">
4 <!-- SPDX-License-Identifier: LGPL-2.1-or-later -->
5
6 <refentry id="systemd-mstack"
7 xmlns:xi="http://www.w3.org/2001/XInclude">
8
9 <refentryinfo>
10 <title>systemd-mstack</title>
11 <productname>systemd</productname>
12 </refentryinfo>
13
14 <refmeta>
15 <refentrytitle>systemd-mstack</refentrytitle>
16 <manvolnum>1</manvolnum>
17 </refmeta>
18
19 <refnamediv>
20 <refname>systemd-mstack</refname>
21 <refname>mount.mstack</refname>
22 <refpurpose>Mstack Discoverable Disk Images (DDIs)</refpurpose>
23 </refnamediv>
24
25 <refsynopsisdiv>
26 <cmdsynopsis>
27 <command>systemd-mstack</command> <arg choice="opt" rep="repeat">OPTIONS</arg> <arg choice="plain"><replaceable>IMAGE</replaceable></arg>
28 </cmdsynopsis>
29 <cmdsynopsis>
30 <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>
31 </cmdsynopsis>
32 <cmdsynopsis>
33 <command>systemd-mstack</command> <arg choice="opt" rep="repeat">OPTIONS</arg> <arg>--umount</arg> <arg choice="plain"><replaceable>PATH</replaceable></arg>
34 </cmdsynopsis>
35 </refsynopsisdiv>
36
37 <refsect1>
38 <title>Description</title>
39
40 <para><command>systemd-mstack</command> is a tool for introspecting and interacting with
41 <filename>.mstack/</filename> mount stack directories, as described in
42 <citerefentry><refentrytitle>systemd.mstack</refentrytitle><manvolnum>7</manvolnum></citerefentry>. It
43 supports three different operations:</para>
44
45 <orderedlist>
46 <listitem><para>Show general mount stack information, including all described
47 <literal>overlayfs</literal> layers and bind mounts.</para></listitem>
48
49 <listitem><para>Mount a mount stack to a local directory.</para></listitem>
50
51 <listitem><para>Unmount a mount stack from a local directory.</para></listitem>
52 </orderedlist>
53
54 <para>The <command>systemd-mstack</command> command may be invoked as <command>mount.mstack</command> in
55 which case it implements the <citerefentry
56 project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> "external
57 helper" interface. This ensures mount stack directories compatible with <command>systemd-mstack</command>
58 can be mounted directly by <command>mount</command> and <citerefentry
59 project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
60 details see below.</para>
61
62 <xi:include href="vpick.xml" xpointer="image"/>
63 </refsect1>
64
65 <refsect1>
66 <title>Commands</title>
67
68 <para>If neither of the command switches listed below are passed the specified mount stack is opened and
69 general information about it is shown, including a list of all defined layers.</para>
70
71 <variablelist>
72 <varlistentry>
73 <term><option>--mount</option></term>
74 <term><option>-m</option></term>
75
76 <listitem><para>Mount the specified mount stack to the specified directory.</para>
77
78 <para>To unmount a mount stack directory mounted like this use the <option>--umount</option> operation.</para>
79
80 <para>Note that this functionality is also available in <citerefentry
81 project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry> via a
82 command such as <command>mount -t mstack mystack.mstack targetdir/</command>, as well as in <citerefentry
83 project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>. For
84 details, see below.</para>
85
86 <xi:include href="version-info.xml" xpointer="v260"/></listitem>
87 </varlistentry>
88
89 <varlistentry>
90 <term><option>-M</option></term>
91
92 <listitem><para>This is a shortcut for <option>--mount --mkdir</option>.</para>
93
94 <xi:include href="version-info.xml" xpointer="v260"/></listitem>
95 </varlistentry>
96
97 <varlistentry>
98 <term><option>--umount</option></term>
99 <term><option>-u</option></term>
100
101 <listitem><para>Unmount a mount stack from the specified directory. This command expects one argument:
102 a directory where mount stack was mounted.</para>
103
104 <para>All mounted mounts will be recursively unmounted</para>
105
106 <xi:include href="version-info.xml" xpointer="v260"/></listitem>
107 </varlistentry>
108
109 <varlistentry>
110 <term><option>-U</option></term>
111
112 <listitem><para>This is a shortcut for <option>--umount --rmdir</option>.</para>
113
114 <xi:include href="version-info.xml" xpointer="v260"/></listitem>
115 </varlistentry>
116
117 <xi:include href="standard-options.xml" xpointer="help" />
118 <xi:include href="standard-options.xml" xpointer="version" />
119 </variablelist>
120
121 </refsect1>
122
123 <refsect1>
124 <title>Options</title>
125
126 <para>The following options are understood:</para>
127
128 <variablelist>
129 <varlistentry>
130 <term><option>--read-only</option></term>
131 <term><option>-r</option></term>
132
133 <listitem><para>Operate in read-only mode. By default, <option>--mount</option> will establish
134 writable mount points. If this option is specified they are established in read-only mode
135 instead.</para>
136
137 <xi:include href="version-info.xml" xpointer="v260"/></listitem>
138 </varlistentry>
139
140 <varlistentry>
141 <term><option>--mkdir</option></term>
142
143 <listitem><para>If combined with <option>--mount</option> the directory to mount the mount stack to
144 is created if it is missing. Note that the directory is not automatically removed when the mount
145 stack is unmounted again.</para>
146
147 <xi:include href="version-info.xml" xpointer="v260"/></listitem>
148 </varlistentry>
149
150 <varlistentry>
151 <term><option>--rmdir</option></term>
152
153 <listitem><para>If combined with <option>--umount</option> the specified directory where the mount stack
154 is mounted is removed after unmounting it.</para>
155
156 <xi:include href="version-info.xml" xpointer="v260"/></listitem>
157 </varlistentry>
158
159 <xi:include href="standard-options.xml" xpointer="image-policy-open" />
160 <xi:include href="standard-options.xml" xpointer="image-filter" />
161 <xi:include href="standard-options.xml" xpointer="no-pager" />
162 <xi:include href="standard-options.xml" xpointer="no-legend" />
163 <xi:include href="standard-options.xml" xpointer="json" />
164 </variablelist>
165 </refsect1>
166
167 <refsect1>
168 <title>Exit status</title>
169
170 <para>On success, 0 is returned, a non-zero failure code otherwise.</para>
171 </refsect1>
172
173 <refsect1>
174 <title>Invocation as <command>/sbin/mount.mstack</command></title>
175
176 <!-- In case you are wondering why this is spelled out with the /sbin/ prefix, rather than /usr/bin/ or
177 so, or omitting the prefix entirely: it's simply because util-linux mount always uses precisely this
178 spelling in their API docs. For example open mount(8), and grep for '/sbin/mount', and you see a ton
179 of occurrences. We just inherit this spelling here, to make clear this is just an instantiation of
180 their plugin mechanism. -->
181
182 <para>The <command>systemd-mstack</command> executable may be symlinked to
183 <filename>/sbin/mount.mstack</filename>. If invoked through that it implements <citerefentry
184 project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry>'s
185 "external helper" interface for the (pseudo) file system type <literal>mstack</literal>. This means
186 conformant mount stack directories may be mounted directly via</para>
187
188 <programlisting># mount -t mstack mystack.mstack targetdir/</programlisting>
189
190 <para>in a fashion mostly equivalent to:</para>
191
192 <programlisting># systemd-mstack --mount mystack.mstack targetdir/</programlisting>
193
194 <para>Note that since a single mount stack may contain multiple mount points it should later be unmounted with
195 <command>umount -R targetdir/</command>, for recursive operation.</para>
196
197 <para>This functionality is particularly useful to mount mount stacks automatically at boot via simple
198 <filename>/etc/fstab</filename> entries. For example:</para>
199
200 <programlisting>/path/to/mystack.nspawn /images/mystack/ mstack defaults 0 0</programlisting>
201
202 <para>When invoked this way the mount options <literal>ro</literal>, <literal>rw</literal> map to the
203 corresponding options listed above (i.e. <option>--read-only</option>).</para>
204 </refsect1>
205
206 <refsect1>
207 <title>See Also</title>
208 <para><simplelist type="inline">
209 <member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
210 <member><citerefentry><refentrytitle>systemd.mstack</refentrytitle><manvolnum>7</manvolnum></citerefentry></member>
211 <member><citerefentry><refentrytitle>systemd-nspawn</refentrytitle><manvolnum>1</manvolnum></citerefentry></member>
212 <member><citerefentry><refentrytitle>systemd.exec</refentrytitle><manvolnum>5</manvolnum></citerefentry></member>
213 <member><citerefentry project='man-pages'><refentrytitle>mount</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
214 <member><citerefentry project='man-pages'><refentrytitle>umount</refentrytitle><manvolnum>8</manvolnum></citerefentry></member>
215 </simplelist></para>
216 </refsect1>
217
218 </refentry>