Merge branch 'reenc' of https://code.google.com/p/cryptsetup into reenc
[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 \fIverify\fR <data_device> <hash_device> <root_hash>
47 .IP
48 Verifies data on data_device with use of hash blocks stored on hash_device.
49
50 This command performs userspace verification, no kernel device is created.
51
52 The <root_hash> is a hexadecimal string.
53
54 \fB<options>\fR can be [\-\-hash-offset, \-\-no-superblock]
55
56 If option \-\-no-superblock is used, you have to use as the same options
57 as in initial format operation.
58 .PP
59 \fIremove\fR <name>
60 .IP
61 Removes existing mapping <name>.
62 .PP
63 \fIstatus\fR <name>
64 .IP
65 Reports status for the active verity mapping <name>.
66 .PP
67 \fIdump\fR <hash_device>
68 .IP
69 Reports parameters of verity device from on-disk stored superblock.
70
71 \fB<options>\fR can be [\-\-no-superblock]
72 .SH OPTIONS
73 .TP
74 .B "\-\-verbose, \-v"
75 Print more information on command execution.
76 .TP
77 .B "\-\-debug"
78 Run in debug mode with full diagnostic logs. Debug output
79 lines are always prefixed by '#'.
80 .TP
81 .B "\-\-no-superblock"
82 Create or use dm-verity without permanent on-disk superblock.
83 .TP
84 .B "\-\-format=number"
85 Specifies the hash version type.
86 Format type 0 is original Chrome OS verion. Format type 1 is current version.
87 .TP
88 .B "\-\-data-block-size=bytes"
89 Used block size for the data device.
90 (Note kernel supports only page-size as maximum here.)
91 .TP
92 .B "\-\-hash-block-size=bytes"
93 Used block size for the hash device.
94 (Note kernel supports only page-size as maximum here.)
95 .TP
96 .B "\-\-data-blocks=blocks"
97 Size of data device used in verification.
98 If not specified, the whole device is used.
99 .TP
100 .B "\-\-hash-offset=bytes"
101 Offset of hash area/superblock on hash_device.
102 Value must be aligned to disk sector offset.
103 .TP
104 .B "\-\-salt=hex string"
105 Salt used for format or verification.
106 Format is a hexadecimal string.
107 .TP
108 .B "\-\-uuid=UUID"
109 Use the provided UUID for format command instead of generating new one.
110
111 The UUID must be provided in standard UUID format,
112 e.g. 12345678-1234-1234-1234-123456789abc.
113 .TP
114 .B "\-\-version"
115 Show the program version.
116 .SH RETURN CODES
117 Veritysetup returns 0 on success and a non-zero value on error.
118
119 Error codes are: 1 wrong parameters, 2 no permission,
120 3 out of memory, 4 wrong device specified, 5 device already exists
121 or device is busy.
122 .SH REPORTING BUGS
123 Report bugs, including ones in the documentation, on
124 the cryptsetup mailing list at <dm-crypt@saout.de>
125 or in the 'Issues' section on LUKS website.
126 Please attach the output of the failed command with the
127 \-\-debug option added.
128 .SH AUTHORS
129 The first implementation of veritysetup was written by Chrome OS authors.
130
131 This version is based on verification code written by Mikulas Patocka <mpatocka@redhat.com>
132 and rewritten for libcryptsetup by Milan Broz <gmazyland@gmail.com>.
133 .SH COPYRIGHT
134 Copyright \(co 2012 Red Hat, Inc.
135
136 This is free software; see the source for copying conditions.  There is NO
137 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
138 .SH SEE ALSO
139 The project website at \fBhttp://code.google.com/p/cryptsetup/\fR
140
141 The verity on-disk format specification available at
142 \fBhttp://code.google.com/p/cryptsetup/wiki/DMVerity\fR