Rename hash-start to hash-offset and switch to use bytes units.
[platform/upstream/cryptsetup.git] / man / veritysetup.8
1 .TH VERITYSETUP "8" "June 2012" "veritysetup" "Maintenance Commands"
2 .SH NAME
3 veritysetup - manage dm-verity (block level verification) volumes
4 .SH SYNOPSIS
5 .B veritysetup <options> <action> <action args>
6 .SH DESCRIPTION
7 .PP
8 Veritysetup is used to configure dm-verity managed device-mapper mappings.
9
10 Device-mapper verity target provides read-only transparent integrity
11 checking of block devices using kernel crypto API.
12
13 The dm-verity devices are always read-only.
14
15 Veritysetup supports these operations:
16 .PP
17 \fIformat\fR <data_device> <hash_device>
18 .IP
19 Calculates and permanently stores hash verification data for data_device.
20 Hash area can be located on the same device after data if specified
21 by \-\-hash\-offset option.
22
23 Note you need to provide root hash string for device verification
24 or activation. Root hash must be trusted.
25
26 If data or hash device argument points to regular file, veritysetup
27 allocates loopback device. In this case, hash file size must be enough
28 to store the hash area.
29
30 \fB<options>\fR can be [\-\-hash, \-\-no-superblock, \-\-format,
31 \-\-data-block-size, \-\-hash-block-size, \-\-data-blocks, \-\-hash-offset,
32 \-\-salt, \-\-uuid]
33 .PP
34 \fIcreate\fR <name> <data_device> <hash_device> <root_hash>
35 .IP
36 Creates a mapping with <name> backed by device <data_device> and using
37 <hash_device> for in-kernel verification.
38
39 The <root_hash> is a hexadecimal string.
40
41 \fB<options>\fR can be [\-\-hash-offset, \-\-no-superblock]
42
43 If option \-\-no-superblock is used, you have to use as the same options
44 as in initial format operation.
45 .PP
46 \fIremove\fR <name>
47 .IP
48 Removes existing mapping <name>.
49 .PP
50 \fIstatus\fR <name>
51 .IP
52 Reports status for the active verity mapping <name>.
53 .PP
54 \fIdump\fR <hash_device>
55 .IP
56 Reports parameters of verity device from on-disk stored superblock.
57
58 \fB<options>\fR can be [\-\-no-superblock]
59 .SH OPTIONS
60 .TP
61 .B "\-\-verbose, \-v"
62 Print more information on command execution.
63 .TP
64 .B "\-\-debug"
65 Run in debug mode with full diagnostic logs. Debug output
66 lines are always prefixed by '#'.
67 .TP
68 .B "\-\-no-superblock"
69 Create or use dm-verity without permanent on-disk superblock.
70 .TP
71 .B "\-\-format=number"
72 Specifies the hash version type.
73 Format type 0 is original Chrome OS verion. Format type 1 is current version.
74 .TP
75 .B "\-\-data-block-size=bytes"
76 Used block size for the data device.
77 (Note kernel supports only page-size as maximum here.)
78 .TP
79 .B "\-\-hash-block-size=bytes"
80 Used block size for the hash device.
81 (Note kernel supports only page-size as maximum here.)
82 .TP
83 .B "\-\-data-blocks=blocks"
84 Size of data device used in verification.
85 If not specified, the whole device is used.
86 .TP
87 .B "\-\-hash-offset=bytes"
88 Offset of hash area/superblock on hash_device.
89 Value must be aligned to disk sector offset.
90 .TP
91 .B "\-\-salt=hex string"
92 Salt used for format or verification.
93 Format is a hexadecimal string.
94 .TP
95 .B "\-\-uuid=UUID"
96 Use the provided UUID for format command instead of generating new one.
97
98 The UUID must be provided in standard UUID format,
99 e.g. 12345678-1234-1234-1234-123456789abc.
100 .TP
101 .B "\-\-version"
102 Show the program version.
103 .SH RETURN CODES
104 Veritysetup returns 0 on success and a non-zero value on error.
105
106 Error codes are: 1 wrong parameters, 2 no permission,
107 3 out of memory, 4 wrong device specified, 5 device already exists
108 or device is busy.
109 .SH REPORTING BUGS
110 Report bugs, including ones in the documentation, on
111 the cryptsetup mailing list at <dm-crypt@saout.de>
112 or in the 'Issues' section on LUKS website.
113 Please attach the output of the failed command with the
114 \-\-debug option added.
115 .SH AUTHORS
116 The first implementation of veritysetup was written by Chrome OS authors.
117
118 This version is based on verification code written by Mikulas Patocka <mpatocka@redhat.com>
119 and rewritten for libcryptsetup by Milan Broz <gmazyland@gmail.com>.
120 .SH COPYRIGHT
121 Copyright \(co 2012 Red Hat, Inc.
122
123 This is free software; see the source for copying conditions.  There is NO
124 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
125 .SH SEE ALSO
126 The project website at \fBhttp://code.google.com/p/cryptsetup/\fR
127
128 The verity on-disk format specification available at
129 \fBhttp://code.google.com/p/cryptsetup/wiki/DMVerity\fR