1<?xml version="1.0"?>
2<!--*-nxml-*-->
3<!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4  "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
5<!--
6  SPDX-License-Identifier: LGPL-2.1-or-later
7
8This is based on crypttab(5).
9
10-->
11<refentry id="veritytab" conditional='HAVE_LIBCRYPTSETUP' xmlns:xi="http://www.w3.org/2001/XInclude">
12
13  <refentryinfo>
14    <title>veritytab</title>
15    <productname>systemd</productname>
16  </refentryinfo>
17
18  <refmeta>
19    <refentrytitle>veritytab</refentrytitle>
20    <manvolnum>5</manvolnum>
21  </refmeta>
22
23  <refnamediv>
24    <refname>veritytab</refname>
25    <refpurpose>Configuration for verity block devices</refpurpose>
26  </refnamediv>
27
28  <refsynopsisdiv>
29    <para><filename>/etc/veritytab</filename></para>
30  </refsynopsisdiv>
31
32  <refsect1>
33    <title>Description</title>
34
35    <para>The <filename>/etc/veritytab</filename> file describes
36    verity protected block devices that are set up during
37    system boot.</para>
38
39    <para>Empty lines and lines starting with the <literal>#</literal>
40    character are ignored. Each of the remaining lines describes one
41    verity protected block device. Fields are delimited by
42    white space.</para>
43
44    <para>Each line is in the form<programlisting><replaceable>volume-name</replaceable> <replaceable>data-device</replaceable> <replaceable>hash-device</replaceable> <replaceable>roothash</replaceable> <replaceable>options</replaceable></programlisting>
45    The first four fields are mandatory, the remaining one is optional.</para>
46
47    <para>The first field contains the name of the resulting verity volume; its block device is set up
48    below <filename>/dev/mapper/</filename>.</para>
49
50    <para>The second field contains a path to the underlying block data device, or a specification of a block device via
51    <literal>UUID=</literal> followed by the UUID.</para>
52
53    <para>The third field contains a path to the underlying block hash device, or a specification of a block device via
54    <literal>UUID=</literal> followed by the UUID.</para>
55
56    <para>The fourth field is the <literal>roothash</literal> in hexadecimal.</para>
57
58    <para>The fifth field, if present, is a comma-delimited list of options. The following options are
59    recognized:</para>
60
61    <variablelist class='fstab-options'>
62
63      <varlistentry>
64        <term><option>ignore-corruption</option></term>
65        <term><option>restart-on-corruption</option></term>
66        <term><option>panic-on-corruption</option></term>
67
68        <listitem><para>Defines what to do if a data verity problem is detected (data corruption). Without these
69        options kernel fails the IO operation with I/O error. With <literal>--ignore-corruption</literal> option the
70        corruption is only logged. With <literal>--restart-on-corruption</literal> or
71        <literal>--panic-on-corruption</literal> the kernel is restarted (panicked) immediately.
72
73        (You have to provide way how to avoid restart loops.)</para></listitem>
74      </varlistentry>
75
76      <varlistentry>
77        <term><option>ignore-zero-blocks</option></term>
78
79        <listitem><para>Instruct kernel to not verify blocks that are expected to contain zeroes and always directly
80        return zeroes instead.
81
82        WARNING: Use this option only in very specific cases. This option is available since Linux kernel version 4.5.
83        </para></listitem>
84      </varlistentry>
85
86      <varlistentry>
87        <term><option>check-at-most-once</option></term>
88
89        <listitem><para>Instruct kernel to verify blocks only the first time they are read from the data device, rather
90        than every time.
91
92        WARNING: It provides a reduced level of security because only offline tampering of the data device's content
93        will be detected, not online tampering. This option is available since Linux kernel version 4.17.
94        </para></listitem>
95      </varlistentry>
96
97      <varlistentry>
98        <term><option>root-hash-signature=<replaceable>PATH</replaceable>|base64:<replaceable>HEX</replaceable></option></term>
99
100        <listitem><para>A base64 string encoding the root hash signature prefixed by <literal>base64:</literal> or a
101        path to roothash signature file used to verify the root hash (in kernel). This feature requires Linux kernel
102        version 5.4 or more recent.</para></listitem>
103      </varlistentry>
104
105      <varlistentry>
106        <term><option>_netdev</option></term>
107
108        <listitem><para>Marks this veritysetup device as requiring network. It will be
109        started after the network is available, similarly to
110        <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
111        units marked with <option>_netdev</option>. The service unit to set up this device
112        will be ordered between <filename>remote-fs-pre.target</filename> and
113        <filename>remote-veritysetup.target</filename>, instead of
114        <filename>veritysetup-pre.target</filename> and
115        <filename>veritysetup.target</filename>.</para>
116
117        <para>Hint: if this device is used for a mount point that is specified in
118        <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
119        the <option>_netdev</option> option should also be used for the mount
120        point. Otherwise, a dependency loop might be created where the mount point
121        will be pulled in by <filename>local-fs.target</filename>, while the
122        service to configure the network is usually only started <emphasis>after</emphasis>
123        the local file system has been mounted.</para>
124        </listitem>
125      </varlistentry>
126
127      <varlistentry>
128        <term><option>noauto</option></term>
129
130        <listitem><para>This device will not be added to <filename>veritysetup.target</filename>.
131        This means that it will not be automatically enabled on boot, unless something else pulls
132        it in. In particular, if the device is used for a mount point, it'll be enabled
133        automatically during boot, unless the mount point itself is also disabled with
134        <option>noauto</option>.</para></listitem>
135      </varlistentry>
136
137      <varlistentry>
138        <term><option>nofail</option></term>
139
140        <listitem><para>This device will not be a hard dependency of
141        <filename>veritysetup.target</filename>. It'll still be pulled in and started, but the system
142        will not wait for the device to show up and be enabled, and boot will not fail if this is
143        unsuccessful. Note that other units that depend on the enabled device may still fail. In
144        particular, if the device is used for a mount point, the mount point itself also needs to
145        have the <option>nofail</option> option, or the boot will fail if the device is not enabled
146        successfully.</para></listitem>
147      </varlistentry>
148
149      <varlistentry>
150        <term><option>x-initrd.attach</option></term>
151
152        <listitem><para>Setup this verity protected block device in the initramfs, similarly to
153        <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
154        units marked with <option>x-initrd.mount</option>.</para>
155
156        <para>Although it's not necessary to mark the mount entry for the root file system with
157        <option>x-initrd.mount</option>, <option>x-initrd.attach</option> is still recommended with
158        the verity protected block device containing the root file system as otherwise systemd
159        will attempt to detach the device during the regular system shutdown while it's still in
160        use. With this option the device will still be detached but later after the root file
161        system is unmounted.</para>
162
163        <para>All other verity protected block devices that contain file systems mounted in the
164        initramfs should use this option.</para>
165        </listitem>
166      </varlistentry>
167
168    </variablelist>
169
170    <para>At early boot and when the system manager configuration is
171    reloaded, this file is translated into native systemd units by
172    <citerefentry><refentrytitle>systemd-veritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
173  </refsect1>
174
175  <refsect1>
176    <title>Examples</title>
177    <example>
178      <title>/etc/veritytab example</title>
179      <para>Set up two verity protected block devices. One using device blocks, another using files.</para>
180
181      <programlisting>usr  PARTUUID=783e45ae-7aa3-484a-beef-a80ff9c19cbb PARTUUID=21dc1dfe-4c33-8b48-98a9-918a22eb3e37 36e3f740ad502e2c25e2a23d9c7c17bf0fdad2300b7580842d4b7ec1fb0fa263 auto
182data /etc/data /etc/hash a5ee4b42f70ae1f46a08a7c92c2e0a20672ad2f514792730f5d49d7606ab8fdf auto
183</programlisting>
184    </example>
185  </refsect1>
186
187  <refsect1>
188    <title>See Also</title>
189    <para>
190      <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
191      <citerefentry><refentrytitle>systemd-veritysetup@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
192      <citerefentry><refentrytitle>systemd-veritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
193      <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
194      <citerefentry project='die-net'><refentrytitle>veritysetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
195    </para>
196  </refsect1>
197
198</refentry>
199