1CRYPTSETUP-RESIZE(8) Maintenance Commands CRYPTSETUP-RESIZE(8)
2
3
4
6 cryptsetup-resize - resize an active mapping
7
9 cryptsetup resize [<options>] <name>
10
12 Resizes an active mapping <name>.
13
14 If --size (in 512-bytes sectors) or --device-size are not specified,
15 the size is computed from the underlying device. For LUKS it is the
16 size of the underlying device without the area reserved for LUKS header
17 (see data payload offset in luksDump command). For plain crypt device,
18 the whole device size is used.
19
20 Note that this does not change the raw device geometry, it just changes
21 how many sectors of the raw device are represented in the mapped
22 device.
23
24 If cryptsetup detected volume key for active device loaded in kernel
25 keyring service, resize action would first try to retrieve the key
26 using a token. Only if it failed, it’d ask for a passphrase to unlock a
27 keyslot (LUKS) or to derive a volume key again (plain mode). The kernel
28 keyring is used by default for LUKS2 devices.
29
30 <options> can be [--size, --device-size, --token-id, --token-only,
31 --token-type, --key-slot, --key-file, --keyfile-size, --keyfile-offset,
32 --timeout, --disable-external-tokens, --disable-locks,
33 --disable-keyring, --verify-passphrase, --timeout].
34
36 --verify-passphrase, -y
37 When interactively asking for a passphrase, ask for it twice and
38 complain if both inputs do not match. Ignored on input from file or
39 stdin.
40
41 --key-file, -d name
42 Read the passphrase from file.
43
44 If the name given is "-", then the passphrase will be read from
45 stdin. In this case, reading will not stop at newline characters.
46
47 With LUKS, the passphrase supplied via --key-file is always the
48 existing passphrase requested by a command, except in the case of
49 luksFormat where --key-file is equivalent to the positional key
50 file argument.
51
52 If you want to set a new passphrase via key file, you have to use a
53 positional argument to luksAddKey.
54
55 See section NOTES ON PASSPHRASE PROCESSING in cryptsetup(8) for
56 more information.
57
58 --keyfile-offset value
59 Skip value bytes at the beginning of the key file.
60
61 --keyfile-size, -l value
62 Read a maximum of value bytes from the key file. The default is to
63 read the whole file up to the compiled-in maximum that can be
64 queried with --help. Supplying more data than the compiled-in
65 maximum aborts the operation.
66
67 This option is useful to cut trailing newlines, for example. If
68 --keyfile-offset is also given, the size count starts after the
69 offset.
70
71 --key-slot, -S <0-N>
72 For LUKS operations that add key material, this option allows you
73 to specify which key slot is selected for the new key.
74
75 The maximum number of key slots depends on the LUKS version. LUKS1
76 can have up to 8 key slots. LUKS2 can have up to 32 key slots based
77 on key slot area size and key size, but a valid key slot ID can
78 always be between 0 and 31 for LUKS2.
79
80 --size, -b <number of 512 byte sectors>
81 Set the size of the device in sectors of 512 bytes.
82
83 --device-size size[units]
84 Sets new size of the device. If unset real device size is used.
85
86 If no unit suffix is specified, the size is in bytes.
87
88 Unit suffix can be S for 512 byte sectors, K/M/G/T (or
89 KiB,MiB,GiB,TiB) for units with 1024 base or KB/MB/GB/TB for 1000
90 base (SI scale).
91
92 --timeout, -t <number of seconds>
93 The number of seconds to wait before timeout on passphrase input
94 via terminal. It is relevant every time a passphrase is asked. It
95 has no effect if used in conjunction with --key-file.
96
97 This option is useful when the system should not stall if the user
98 does not input a passphrase, e.g. during boot. The default is a
99 value of 0 seconds, which means to wait forever.
100
101 --header <device or file storing the LUKS header>
102 Use a detached (separated) metadata device or file where the LUKS
103 header is stored. This option allows one to store ciphertext and
104 LUKS header on different devices.
105
106 For commands that change the LUKS header (e.g. luksAddKey), specify
107 the device or file with the LUKS header directly as the LUKS
108 device.
109
110 --disable-external-tokens
111 Disable loading of plugins for external LUKS2 tokens.
112
113 --disable-locks
114 Disable lock protection for metadata on disk. This option is valid
115 only for LUKS2 and ignored for other formats.
116
117 WARNING: Do not use this option unless you run cryptsetup in a
118 restricted environment where locking is impossible to perform
119 (where /run directory cannot be used).
120
121 --disable-keyring
122 Do not load volume key in kernel keyring and store it directly in
123 the dm-crypt target instead. This option is supported only for the
124 LUKS2 type.
125
126 --token-id
127 Specify what token to use. If omitted, all available tokens will be
128 checked before proceeding further with passphrase prompt.
129
130 --token-only
131 Do not proceed further with action if token based keyslot unlock
132 failed. Without the option, action asks for passphrase to proceed
133 further.
134
135 --token-type
136 Restrict tokens eligible for operation to specific token type
137 (name). Mostly useful when no --token-id is specified.
138
139 --batch-mode, -q
140 Suppresses all confirmation questions. Use with care!
141
142 If the --verify-passphrase option is not specified, this option
143 also switches off the passphrase verification.
144
145 --debug or --debug-json
146 Run in debug mode with full diagnostic logs. Debug output lines are
147 always prefixed by #.
148
149 If --debug-json is used, additional LUKS2 JSON data structures are
150 printed.
151
152 --version, -V
153 Show the program version.
154
155 --usage
156 Show short option help.
157
158 --help, -?
159 Show help text and default parameters.
160
162 Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or
163 in Issues project section
164 <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.
165
166 Please attach output of the failed command with --debug option added.
167
169 Cryptsetup FAQ
170 <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>
171
172 cryptsetup(8), integritysetup(8) and veritysetup(8)
173
175 Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.
176
177
178
179cryptsetup 2.5.0 2022-07-28 CRYPTSETUP-RESIZE(8)