3 <!DOCTYPE refentry PUBLIC "-//OASIS//DTD DocBook XML V4.5//EN"
4 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
6 SPDX-License-Identifier: LGPL-2.1-or-later
8 This is based on crypttab(5).
11 <refentry id="veritytab" conditional='HAVE_LIBCRYPTSETUP' xmlns:xi="http://www.w3.org/2001/XInclude">
14 <title>veritytab</title>
15 <productname>systemd</productname>
19 <refentrytitle>veritytab</refentrytitle>
20 <manvolnum>5</manvolnum>
24 <refname>veritytab</refname>
25 <refpurpose>Configuration for verity block devices</refpurpose>
29 <para><filename>/etc/veritytab</filename></para>
33 <title>Description</title>
35 <para>The <filename>/etc/veritytab</filename> file describes
36 verity protected block devices that are set up during
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
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>
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>
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>
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>
56 <para>The fourth field is the <literal>roothash</literal> in hexadecimal.</para>
58 <para>The fifth field, if present, is a comma-delimited list of options. The following options are
61 <variablelist class='fstab-options'>
64 <term><option>superblock=<replaceable>BOOL</replaceable></option></term>
66 <listitem><para>Use dm-verity with or without permanent on-disk superblock.</para>
68 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
72 <term><option>format=<replaceable>NUMBER</replaceable></option></term>
74 <listitem><para>Specifies the hash version type. Format type 0 is original Chrome OS version. Format type 1 is
75 modern version.</para>
77 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
81 <term><option>data-block-size=<replaceable>BYTES</replaceable></option></term>
83 <listitem><para>Used block size for the data device. (Note kernel supports only page-size as maximum
84 here; Multiples of 512 bytes.) </para>
86 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
90 <term><option>hash-block-size=<replaceable>BYTES</replaceable></option></term>
92 <listitem><para>Used block size for the hash device. (Note kernel supports only page-size as maximum
93 here; Multiples of 512 bytes.)</para>
95 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
99 <term><option>data-blocks=<replaceable>BLOCKS</replaceable></option></term>
101 <listitem><para>Number of blocks of data device used in verification. If not specified, the whole device is
104 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
108 <term><option>hash-offset=<replaceable>BYTES</replaceable></option></term>
110 <listitem><para>Offset of hash area/superblock on <literal>hash-device</literal>. (Multiples of 512 bytes.)
113 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
117 <term><option>salt=<replaceable>HEX</replaceable></option></term>
119 <listitem><para>Salt used for format or verification. Format is a hexadecimal string; 256 bytes long maximum;
120 <literal>-</literal>is the special value for empty.</para>
122 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
126 <term><option>uuid=<replaceable>UUID</replaceable></option></term>
128 <listitem><para>Use the provided UUID for format command instead of generating new one. The UUID must be
129 provided in standard UUID format, e.g. 12345678-1234-1234-1234-123456789abc.</para>
131 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
132 <listitem><para></para></listitem>
136 <term><option>ignore-corruption</option></term>
137 <term><option>restart-on-corruption</option></term>
138 <term><option>panic-on-corruption</option></term>
140 <listitem><para>Defines what to do if a data verity problem is detected (data corruption). Without these
141 options kernel fails the IO operation with I/O error. With <literal>--ignore-corruption</literal> option the
142 corruption is only logged. With <literal>--restart-on-corruption</literal> or
143 <literal>--panic-on-corruption</literal> the kernel is restarted (panicked) immediately.
145 (You have to provide way how to avoid restart loops.)</para>
147 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
151 <term><option>ignore-zero-blocks</option></term>
153 <listitem><para>Instruct kernel to not verify blocks that are expected to contain zeroes and always directly
154 return zeroes instead.
156 WARNING: Use this option only in very specific cases. This option is available since Linux kernel version 4.5.
159 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
163 <term><option>check-at-most-once</option></term>
165 <listitem><para>Instruct kernel to verify blocks only the first time they are read from the data device, rather
168 WARNING: It provides a reduced level of security because only offline tampering of the data device's content
169 will be detected, not online tampering. This option is available since Linux kernel version 4.17.
172 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
176 <term><option>hash=<replaceable>HASH</replaceable></option></term>
178 <listitem><para>Hash algorithm for dm-verity. This should be the name of the algorithm, like "sha1". For default
179 see <command>veritysetup --help</command>.</para>
181 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
185 <term><option>fec-device=<replaceable>PATH</replaceable></option></term>
187 <listitem><para>Use forward error correction (FEC) to recover from corruption if hash verification fails. Use
188 encoding data from the specified device. The fec device argument can be block device or file image. For format,
189 if fec device path doesn't exist, it will be created as file. Note: block sizes for data and hash devices must
190 match. Also, if the verity data_device is encrypted the fec_device should be too.</para>
192 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
196 <term><option>fec-offset=<replaceable>BYTES</replaceable></option></term>
198 <listitem><para>This is the offset, in bytes, from the start of the FEC device to the beginning of the encoding
199 data. (Aligned on 512 bytes.)</para>
201 <xi:include href="version-info.xml" xpointer="v254"/></listitem>
205 <term><option>fec-roots=<replaceable>NUM</replaceable></option></term>
207 <listitem><para>Number of generator roots. This equals to the number of parity bytes in the encoding data. In
208 RS(M, N) encoding, the number of roots is M-N. M is 255 and M-N is between 2 and 24 (including).</para>
210 <xi:include href="version-info.xml" xpointer="v254"/>
215 <term><option>root-hash-signature=<replaceable>PATH</replaceable>|base64:<replaceable>HEX</replaceable></option></term>
217 <listitem><para>A base64 string encoding the root hash signature prefixed by <literal>base64:</literal> or a
218 path to roothash signature file used to verify the root hash (in kernel). This feature requires Linux kernel
219 version 5.4 or more recent.</para>
221 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
225 <term><option>_netdev</option></term>
227 <listitem><para>Marks this veritysetup device as requiring network. It will be
228 started after the network is available, similarly to
229 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
230 units marked with <option>_netdev</option>. The service unit to set up this device
231 will be ordered between <filename>remote-fs-pre.target</filename> and
232 <filename>remote-veritysetup.target</filename>, instead of
233 <filename>veritysetup-pre.target</filename> and
234 <filename>veritysetup.target</filename>.</para>
236 <para>Hint: if this device is used for a mount point that is specified in
237 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
238 the <option>_netdev</option> option should also be used for the mount
239 point. Otherwise, a dependency loop might be created where the mount point
240 will be pulled in by <filename>local-fs.target</filename>, while the
241 service to configure the network is usually only started <emphasis>after</emphasis>
242 the local file system has been mounted.</para>
244 <xi:include href="version-info.xml" xpointer="v248"/>
249 <term><option>noauto</option></term>
251 <listitem><para>This device will not be added to <filename>veritysetup.target</filename>.
252 This means that it will not be automatically enabled on boot, unless something else pulls
253 it in. In particular, if the device is used for a mount point, it'll be enabled
254 automatically during boot, unless the mount point itself is also disabled with
255 <option>noauto</option>.</para>
257 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
261 <term><option>nofail</option></term>
263 <listitem><para>This device will not be a hard dependency of
264 <filename>veritysetup.target</filename>. It'll still be pulled in and started, but the system
265 will not wait for the device to show up and be enabled, and boot will not fail if this is
266 unsuccessful. Note that other units that depend on the enabled device may still fail. In
267 particular, if the device is used for a mount point, the mount point itself also needs to
268 have the <option>nofail</option> option, or the boot will fail if the device is not enabled
271 <xi:include href="version-info.xml" xpointer="v248"/></listitem>
275 <term><option>x-initrd.attach</option></term>
277 <listitem><para>Setup this verity protected block device in the initrd, similarly to
278 <citerefentry><refentrytitle>systemd.mount</refentrytitle><manvolnum>5</manvolnum></citerefentry>
279 units marked with <option>x-initrd.mount</option>.</para>
281 <para>Although it's not necessary to mark the mount entry for the root file system with
282 <option>x-initrd.mount</option>, <option>x-initrd.attach</option> is still recommended with
283 the verity protected block device containing the root file system as otherwise systemd
284 will attempt to detach the device during the regular system shutdown while it's still in
285 use. With this option the device will still be detached but later after the root file
286 system is unmounted.</para>
288 <para>All other verity protected block devices that contain file systems mounted in the initrd should
289 use this option.</para>
291 <xi:include href="version-info.xml" xpointer="v248"/>
297 <para>At early boot and when the system manager configuration is
298 reloaded, this file is translated into native systemd units by
299 <citerefentry><refentrytitle>systemd-veritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>.</para>
303 <title>Examples</title>
305 <title>/etc/veritytab example</title>
306 <para>Set up two verity protected block devices. One using device blocks, another using files.</para>
308 <programlisting>usr PARTUUID=783e45ae-7aa3-484a-beef-a80ff9c19cbb PARTUUID=21dc1dfe-4c33-8b48-98a9-918a22eb3e37 36e3f740ad502e2c25e2a23d9c7c17bf0fdad2300b7580842d4b7ec1fb0fa263 auto
309 data /etc/data /etc/hash a5ee4b42f70ae1f46a08a7c92c2e0a20672ad2f514792730f5d49d7606ab8fdf auto
315 <title>See Also</title>
317 <citerefentry><refentrytitle>systemd</refentrytitle><manvolnum>1</manvolnum></citerefentry>,
318 <citerefentry><refentrytitle>systemd-veritysetup@.service</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
319 <citerefentry><refentrytitle>systemd-veritysetup-generator</refentrytitle><manvolnum>8</manvolnum></citerefentry>,
320 <citerefentry project='man-pages'><refentrytitle>fstab</refentrytitle><manvolnum>5</manvolnum></citerefentry>,
321 <citerefentry project='die-net'><refentrytitle>veritysetup</refentrytitle><manvolnum>8</manvolnum></citerefentry>,