| 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-storage-fs_.service" |
| 7 |
xmlns:xi="http://www.w3.org/2001/XInclude"> |
| 8 |
|
| 9 |
<refentryinfo> |
| 10 |
<title>[email protected]</title> |
| 11 |
<productname>systemd</productname> |
| 12 |
</refentryinfo> |
| 13 |
|
| 14 |
<refmeta> |
| 15 |
<refentrytitle>[email protected]</refentrytitle> |
| 16 |
<manvolnum>8</manvolnum> |
| 17 |
</refmeta> |
| 18 |
|
| 19 |
<refnamediv> |
| 20 |
<refname>[email protected]</refname> |
| 21 |
<refname>systemd-storage-fs.socket</refname> |
| 22 |
<refname>systemd-storage-fs</refname> |
| 23 |
<refpurpose>Storage provider exposing regular files and directories as storage volumes</refpurpose> |
| 24 |
</refnamediv> |
| 25 |
|
| 26 |
<refsynopsisdiv> |
| 27 |
<para><filename>[email protected]</filename></para> |
| 28 |
<para><filename>systemd-storage-fs.socket</filename></para> |
| 29 |
</refsynopsisdiv> |
| 30 |
|
| 31 |
<refsect1> |
| 32 |
<title>Description</title> |
| 33 |
|
| 34 |
<para><filename>[email protected]</filename> is a service that implements the |
| 35 |
<constant>io.systemd.StorageProvider</constant> <ulink url="https://varlink.org/">Varlink</ulink> |
| 36 |
interface, exposing regular files and directories in <filename>/var/lib/storage/*.volume</filename> (if |
| 37 |
used in system mode) or <filename>$XDG_STATE_HOME/storage</filename> (when used in user mode) as storage |
| 38 |
volumes. Acquired volumes are returned to the caller as file descriptors. Unlike |
| 39 |
<citerefentry><refentrytitle>[email protected]</refentrytitle><manvolnum>8</manvolnum></citerefentry>, |
| 40 |
this implementation also supports creating new volumes on demand from a small set of built-in |
| 41 |
templates.</para> |
| 42 |
|
| 43 |
<para>The service is socket-activated via <filename>systemd-storage-fs.socket</filename>. In system mode |
| 44 |
it listens on the AF_UNIX socket <filename>/run/systemd/io.systemd.StorageProvider/fs</filename>, in user |
| 45 |
mode on <filename>$XDG_RUNTIME_DIR/systemd/io.systemd.StorageProvider/fs</filename>. See |
| 46 |
<citerefentry><refentrytitle>storagectl</refentrytitle><manvolnum>1</manvolnum></citerefentry> for an |
| 47 |
enumeration tool.</para> |
| 48 |
|
| 49 |
<para>See also |
| 50 |
<citerefentry><refentrytitle>[email protected]</refentrytitle><manvolnum>8</manvolnum></citerefentry> |
| 51 |
for a complementary implementation that exposes local block devices as storage volumes.</para> |
| 52 |
</refsect1> |
| 53 |
|
| 54 |
<refsect1> |
| 55 |
<title>Volumes</title> |
| 56 |
|
| 57 |
<para>Volumes are stored below the storage directory:</para> |
| 58 |
|
| 59 |
<itemizedlist> |
| 60 |
<listitem><para><filename>/var/lib/storage/</filename> when run in system mode.</para></listitem> |
| 61 |
|
| 62 |
<listitem><para><filename>$XDG_STATE_HOME/storage/</filename> (typically |
| 63 |
<filename>~/.local/state/storage/</filename>) when run in user mode.</para></listitem> |
| 64 |
</itemizedlist> |
| 65 |
|
| 66 |
<para>Each volume on disk is stored as a directory entry with a <filename>.volume</filename> suffix in |
| 67 |
the storage directory. Entries which are regular files are exposed as volumes of type |
| 68 |
<constant>reg</constant>; entries which are directories are exposed as volumes of type |
| 69 |
<constant>dir</constant>. Moreover, block device nodes may be symlinked (or bind mounted) into the |
| 70 |
directory, which are then exposed as volumes of type <constant>blk</constant>.</para> |
| 71 |
|
| 72 |
<para>For directory volumes, the root of the file system passed to clients is placed in a subdirectory |
| 73 |
<filename>root/</filename> of the <filename><replaceable>NAME</replaceable>.volume</filename> directory. The former (and all inodes |
| 74 |
below it) must be owned by the foreign UID range, the latter by the host's root.</para> |
| 75 |
|
| 76 |
<para>When acquiring a volume, symlinks are followed.</para> |
| 77 |
|
| 78 |
<para>An administrator is permitted to freely manipulate the volume hierarchy directly as long as the |
| 79 |
rules described above are followed. In particular, it's permitted to copy, mount or symlink arbitrary |
| 80 |
external resources (regardless if directory, regular file or block) into the volume directory, so that |
| 81 |
they are exposed as additional volumes.</para> |
| 82 |
</refsect1> |
| 83 |
|
| 84 |
<refsect1> |
| 85 |
<title>Templates</title> |
| 86 |
|
| 87 |
<para>The provider supports creating new volumes automatically when they are acquired. The caller may |
| 88 |
select a <emphasis>template</emphasis> that determines configuration details of the volume to create. The |
| 89 |
following built-in templates are available:</para> |
| 90 |
|
| 91 |
<variablelist> |
| 92 |
<varlistentry> |
| 93 |
<term><constant>sparse-file</constant></term> |
| 94 |
|
| 95 |
<listitem><para>Creates a volume backed by a sparsely populated regular file. This is the default |
| 96 |
template when creating a regular file volume. (Volume type is <literal>reg</literal>.)</para> |
| 97 |
|
| 98 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 99 |
</varlistentry> |
| 100 |
|
| 101 |
<varlistentry> |
| 102 |
<term><constant>allocated-file</constant></term> |
| 103 |
|
| 104 |
<listitem><para>Creates a volume backed by a fully allocated regular file. (Volume type is |
| 105 |
<literal>reg</literal>.)</para> |
| 106 |
|
| 107 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 108 |
</varlistentry> |
| 109 |
|
| 110 |
<varlistentry> |
| 111 |
<term><constant>directory</constant></term> |
| 112 |
|
| 113 |
<listitem><para>Creates a volume backed by a regular directory. (Volume type is |
| 114 |
<literal>dir</literal>.)</para> |
| 115 |
|
| 116 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 117 |
</varlistentry> |
| 118 |
|
| 119 |
<varlistentry> |
| 120 |
<term><constant>subvolume</constant></term> |
| 121 |
|
| 122 |
<listitem><para>Creates a btrfs subvolume as backing inode (falling back to a regular directory if |
| 123 |
the storage directory is not on btrfs). This is the default template when creating a directory |
| 124 |
volume. (Volume type is <literal>dir</literal>.)</para> |
| 125 |
|
| 126 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 127 |
</varlistentry> |
| 128 |
</variablelist> |
| 129 |
</refsect1> |
| 130 |
|
| 131 |
<refsect1> |
| 132 |
<title>Options</title> |
| 133 |
|
| 134 |
<para>The following command-line options are understood:</para> |
| 135 |
|
| 136 |
<variablelist> |
| 137 |
<varlistentry> |
| 138 |
<term><option>--system</option></term> |
| 139 |
|
| 140 |
<listitem><para>Operate in system mode. Volumes are stored below |
| 141 |
<filename>/var/lib/storage/</filename>. This is the default when invoked from |
| 142 |
<filename>[email protected]</filename> in the system manager.</para> |
| 143 |
|
| 144 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 145 |
</varlistentry> |
| 146 |
|
| 147 |
<varlistentry> |
| 148 |
<term><option>--user</option></term> |
| 149 |
|
| 150 |
<listitem><para>Operate in user mode. Volumes are stored below |
| 151 |
<filename>$XDG_STATE_HOME/storage/</filename>. This is the default when invoked from |
| 152 |
<filename>[email protected]</filename> in the user manager.</para> |
| 153 |
|
| 154 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 155 |
</varlistentry> |
| 156 |
|
| 157 |
<xi:include href="standard-options.xml" xpointer="help" /> |
| 158 |
<xi:include href="standard-options.xml" xpointer="version" /> |
| 159 |
</variablelist> |
| 160 |
</refsect1> |
| 161 |
|
| 162 |
<refsect1> |
| 163 |
<title>Files</title> |
| 164 |
|
| 165 |
<variablelist> |
| 166 |
<varlistentry> |
| 167 |
<term><filename>/var/lib/storage/</filename></term> |
| 168 |
<term><filename>$XDG_STATE_HOME/storage/</filename></term> |
| 169 |
|
| 170 |
<listitem><para>The storage directory used to back the system mode and user mode service |
| 171 |
instances respectively. Each volume is stored as an entry with a |
| 172 |
<filename>.volume</filename> suffix below this directory.</para> |
| 173 |
|
| 174 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 175 |
</varlistentry> |
| 176 |
|
| 177 |
<varlistentry> |
| 178 |
<term><filename>/run/systemd/io.systemd.StorageProvider/fs</filename></term> |
| 179 |
<term><filename>$XDG_RUNTIME_DIR/systemd/io.systemd.StorageProvider/fs</filename></term> |
| 180 |
|
| 181 |
<listitem><para>AF_UNIX sockets the service listens on, in system and user mode |
| 182 |
respectively. These are the canonical locations for the <literal>fs</literal> storage |
| 183 |
provider, and are enumerated by <command>storagectl providers</command>.</para> |
| 184 |
|
| 185 |
<xi:include href="version-info.xml" xpointer="v261"/></listitem> |
| 186 |
</varlistentry> |
| 187 |
</variablelist> |
| 188 |
</refsect1> |
| 189 |
|
| 190 |
<refsect1> |
| 191 |
<title>See Also</title> |
| 192 |
<para><simplelist type="inline"> |
| 193 |
<member><citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 194 |
<member><citerefentry><refentrytitle>storagectl</refentrytitle><manvolnum>1</manvolnum></citerefentry></member> |
| 195 |
<member><citerefentry><refentrytitle>[email protected]</refentrytitle><manvolnum>8</manvolnum></citerefentry></member> |
| 196 |
</simplelist></para> |
| 197 |
</refsect1> |
| 198 |
|
| 199 |
</refentry> |