== OPTIONS ifdef::ACTION_LUKSFORMAT,ACTION_REENCRYPT[] *--align-payload *:: Align payload at a boundary of _value_ 512-byte sectors. + If not specified, cryptsetup tries to use the topology info provided by the kernel for the underlying device to get the optimal alignment. If not available (or the calculated value is a multiple of the default) data is by default aligned to a 1MiB boundary (i.e. 2048 512-byte sectors). + For a detached LUKS header, this option specifies the offset on the data device. See also the --header option. + *WARNING:* This option is DEPRECATED and has often unexpected impact to the data offset and keyslot area size (for LUKS2) due to the complex rounding. For fixed data device offset use _--offset_ option instead. endif::[] ifdef::ACTION_OPEN,ACTION_REFRESH[] *--allow-discards*:: Allow the use of discard (TRIM) requests for the device. This is also not supported for LUKS2 devices with data integrity protection. + *WARNING:* This command can have a negative security impact because it can make filesystem-level operations visible on the physical device. For example, information leaking filesystem type, used space, etc. may be extractable from the physical device if the discarded blocks can be located later. If in doubt, do not use it. + A kernel version of 3.1 or later is needed. For earlier kernels, this option is ignored. endif::[] ifdef::COMMON_OPTIONS[] *--batch-mode, -q*:: Suppresses all confirmation questions. Use with care! + If the --verify-passphrase option is not specified, this option also switches off the passphrase verification. endif::[] ifdef::ACTION_REENCRYPT[] *--block-size* _value_ *(LUKS1 only)*:: Use re-encryption block size of _value_ in MiB. + Values can be between 1 and 64 MiB. endif::[] ifdef::ACTION_CLOSE[] *--cancel-deferred*:: Removes a previously configured deferred device removal in _close_ command. endif::[] ifdef::ACTION_OPEN,ACTION_LUKSFORMAT,ACTION_REENCRYPT,ACTION_TCRYPTDUMP,ACTION_BENCHMARK[] *--cipher, -c* __:: ifdef::ACTION_OPEN,ACTION_TCRYPTDUMP[] Set the cipher specification string for _plain_ device type. + For _tcrypt_ device type it restricts checked cipher chains when looking for header. endif::[] ifndef::ACTION_REENCRYPT,ACTION_OPEN,ACTION_TCRYPTDUMP[] Set the cipher specification string. endif::[] ifdef::ACTION_REENCRYPT[] *LUKS2*: Set the cipher specification string for data segment only. + *LUKS1*: Set the cipher specification string for data segment and keyslots. + *NOTE*: In encrypt mode, if cipher specification is omitted the default cipher is applied. In reencrypt mode, if no new cipher specification is requested, the existing cipher will remain in use. Unless the existing cipher was "cipher_null". In that case default cipher would be applied as in encrypt mode. endif::[] ifdef::ACTION_OPEN,ACTION_LUKSFORMAT,ACTION_REENCRYPT[] + _cryptsetup --help_ shows the compiled-in defaults. + If a hash is part of the cipher specification, then it is used as part of the IV generation. For example, ESSIV needs a hash function, while "plain64" does not and hence none is specified. + For XTS mode you can optionally set a key size of 512 bits with the -s option. Key size for XTS mode is twice that for other modes for the same security level. endif::[] endif::[] ifdef::COMMON_OPTIONS[] *--debug or --debug-json*:: Run in debug mode with full diagnostic logs. Debug output lines are always prefixed by *#*. + If --debug-json is used, additional LUKS2 JSON data structures are printed. endif::[] ifdef::ACTION_REENCRYPT[] *--decrypt*:: Initialize (and run) device decryption mode. endif::[] ifdef::ACTION_CLOSE[] *--deferred*:: Defers device removal in _close_ command until the last user closes it. endif::[] ifdef::ACTION_OPEN,ACTION_REENCRYPT,ACTION_RESIZE[] *--device-size* _size[units]_:: ifndef::ACTION_RESIZE[] Instead of real device size, use specified value. endif::[] ifdef::ACTION_RESIZE[] Sets new size of the device. If unset real device size is used. endif::[] ifdef::ACTION_OPEN[] Usable only with _plain_ device type. endif::[] ifdef::ACTION_REENCRYPT[] It means that only specified area (from the start of the device to the specified size) will be reencrypted. + *WARNING:* This is destructive operation. Data beyond --device-size limit may be lost after operation gets finished. endif::[] + If no unit suffix is specified, the size is in bytes. + Unit suffix can be S for 512 byte sectors, K/M/G/T (or KiB,MiB,GiB,TiB) for units with 1024 base or KB/MB/GB/TB for 1000 base (SI scale). endif::[] ifdef::ACTION_LUKSFORMAT,ACTION_REENCRYPT[] *--disable-blkid*:: Disable use of blkid library for checking and wiping on-disk signatures. endif::[] ifdef::ACTION_OPEN,ACTION_LUKSRESUME,ACTION_RESIZE,ACTION_TOKEN[] *--disable-external-tokens*:: Disable loading of plugins for external LUKS2 tokens. endif::[] ifdef::ACTION_OPEN,ACTION_RESIZE,ACTION_REFRESH,ACTION_LUKSFORMAT,ACTION_LUKSRESUME,ACTION_TOKEN,ACTION_REENCRYPT[] *--disable-keyring*:: Do not load volume key in kernel keyring and store it directly in the dm-crypt target instead. This option is supported only for the LUKS2 type. endif::[] ifndef::ACTION_BENCHMARK,ACTION_BITLKDUMP,ACTION_TCRYPTDUMP[] *--disable-locks*:: Disable lock protection for metadata on disk. This option is valid only for LUKS2 and ignored for other formats. + ifdef::ACTION_REENCRYPT[] *NOTE:* With locking disabled LUKS2 images in files can be fully (re)encrypted offline without need for super user privileges provided used block ciphers are available in crypto backend. + endif::[] *WARNING:* Do not use this option unless you run cryptsetup in a restricted environment where locking is impossible to perform (where /run directory cannot be used). endif::[] ifdef::ACTION_OPEN,ACTION_TCRYPTDUMP[] *--disable-veracrypt*:: This option can be used to disable VeraCrypt compatible mode (only TrueCrypt devices are recognized). Only for TCRYPT extension. See _TCRYPT_ section in *cryptsetup*(8) for more info. endif::[] ifdef::ACTION_LUKSDUMP[] *--dump-json-metadata*:: For _luksDump_ (LUKS2 only) this option prints content of LUKS2 header JSON metadata area. endif::[] ifdef::ACTION_LUKSDUMP,ACTION_TCRYPTDUMP,ACTION_BITLKDUMP[] *--dump-volume-key, --dump-master-key (OBSOLETE alias)*:: Print the volume key in the displayed information. Use with care, as the volume key can be used to bypass the passphrases, see also option --volume-key-file. endif::[] ifdef::ACTION_REENCRYPT[] *--encrypt, --new, -N*:: Initialize (and run) device in-place encryption mode. endif::[] ifdef::ACTION_RESIZE,ACTION_OPEN,ACTION_LUKSADDKEY,ACTION_LUKSDUMP,ACTION_LUKSRESUME,ACTION_TOKEN[] *--external-tokens-path* _absolute_path_:: Override system directory path where cryptsetup searches for external token handlers (or token plugins). It must be absolute path (starting with '/' character). endif::[] ifdef::ACTION_REENCRYPT[] *--force-offline-reencrypt (LUKS2 only)*:: Bypass active device auto-detection and enforce offline reencryption. + This option is useful especially for reencryption of LUKS2 images put in files (auto-detection is not reliable in this scenario). + It may also help in case active device auto-detection on particular data device does not work or report errors. + *WARNING:* Use with extreme caution! This may destroy data if the device is activated and/or actively used. endif::[] ifdef::ACTION_LUKSFORMAT,ACTION_LUKSADDKEY,ACTION_LUKSCHANGEKEY,ACTION_LUKSCONVERTKEY,ACTION_REENCRYPT[] *--force-password*:: Do not use password quality checking for new LUKS passwords. + This option is ignored if cryptsetup is built without password quality checking support. + For more info about password quality check, see the manual page for *pwquality.conf(5)* and *passwdqc.conf(5)*. endif::[] ifdef::ACTION_OPEN,ACTION_LUKSFORMAT,ACTION_LUKSADDKEY,ACTION_LUKSCHANGEKEY,ACTION_LUKSCONVERTKEY,ACTION_TCRYPTDUMP,ACTION_BENCHMARK,ACTION_REENCRYPT[] *--hash, -h* __:: ifdef::ACTION_OPEN,ACTION_TCRYPTDUMP[] Specifies the passphrase hash. Applies to _plain_ and _loopaes_ device types only. + For _tcrypt_ device type, it restricts checked PBKDF2 variants when looking for header. endif::[] ifdef::ACTION_LUKSFORMAT[] Specifies the hash used in the LUKS key setup scheme and volume key digest. endif::[] ifndef::ACTION_REENCRYPT,ACTION_OPEN,ACTION_TCRYPTDUMP[] The specified hash is used for PBKDF2 and AF splitter. endif::[] ifdef::ACTION_REENCRYPT[] *LUKS1:* Specifies the hash used in the LUKS1 key setup scheme and volume key digest. + *NOTE*: if this parameter is not specified, default hash algorithm is always used for new LUKS1 device header. + *LUKS2:* Ignored unless new keyslot pbkdf algorithm is set to PBKDF2 (see --pbkdf). endif::[] + ifdef::ACTION_LUKSFORMAT[] The hash algorithm must provide at least 160 bits of output. Do not use a non-crypto hash like *xxhash* as this breaks security. Use _cryptsetup --help_ to show the defaults. endif::[] endif::[] ifndef::ACTION_BENCHMARK,ACTION_BITLKDUMP[] *--header *:: ifndef::ACTION_OPEN,ACTION_ERASE[] Use a detached (separated) metadata device or file where the LUKS header is stored. This option allows one to store ciphertext and LUKS header on different devices. + endif::[] ifdef::ACTION_OPEN[] Specify detached (separated) metadata device or file where the header is stored. + *WARNING:* There is no check whether the ciphertext device specified actually belongs to the header given. In fact, you can specify an arbitrary device as the ciphertext device with the --header option. Use with care. endif::[] ifndef::ACTION_REENCRYPT[] ifdef::ACTION_LUKSFORMAT[] With a file name as the argument to --header, the file will be automatically created if it does not exist. See the cryptsetup FAQ for header size calculation. + The --align-payload option is taken as absolute sector alignment on ciphertext device and can be zero. endif::[] ifndef::ACTION_LUKSFORMAT,ACTION_OPEN,ACTION_ERASE[] For commands that change the LUKS header (e.g. _luksAddKey_), specify the device or file with the LUKS header directly as the LUKS device. endif::[] endif::[] ifdef::ACTION_REENCRYPT[] If used with --encrypt/--new option, the header file will be created (or overwritten). Use with care. + *LUKS2*: For decryption mode the option may be used to export original LUKS2 header to a detached file. The passed future file must not exist at the time of initializing the decryption operation. This frees space in head of data device so that data can be moved at original LUKS2 header location. Later on decryption operation continues as if the ordinary detached header was passed. + *WARNING:* Never put exported header file in a filesystem on top of device you are about to decrypt! It would cause a deadlock. endif::[] ifdef::ACTION_ERASE[] Use to specify detached LUKS2 header when erasing HW OPAL enabled data device. endif::[] endif::[] ifdef::ACTION_LUKSHEADERBACKUP,ACTION_LUKSHEADERRESTORE[] *--header-backup-file *:: Specify file with header backup file. endif::[] ifdef::COMMON_OPTIONS[] *--help, -?*:: Show help text and default parameters. endif::[] ifdef::ACTION_REENCRYPT[] *--hotzone-size* _size_ *(LUKS2 only)*:: This option can be used to set an upper limit on the size of reencryption area (hotzone). The _size_ can be specified with unit suffix (for example 50M). Note that actual hotzone size may be less than specified due to other limitations (free space in keyslots area or available memory). + With decryption mode for devices with LUKS2 header placed in head of data device, the option specifies how large is the first data segment moved from original data offset pointer. endif::[] ifdef::ACTION_LUKSFORMAT[] *--hw-opal*:: Format LUKS2 device with dm-crypt encryption stacked on top HW based encryption configured on SED OPAL locking range. This option enables both SW and HW based data encryption. endif::[] ifdef::ACTION_ERASE[] *--hw-opal-factory-reset*:: Erase *ALL* data on the OPAL self-encrypted device, regardless of the partition it is ran on, if any, and does not require a valid LUKS2 header to be present on the device to run. After providing correct PSID via interactive prompt or via *--key-file* parameter the device is erased. endif::[] ifdef::ACTION_LUKSFORMAT[] *--hw-opal-only*:: Format LUKS2 device with HW based encryption configured on SED OPAL locking range only. LUKS2 format only manages locking range unlock key. This option enables HW based data encryption managed by SED OPAL drive only. + *NOTE*: Please note that with OPAL-only (--hw-opal-only) encryption, the configured OPAL administrator PIN (passphrase) allows unlocking all configured locking ranges without LUKS keyslot decryption (without knowledge of LUKS passphrase). Because of many observed problems with compatibility, cryptsetup currently DOES NOT use OPAL single-user mode, which would allow such decoupling of OPAL admin PIN access. endif::[] ifdef::ACTION_REENCRYPT[] *--init-only (LUKS2 only)*:: Initialize reencryption (any mode) operation in LUKS2 metadata only and exit. If any reencrypt operation is already initialized in metadata, the command with --init-only parameter fails. endif::[] ifdef::ACTION_LUKSFORMAT[] *--integrity *:: Specify integrity algorithm to be used for authenticated disk encryption in LUKS2. + *WARNING: This extension is EXPERIMENTAL* and requires dm-integrity kernel target (available since kernel version 4.12). For native AEAD modes, also enable "User-space interface for AEAD cipher algorithms" in "Cryptographic API" section (CONFIG_CRYPTO_USER_API_AEAD .config option). + For more info, see _AUTHENTICATED DISK ENCRYPTION_ section in *cryptsetup*(8). endif::[] ifdef::ACTION_LUKSFORMAT[] *--integrity-legacy-padding*:: Use inefficient legacy padding. + *WARNING*: Do not use this option until you need compatibility with specific old kernel. endif::[] ifdef::ACTION_REFRESH[] *--integrity-no-journal*:: Activate device with integrity protection without using data journal (direct write of data and integrity tags). Note that without journal power fail can cause non-atomic write and data corruption. Use only if journalling is performed on a different storage layer. endif::[] ifdef::ACTION_LUKSFORMAT[] *--integrity-no-wipe*:: Skip wiping of device authentication (integrity) tags. If you skip this step, sectors will report invalid integrity tag until an application write to the sector. + *NOTE:* Even some writes to the device can fail if the write is not aligned to page size and page-cache initiates read of a sector with invalid integrity tag. endif::[] ifdef::ACTION_LUKSFORMAT,ACTION_LUKSADDKEY,ACTION_LUKSCHANGEKEY,ACTION_LUKSCONVERTKEY,ACTION_REENCRYPT,ACTION_BENCHMARK[] *--iter-time, -i *:: ifndef::ACTION_REENCRYPT[] The number of milliseconds to spend with PBKDF passphrase processing. Specifying 0 as parameter selects the compiled-in default. endif::[] ifdef::ACTION_REENCRYPT[] The number of milliseconds to spend with PBKDF passphrase processing for the new LUKS header. endif::[] endif::[] ifdef::ACTION_OPEN[] *--iv-large-sectors*:: Count Initialization Vector (IV) in larger sector size (if set) instead of 512 bytes sectors. This option can be used only with _plain_ device type. + *NOTE:* This option does not have any performance or security impact, use it only for accessing incompatible existing disk images from other systems that require this option. endif::[] ifdef::ACTION_TOKEN[] *--json-file*:: Read token JSON from a file or write token to it. --json-file=- reads JSON from standard input or writes it to standard output respectively. endif::[] ifdef::ACTION_REENCRYPT[] *--keep-key*:: *LUKS2*: Do not change effective volume key and change other parameters provided it is requested. + *LUKS1*: Reencrypt only the LUKS1 header and keyslots. Skips data in-place reencryption. endif::[] ifdef::ACTION_TOKEN[] *--key-description *:: Set key description in keyring for use with _token_ command. endif::[] ifdef::ACTION_OPEN,ACTION_RESIZE,ACTION_LUKSFORMAT,ACTION_LUKSRESUME,ACTION_LUKSADDKEY,ACTION_LUKSREMOVEKEY,ACTION_LUKSCHANGEKEY,ACTION_LUKSCONVERTKEY,ACTION_LUKSKILLSLOT,ACTION_LUKSDUMP,ACTION_TCRYPTDUMP,ACTION_REENCRYPT,ACTION_REPAIR,ACTION_BITLKDUMP[] *--key-file, -d* _name_:: Read the passphrase from file. + If the name given is "-", then the passphrase will be read from stdin. In this case, reading will not stop at newline characters. + ifdef::ACTION_LUKSADDKEY,ACTION_LUKSCHANGEKEY[] The passphrase supplied via --key-file is always the passphrase for existing keyslot requested by the command. + ifdef::ACTION_LUKSADDKEY[] If you want to set a new passphrase via key file, you have to use a positional argument or parameter --new-keyfile. endif::[] ifdef::ACTION_LUKSCHANGEKEY[] If you want to set a new passphrase via key file, you have to use a positional argument. endif::[] + endif::[] ifdef::ACTION_OPEN[] *NOTE:* With _plain_ device type, the passphrase obtained via --key-file option is passed directly in dm-crypt. Unlike the interactive mode (stdin) where digest (--hash option) of the passphrase is passed in dm-crypt instead. + endif::[] ifndef::ACTION_REENCRYPT[] See section _NOTES ON PASSPHRASE PROCESSING_ in *cryptsetup*(8) for more information. endif::[] ifdef::ACTION_REENCRYPT[] *WARNING:* --key-file option can be used only if there is only one active keyslot, or alternatively, also if --key-slot option is specified (then all other keyslots will be disabled in new LUKS device). + If this option is not used, cryptsetup will ask for all active keyslot passphrases. endif::[] endif::[] ifdef::ACTION_ERASE[] *--key-file, -d* _name_ *(LUKS2 with HW OPAL only)*:: Read the Admin PIN or PSID (with --hw-opal-factory-reset) from file depending on options used. + If the name given is "-", then the secret will be read from stdin. In this case, reading will not stop at newline characters. + endif::[] ifdef::ACTION_OPEN,ACTION_RESIZE,ACTION_LUKSFORMAT,ACTION_LUKSRESUME,ACTION_LUKSADDKEY,ACTION_LUKSREMOVEKEY,ACTION_LUKSCHANGEKEY,ACTION_LUKSCONVERTKEY,ACTION_LUKSKILLSLOT,ACTION_LUKSDUMP,ACTION_REENCRYPT,ACTION_REPAIR,ACTION_BITLKDUMP[] *--keyfile-offset* _value_:: Skip _value_ bytes at the beginning of the key file. endif::[] ifdef::ACTION_OPEN,ACTION_RESIZE,ACTION_LUKSFORMAT,ACTION_LUKSRESUME,ACTION_LUKSADDKEY,ACTION_LUKSREMOVEKEY,ACTION_LUKSCHANGEKEY,ACTION_LUKSCONVERTKEY,ACTION_LUKSKILLSLOT,ACTION_LUKSDUMP,ACTION_REENCRYPT,ACTION_REPAIR,ACTION_BITLKDUMP[] *--keyfile-size, -l* _value_:: Read a maximum of _value_ bytes from the key file. The default is to read the whole file up to the compiled-in maximum that can be queried with --help. Supplying more data than the compiled-in maximum aborts the operation. + This option is useful to cut trailing newlines, for example. If --keyfile-offset is also given, the size count starts after the offset. endif::[] ifdef::ACTION_OPEN,ACTION_LUKSFORMAT,ACTION_REENCRYPT,ACTION_BENCHMARK,ACTION_LUKSADDKEY[] *--key-size, -s* _bits_:: ifndef::ACTION_LUKSADDKEY[] Sets key size in _bits_. The argument has to be a multiple of 8. The possible key-sizes are limited by the cipher and mode used. + See /proc/crypto for more information. Note that key-size in /proc/crypto is stated in bytes. + endif::[] ifdef::ACTION_LUKSADDKEY[] Provide volume key size in _bits_. The argument has to be a multiple of 8. + This option is required when parameter --volume-key-file is used to provide current volume key. Also, it is used when new unbound keyslot is created by specifying --unbound parameter. endif::[] ifdef::ACTION_OPEN[] This option can be used for _plain_ device type only. endif::[] ifndef::ACTION_REENCRYPT,ACTION_OPEN,ACTION_LUKSADDKEY[] This option can be used for _open --type plain_ or _luksFormat_. All other LUKS actions will use the key-size specified in the LUKS header. Use _cryptsetup --help_ to show the compiled-in defaults. endif::[] ifdef::ACTION_REENCRYPT[] *LUKS1*: If you are increasing key size, there must be enough space in the LUKS header for enlarged keyslots (data offset must be large enough) or reencryption cannot be performed. + If there is not enough space for keyslots with new key size, you can destructively shrink device with --reduce-device-size option. endif::[] endif::[] ifdef::ACTION_OPEN,ACTION_RESIZE,ACTION_LUKSFORMAT,ACTION_LUKSADDKEY,ACTION_LUKSCHANGEKEY,ACTION_LUKSCONVERTKEY,ACTION_LUKSDUMP,ACTION_LUKSRESUME,ACTION_TOKEN,ACTION_CONFIG,ACTION_TOKEN,ACTION_REPAIR,ACTION_REENCRYPT[] *--key-slot, -S <0-N>*:: ifdef::ACTION_LUKSADDKEY[] When used together with parameter --new-key-slot this option allows you to specify which key slot is selected for unlocking volume key. + *NOTE:* This option is ignored if existing volume key gets unlocked via LUKS2 token (--token-id, --token-type or --token-only parameters) or when volume key is provided directly via --volume-key-file parameter. + *NOTE:* To maintain backward compatibility, without --new-key-slot parameter, this option allows you to specify which key slot is selected for the new key. endif::[] ifndef::ACTION_OPEN,ACTION_LUKSADDKEY[] For LUKS operations that add key material, this option allows you to specify which key slot is selected for the new key. endif::[] ifdef::ACTION_OPEN[] This option selects a specific key-slot to compare the passphrase against. If the given passphrase would only match a different key-slot, the operation fails. endif::[] + ifdef::ACTION_REENCRYPT[] For reencryption mode it selects specific keyslot (and passphrase) that can be used to unlock new volume key. If used all other keyslots get removed after reencryption operation is finished. + endif::[] The maximum number of key slots depends on the LUKS version. LUKS1 can have up to 8 key slots. LUKS2 can have up to 32 key slots based on key slot area size and key size, but a valid key slot ID can always be between 0 and 31 for LUKS2. endif::[] ifdef::ACTION_LUKSFORMAT,ACTION_LUKSADDKEY,ACTION_LUKSCHANGEKEY,ACTION_LUKSCONVERTKEY,ACTION_REENCRYPT[] *--keyslot-cipher *:: This option can be used to set specific cipher encryption for the LUKS2 keyslot area. endif::[] ifdef::ACTION_LUKSFORMAT,ACTION_LUKSADDKEY,ACTION_LUKSCHANGEKEY,ACTION_LUKSCONVERTKEY,ACTION_REENCRYPT[] *--keyslot-key-size *:: This option can be used to set specific key size for the LUKS2 keyslot area. endif::[] ifdef::ACTION_LUKSFORMAT,ACTION_CONFIG,ACTION_REENCRYPT[] *--label