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 See section NOTES ON PASSPHRASE PROCESSING in cryptsetup(8) for
48 more information.
49
50 --keyfile-offset value
51 Skip value bytes at the beginning of the key file.
52
53 --keyfile-size, -l value
54 Read a maximum of value bytes from the key file. The default is to
55 read the whole file up to the compiled-in maximum that can be
56 queried with --help. Supplying more data than the compiled-in
57 maximum aborts the operation.
58
59 This option is useful to cut trailing newlines, for example. If
60 --keyfile-offset is also given, the size count starts after the
61 offset.
62
63 --key-slot, -S <0-N>
64 For LUKS operations that add key material, this option allows you
65 to specify which key slot is selected for the new key.
66
67 The maximum number of key slots depends on the LUKS version. LUKS1
68 can have up to 8 key slots. LUKS2 can have up to 32 key slots based
69 on key slot area size and key size, but a valid key slot ID can
70 always be between 0 and 31 for LUKS2.
71
72 --size, -b <number of 512 byte sectors>
73 Set the size of the device in sectors of 512 bytes.
74
75 --device-size size[units]
76 Sets new size of the device. If unset real device size is used.
77
78 If no unit suffix is specified, the size is in bytes.
79
80 Unit suffix can be S for 512 byte sectors, K/M/G/T (or
81 KiB,MiB,GiB,TiB) for units with 1024 base or KB/MB/GB/TB for 1000
82 base (SI scale).
83
84 --timeout, -t <number of seconds>
85 The number of seconds to wait before timeout on passphrase input
86 via terminal. It is relevant every time a passphrase is asked. It
87 has no effect if used in conjunction with --key-file.
88
89 This option is useful when the system should not stall if the user
90 does not input a passphrase, e.g. during boot. The default is a
91 value of 0 seconds, which means to wait forever.
92
93 --header <device or file storing the LUKS header>
94 Use a detached (separated) metadata device or file where the LUKS
95 header is stored. This option allows one to store ciphertext and
96 LUKS header on different devices.
97
98 For commands that change the LUKS header (e.g. luksAddKey), specify
99 the device or file with the LUKS header directly as the LUKS
100 device.
101
102 --disable-external-tokens
103 Disable loading of plugins for external LUKS2 tokens.
104
105 --disable-locks
106 Disable lock protection for metadata on disk. This option is valid
107 only for LUKS2 and ignored for other formats.
108
109 WARNING: Do not use this option unless you run cryptsetup in a
110 restricted environment where locking is impossible to perform
111 (where /run directory cannot be used).
112
113 --disable-keyring
114 Do not load volume key in kernel keyring and store it directly in
115 the dm-crypt target instead. This option is supported only for the
116 LUKS2 type.
117
118 --token-id
119 Specify what token to use and allow token PIN prompt to take
120 precedence over interative keyslot passphrase prompt. If omitted,
121 all available tokens (not protected by PIN) will be checked before
122 proceeding further with passphrase prompt.
123
124 --token-only
125 Do not proceed further with action if token based keyslot unlock
126 failed. Without the option, action asks for passphrase to proceed
127 further.
128
129 It allows LUKS2 tokens protected by PIN to take precedence over
130 interactive keyslot passphrase prompt.
131
132 --token-type type
133 Restrict tokens eligible for operation to specific token type.
134 Mostly useful when no --token-id is specified.
135
136 It allows LUKS2 type tokens protected by PIN to take precedence
137 over interactive keyslot passphrase prompt.
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.6.1 2023-02-10 CRYPTSETUP-RESIZE(8)