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 With LUKS, the passphrase supplied via --key-file is always the
53 existing passphrase requested by a command, except in the case of
54 luksFormat where --key-file is equivalent to the positional key
55 file argument.
56
57 If you want to set a new passphrase via key file, you have to use a
58 positional argument to luksAddKey.
59
60 See section NOTES ON PASSPHRASE PROCESSING in cryptsetup(8) for
61 more information.
62
63 --keyfile-offset value
64 Skip value bytes at the beginning of the key file.
65
66 --keyfile-size, -l value
67 Read a maximum of value bytes from the key file. The default is to
68 read the whole file up to the compiled-in maximum that can be
69 queried with --help. Supplying more data than the compiled-in
70 maximum aborts the operation.
71
72 This option is useful to cut trailing newlines, for example. If
73 --keyfile-offset is also given, the size count starts after the
74 offset.
75
76 --key-slot, -S <0-N>
77 For LUKS operations that add key material, this option allows you
78 to specify which key slot is selected for the new key.
79
80 The maximum number of key slots depends on the LUKS version. LUKS1
81 can have up to 8 key slots. LUKS2 can have up to 32 key slots based
82 on key slot area size and key size, but a valid key slot ID can
83 always be between 0 and 31 for LUKS2.
84
85 --timeout, -t <number of seconds>
86 The number of seconds to wait before timeout on passphrase input
87 via terminal. It is relevant every time a passphrase is asked. It
88 has no effect if used in conjunction with --key-file.
89
90 This option is useful when the system should not stall if the user
91 does not input a passphrase, e.g. during boot. The default is a
92 value of 0 seconds, which means to wait forever.
93
94 --header <device or file storing the LUKS header>
95 Use a detached (separated) metadata device or file where the LUKS
96 header is stored. This option allows one to store ciphertext and
97 LUKS header on different devices.
98
99 For commands that change the LUKS header (e.g. luksAddKey), specify
100 the device or file with the LUKS header directly as the LUKS
101 device.
102
103 --disable-locks
104 Disable lock protection for metadata on disk. This option is valid
105 only for LUKS2 and ignored for other formats.
106
107 WARNING: Do not use this option unless you run cryptsetup in a
108 restricted environment where locking is impossible to perform
109 (where /run directory cannot be used).
110
111 --batch-mode, -q
112 Suppresses all confirmation questions. Use with care!
113
114 If the --verify-passphrase option is not specified, this option
115 also switches off the passphrase verification.
116
117 --debug or --debug-json
118 Run in debug mode with full diagnostic logs. Debug output lines are
119 always prefixed by #.
120
121 If --debug-json is used, additional LUKS2 JSON data structures are
122 printed.
123
124 --version, -V
125 Show the program version.
126
127 --usage
128 Show short option help.
129
130 --help, -?
131 Show help text and default parameters.
132
134 Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or
135 in Issues project section
136 <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.
137
138 Please attach output of the failed command with --debug option added.
139
141 Cryptsetup FAQ
142 <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>
143
144 cryptsetup(8), integritysetup(8) and veritysetup(8)
145
147 Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.
148
149
150
151cryptsetup 2.5.0 2022-07-28 CRYPTSETUP-REPAIR(8)