1CRYPTSETUP-REPAIR(8) Maintenance Commands CRYPTSETUP-REPAIR(8)
2
3
4
6 cryptsetup-repair - repair the device metadata
7
9 cryptsetup repair [<options>] <device>
10
12 Tries to repair the device metadata if possible. Currently supported
13 only for LUKS device type.
14
15 This command is useful to fix some known benign LUKS metadata header
16 corruptions. Only basic corruptions of unused keyslot are fixable. This
17 command will only change the LUKS header, not any key-slot data. You
18 may enforce LUKS version by adding --type option.
19
20 It also repairs (upgrades) LUKS2 reencryption metadata by adding a
21 metadata digest that protects it against malicious changes.
22
23 If LUKS2 reencryption was interrupted in the middle of writing
24 reencryption segment the repair command can be used to perform
25 reencryption recovery so that reencryption can continue later.
26 Repairing reencryption requires verification of reencryption keyslot so
27 passphrase or keyfile is needed.
28
29 <options> can be [--timeout, --verify-passphrase, --disable-locks,
30 --type, --header, --key-file, --keyfile-size, --keyfile-offset,
31 --key-slot].
32
33 WARNING: Always create a binary backup of the original header before
34 calling this command.
35
37 --type <device-type>
38 Specifies required device type, for more info read BASIC ACTIONS
39 section in cryptsetup(8).
40
41 --verify-passphrase, -y
42 When interactively asking for a passphrase, ask for it twice and
43 complain if both inputs do not match. Ignored on input from file or
44 stdin.
45
46 --key-file, -d name
47 Read the passphrase from file.
48
49 If the name given is "-", then the passphrase will be read from
50 stdin. In this case, reading will not stop at newline characters.
51
52 See section NOTES ON PASSPHRASE PROCESSING in cryptsetup(8) for
53 more information.
54
55 --keyfile-offset value
56 Skip value bytes at the beginning of the key file.
57
58 --keyfile-size, -l value
59 Read a maximum of value bytes from the key file. The default is to
60 read the whole file up to the compiled-in maximum that can be
61 queried with --help. Supplying more data than the compiled-in
62 maximum aborts the operation.
63
64 This option is useful to cut trailing newlines, for example. If
65 --keyfile-offset is also given, the size count starts after the
66 offset.
67
68 --key-slot, -S <0-N>
69 For LUKS operations that add key material, this option allows you
70 to specify which key slot is selected for the new key.
71
72 The maximum number of key slots depends on the LUKS version. LUKS1
73 can have up to 8 key slots. LUKS2 can have up to 32 key slots based
74 on key slot area size and key size, but a valid key slot ID can
75 always be between 0 and 31 for LUKS2.
76
77 --timeout, -t <number of seconds>
78 The number of seconds to wait before timeout on passphrase input
79 via terminal. It is relevant every time a passphrase is asked. It
80 has no effect if used in conjunction with --key-file.
81
82 This option is useful when the system should not stall if the user
83 does not input a passphrase, e.g. during boot. The default is a
84 value of 0 seconds, which means to wait forever.
85
86 --header <device or file storing the LUKS header>
87 Use a detached (separated) metadata device or file where the LUKS
88 header is stored. This option allows one to store ciphertext and
89 LUKS header on different devices.
90
91 For commands that change the LUKS header (e.g. luksAddKey), specify
92 the device or file with the LUKS header directly as the LUKS
93 device.
94
95 --disable-locks
96 Disable lock protection for metadata on disk. This option is valid
97 only for LUKS2 and ignored for other formats.
98
99 WARNING: Do not use this option unless you run cryptsetup in a
100 restricted environment where locking is impossible to perform
101 (where /run directory cannot be used).
102
103 --batch-mode, -q
104 Suppresses all confirmation questions. Use with care!
105
106 If the --verify-passphrase option is not specified, this option
107 also switches off the passphrase verification.
108
109 --debug or --debug-json
110 Run in debug mode with full diagnostic logs. Debug output lines are
111 always prefixed by #.
112
113 If --debug-json is used, additional LUKS2 JSON data structures are
114 printed.
115
116 --version, -V
117 Show the program version.
118
119 --usage
120 Show short option help.
121
122 --help, -?
123 Show help text and default parameters.
124
126 Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or
127 in Issues project section
128 <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.
129
130 Please attach output of the failed command with --debug option added.
131
133 Cryptsetup FAQ
134 <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>
135
136 cryptsetup(8), integritysetup(8) and veritysetup(8)
137
139 Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.
140
141
142
143cryptsetup 2.6.1 2023-02-10 CRYPTSETUP-REPAIR(8)