neulab/tldr huggingface dataset:
--stream-segment-threads THREADS The size of the thread pool used to download segments. Minimum value is 1 and maximum is 10.
--stream-segment-timeout TIMEOUT Segment connect and read timeout.
Default is: 10.0.
--stream-timeout TIMEOUT Timeout for reading data from streams.
This applies to all different kinds of stream types, such as DASH, HDS, HLS, HTTP, RTMP, etc.
Default is: 60.0.
--mux-subtitles Automatically mux available subtitles into the output stream.
Needs to be supported by the used plugin.
Supported plugins: funimationnow, pluzz, rtve, svtplay, vimeo
HDS options --hds-live-edge SECONDS The time live HDS streams will start from the edge of the stream.
HLS options --hls-live-edge SEGMENTS Number of segments from the live stream's current live position to begin streaming.  The size or length of each segment is determined by the streaming provider.
Lower values will decrease the latency, but will also increase the chance of buffering, as there is less time for Streamlink to download segments and write their data to the output buffer. The number of parallel segment downloads can be set with --stream-segment-threads and the HLS playlist reload time to fetch and queue new segments can be overridden with --hls-playlist-reload-time.
NOTE: During live playback, the caching/buffering settings of the used player will add additional latency. To adjust this, please refer to the player's own documentation for the required configuration. Player parameters can be set via --player-args.
--hls-playlist-reload-attempts ATTEMPTS How many attempts should be done to reload the HLS playlist before giving up.
--hls-playlist-reload-time TIME Set a custom HLS playlist reload time value, either in seconds or by using one of the following keywords:
segment: The duration of the last segment in the current playlist live-edge: The sum of segment durations of the live edge value minus one default: The playlist's target duration metadata
Default is: default.
--hls-segment-ignore-names NAMES A comma-delimited list of segment names that will get filtered out.
Example: --hls-segment-ignore-names 000,001,002
This will ignore every segment that ends with 000.ts, 001.ts and 002.ts
Default is: None.
--hls-segment-key-uri URI Override the segment encryption key URIs for encrypted streams.
The value can be templated using the following variables, which will be replaced with their respective part from the source segment URI:
{url} {scheme} {netloc} {path} {query}
--hls-segment-key-uri "https://example.com/hls/encryption_key" --hls-segment-key-uri "{scheme}://1.2.3.4{path}{query}" --hls-segment-key-uri "{scheme}://{netloc}/custom/path/to/key"
--hls-audio-select CODE Selects a specific audio source or sources, by language code or name, when multiple audio sources are available. Can be * to download all audio sources.
--hls-audio-select "English,German" --hls-audio-select "en,de" --hls-audio-select "*"
NOTE: This is only useful in special circumstances where the regular locale option fails, such as when multiple sources of the same language exists.
--hls-start-offset [HH:]MM:SS Amount of time to skip from the beginning of the stream. For live streams, this is a negative offset from the end of the stream (rewind).
Default is: 00:00:00.
--hls-duration [HH:]MM:SS Limit the playback duration, useful for watching segments of a stream.  The actual duration may be slightly longer, as it is rounded to the nearest HLS segment.
Default is: unlimited.
--hls-live-restart Skip to the beginning of a live stream, or as far back as possible.
RTMP options --rtmp-rtmpdump FILENAME RTMPDump is used to access RTMP streams. You can specify the location of the rtmpdump executable if it is not in your PATH.
Example: "/usr/local/bin/rtmpdump"
--rtmp-proxy PROXY A SOCKS proxy that RTMP streams will use.
Example: 127.0.0.1:9050
Subprocess options --subprocess-cmdline Print the command-line used internally to play the stream.
This is only available on RTMP streams.
--subprocess-errorlog Log possible errors from internal subprocesses to a temporary file. The file will be saved in your systems temporary directory.
Useful when debugging rtmpdump related issues.
--subprocess-errorlog-path PATH Log the subprocess errorlog to a specific file rather than a temporary file. Takes precedence over subprocess-errorlog.
FFmpeg options --ffmpeg-ffmpeg FILENAME FFMPEG is used to access or mux separate video and audio streams. You can specify the location of the ffmpeg executable if it is not in your PATH.
Example: "/usr/local/bin/ffmpeg"
--ffmpeg-verbose Write the console output from ffmpeg to the console.
--ffmpeg-verbose-path PATH Path to write the output from the ffmpeg console.
--ffmpeg-fout OUTFORMAT When muxing streams, set the output format to OUTFORMAT.
Default is: "matroska".
Example: "mpegts"
--ffmpeg-video-transcode CODEC When muxing streams, transcode the video to CODEC.
Default is: "copy".
Example: "h264"
--ffmpeg-audio-transcode CODEC When muxing streams, transcode the audio to CODEC.
Example: "aac"
--ffmpeg-copyts Forces the -copyts ffmpeg option and does not remove the initial start time offset value.
--ffmpeg-start-at-zero Enable the -start_at_zero ffmpeg option when using copyts.
--http-proxy HTTP_PROXY A HTTP proxy to use for all HTTP requests, including WebSocket connections.  By default this proxy will be used for all HTTPS requests too.
Example: "http://hostname:port/"
--https-proxy HTTPS_PROXY A HTTPS capable proxy to use for all HTTPS requests.
Example: "https://hostname:port/"
--http-cookie KEY=VALUE A cookie to add to each HTTP request.
Can be repeated to add multiple cookies.
--http-header KEY=VALUE A header to add to each HTTP request.
Can be repeated to add multiple headers.
--http-query-param KEY=VALUE A query parameter to add to each HTTP request.
Can be repeated to add multiple query parameters.
--http-ignore-env Ignore HTTP settings set in the environment such as environment variables (HTTP_PROXY, etc) or ~/.netrc authentication.
--http-no-ssl-verify Don't attempt to verify SSL certificates.
Usually a bad idea, only use this if you know what you're doing.
--http-disable-dh Disable Diffie Hellman key exchange
--http-ssl-cert FILENAME SSL certificate to use.
Expects a .pem file.
--http-ssl-cert-crt-key CRT_FILENAME KEY_FILENAME SSL certificate to use.
Expects a .crt and a .key file.
--http-timeout TIMEOUT General timeout used by all HTTP requests except the ones covered by other options.
Default is: 20.0.
Abweb --abweb-username USERNAME The username associated with your ABweb account, required to access any ABweb stream.
--abweb-password PASSWORD A ABweb account password to use with --abweb-username.
--abweb-purge-credentials Purge cached ABweb credentials to initiate a new session and reauthenticate.
Afreeca --afreeca-username USERNAME The username used to register with afreecatv.com.
--afreeca-password PASSWORD A afreecatv.com account password to use with --afreeca-username.
--afreeca-purge-credentials Purge cached AfreecaTV credentials to initiate a new session and reauthenticate.
Bbciplayer --bbciplayer-username USERNAME The username used to register with bbc.co.uk.
--bbciplayer-password PASSWORD A bbc.co.uk account password to use with --bbciplayer-username.
--bbciplayer-hd Prefer HD streams over local SD streams, some live programmes may not be broadcast in HD.
Clubbingtv --clubbingtv-username The username used to register with Clubbing TV.
--clubbingtv-password A Clubbing TV account password to use with --clubbingtv-username.
Crunchyroll --crunchyroll-username USERNAME A Crunchyroll username to allow access to restricted streams.
--crunchyroll-password [PASSWORD] A Crunchyroll password for use with --crunchyroll-username.
If left blank you will be prompted.
--crunchyroll-purge-credentials Purge cached Crunchyroll credentials to initiate a new session and reauthenticate.
--crunchyroll-session-id SESSION_ID Set a specific session ID for crunchyroll, can be used to bypass region restrictions. If using an authenticated session ID, it is recommended that the authentication parameters be omitted as the session ID is account specific.
NOTE: The session ID will be overwritten if authentication is used and the session ID does not match the account.
Funimationnow --funimation-email Email address for your Funimation account.
--funimation-password Password for your Funimation account.
--funimation-language The audio language to use for the stream; japanese or english.
Default is: "english".
Nicolive --niconico-email EMAIL The email or phone number associated with your Niconico account
--niconico-password PASSWORD The password of your Niconico account
--niconico-user-session VALUE Value of the user-session token (can be used in case you do not want to put your password here)
--niconico-purge-credentials Purge cached Niconico credentials to initiate a new session and reauthenticate.
--niconico-timeshift-offset [HH:]MM:SS Amount of time to skip from the beginning of a stream. Default is 00:00:00.
Openrectv --openrectv-email EMAIL The email associated with your openrectv account, required to access any openrectv stream.
--openrectv-password PASSWORD An openrectv account password to use with --openrectv-email.
Pixiv --pixiv-sessionid SESSIONID The pixiv.net sessionid that's used in pixivs PHPSESSID cookie. can be used instead of the username/password login process.
--pixiv-devicetoken DEVICETOKEN The pixiv.net device token that's used in pixivs device_token cookie.  can be used instead of the username/password login process.
--pixiv-purge-credentials Purge cached Pixiv credentials to initiate a new session and reauthenticate.
--pixiv-performer USER Select a co-host stream instead of the owner stream.
Sbscokr --sbscokr-id CHANNELID Channel ID to play.
streamlink http://play.sbs.co.kr/onair/pc/index.html best --sbscokr-id S01
Schoolism --schoolism-email EMAIL The email associated with your Schoolism account, required to access any Schoolism stream.
--schoolism-password PASSWORD A Schoolism account password to use with --schoolism-email.
--schoolism-part PART Play part number PART of the lesson, or assignment feedback video.
Defaults is 1.
Steam --steam-email EMAIL A Steam account email address to access friends/private streams
--steam-password PASSWORD A Steam account password to use with --steam-email.
Streann --streann-url URL Source URL where the iframe is located, only required for direct URLs of ott.streann.com
Twitcasting --twitcasting-password PASSWORD Password for private Twitcasting streams.
Twitch --twitch-disable-hosting Do not open the stream if the target channel is hosting another channel.
--twitch-disable-ads Skip embedded advertisement segments at the beginning or during a stream.  Will cause these segments to be missing from the stream.
--twitch-disable-reruns Do not open the stream if the target channel is currently broadcasting a rerun.
--twitch-low-latency Enables low latency streaming by prefetching HLS segments.  Sets --hls-live-edge to 2, if it is higher.  Reducing it to 1 will result in the lowest latency possible, but will most likely cause buffering.
In order to achieve true low latency streaming during playback, the player's caching/buffering settings will need to be adjusted and reduced to a value as low as possible, but still high enough to not cause any buffering.  This depends on the stream's bitrate and the quality of the connection to Twitch's servers. Please refer to the player's own documentation for the required configuration. Player parameters can be set via --player-args.
NOTE: Low latency streams have to be enabled by the broadcasters on Twitch themselves.  Regular streams can cause buffering issues with this option enabled due to the reduced --hls-live-edge value.
Ustreamtv --ustream-password PASSWORD A password to access password protected UStream.tv channels.
Ustvnow --ustvnow-username USERNAME Your USTV Now account username
--ustvnow-password PASSWORD Your USTV Now account password
Wwenetwork --wwenetwork-email EMAIL The email associated with your WWE Network account, required to access any WWE Network stream.
--wwenetwork-password PASSWORD A WWE Network account password to use with --wwenetwork-email.
Yupptv --yupptv-boxid BOXID The yupptv.com boxid that's used in the BoxId cookie.  Can be used instead of the username/password login process.
--yupptv-yuppflixtoken YUPPFLIXTOKEN The yupptv.com yuppflixtoken that's used in the YuppflixToken cookie.  Can be used instead of the username/password login process.
--yupptv-purge-credentials Purge cached YuppTV credentials to initiate a new session and reauthenticate.
Zattoo --zattoo-email EMAIL The email associated with your zattoo account, required to access any zattoo stream.
--zattoo-password PASSWORD A zattoo account password to use with --zattoo-email.
--zattoo-purge-credentials Purge cached zattoo credentials to initiate a new session and reauthenticate.
--zattoo-stream-types TYPES A comma-delimited list of stream types which should be used, the following types are allowed:
• dash
• hls7
Default is: "dash".
Streamlink Contributors
2021, Streamlink
CRYPTSETUP(8)                 Maintenance Commands                 CRYPTSETUP(8)
cryptsetup - manage plain dm-crypt and LUKS encrypted volumes
cryptsetup <options> <action> <action args>
cryptsetup is used to conveniently setup dm-crypt managed device-mapper mappings. These include plain dm-crypt volumes and LUKS volumes. The difference is that LUKS uses a metadata header and can hence offer more features than plain dm-crypt. On the other hand, the header is visible and vulnerable to damage.
In addition, cryptsetup provides limited support for the use of loop-AES volumes, TrueCrypt, VeraCrypt and BitLocker compatible volumes.
PLAIN DM-CRYPT OR LUKS? Unless you understand the cryptographic background well, use LUKS.  With plain dm-crypt there are a number of possible user errors that massively decrease security. While LUKS cannot fix them all, it can lessen the impact for many of them.
A lot of good information on the risks of using encrypted storage, on handling problems and on security aspects can be found in the Cryptsetup FAQ. Read it. Nonetheless, some risks deserve to be mentioned here.
Backup: Storage media die. Encryption has no influence on that.  Backup is mandatory for encrypted data as well, if the data has any worth. See the Cryptsetup FAQ for advice on how to do a backup of an encrypted volume.
Character encoding: If you enter a passphrase with special symbols, the passphrase can change depending on character encoding. Keyboard settings can also change, which can make blind input hard or impossible. For example, switching from some ASCII 8-bit variant to UTF-8 can lead to a different binary encoding and hence different passphrase seen by cryptsetup, even if what you see on the terminal is exactly the same. It is therefore highly recommended to select passphrase characters only from 7-bit ASCII, as the encoding for 7-bit ASCII stays the same for all ASCII variants and UTF-8.
LUKS header: If the header of a LUKS volume gets damaged, all data is permanently lost unless you have a header-backup.  If a key-slot is damaged, it can only be restored from a header-backup or if another active key-slot with known passphrase is undamaged.  Damaging the LUKS header is something people manage to do with surprising frequency. This risk is the result of a trade-off between security and safety, as LUKS is designed for fast and secure wiping by just overwriting header and key- slot area.
Previously used partitions: If a partition was previously used, it is a very good idea to wipe filesystem signatures, data, etc. before creating a LUKS or plain dm-crypt container on it.  For a quick removal of filesystem signatures, use "wipefs". Take care though that this may not remove everything. In particular, MD RAID signatures at the end of a device may survive. It also does not remove data. For a full wipe, overwrite the whole partition before container creation. If you do not know how to do that, the cryptsetup FAQ describes several options.
The following are valid actions for all supported device types.
open <device> <name> --type <device_type>
Opens (creates a mapping with) <name> backed by device <device>.
Device type can be plain, luks (default), luks1, luks2, loopaes or tcrypt.
For backward compatibility there are open command aliases:
create (argument-order <name> <device>): open --type plain plainOpen: open --type plain luksOpen: open --type luks loopaesOpen: open --type loopaes tcryptOpen: open --type tcrypt bitlkOpen: open --type bitlk
<options> are type specific and are described below for individual device types. For create, the order of the <name> and <device> options is inverted for historical reasons, all other aliases use the standard <device> <name> order.
close <name>
Removes the existing mapping <name> and wipes the key from kernel memory.
For backward compatibility there are close command aliases: remove, plainClose, luksClose, loopaesClose, tcryptClose (all behaves exactly the same, device type is determined automatically from active device).
<options> can be [--deferred] or [--cancel-deferred]
status <name>
Reports the status for the mapping <name>.
resize <name>
Resizes an active mapping <name>.
If --size (in 512-bytes sectors) or --device-size are not specified, the size is computed from the underlying device. For LUKS it is the size of the underlying device without the area reserved for LUKS header (see data payload offset in luksDump command).  For plain crypt device, the whole device size is used.
Note that this does not change the raw device geometry, it just changes how many sectors of the raw device are represented in the mapped device.
If cryptsetup detected volume key for active device loaded in kernel keyring service, resize action would first try to retrieve the key using a token and only if it failed it'd ask for a passphrase to unlock a keyslot (LUKS) or to derive a volume key again (plain mode).  The kernel keyring is used by default for LUKS2 devices.
With LUKS2 device additional <options> can be [--token-id, --token-only, --token-type, --key-slot, --key-file, --keyfile-size, --keyfile-offset, --timeout, --disable-external-tokens, --disable-locks, --disable-keyring].
refresh <name>
Refreshes parameters of active mapping <name>.
Updates parameters of active device <name> without need to deactivate the device (and umount filesystem). Currently it supports parameters refresh on following devices: LUKS1, LUKS2 (including authenticated encryption), plain crypt and loopaes.
Mandatory parameters are identical to those of an open action for respective device type.
You may change following parameters on all devices --perf-same_cpu_crypt, --perf-submit_from_crypt_cpus, --perf- no_read_workqueue, --perf-no_write_workqueue and --allow-discards.
Refreshing device without any optional parameter will refresh the device with default setting (respective to device type).
LUKS2 only:
--integrity-no-journal parameter affects only LUKS2 devices with underlying dm-integrity device.
Adding option --persistent stores any combination of device parameters above in LUKS2 metadata (only after successful refresh operation).
--disable-keyring parameter refreshes a device with volume key passed in dm-crypt driver.
reencrypt <device> or --active-name <name> [<new_name>]
Run resilient reencryption (LUKS2 device only).
There are 3 basic modes of operation:
• device reencryption (reencrypt)
• device encryption (reencrypt --encrypt)
• device decryption (reencrypt --decrypt)
<device> or --active-name <name> is mandatory parameter.
With <device> parameter cryptsetup looks up active <device> dm mapping.  If no active mapping is detected, it starts offline reencryption otherwise online reencryption takes place.
Reencryption process may be safely interrupted by a user via SIGTERM signal (ctrl+c).
To resume already initialized or interrupted reencryption, just run the cryptsetup reencrypt command again to continue the reencryption operation.  Reencryption may be resumed with different --resilience or --hotzone-size unless implicit datashift resilience mode is used (reencrypt --encrypt with --reduce-device- size option).
If the reencryption process was interrupted abruptly (reencryption process crash, system crash, poweroff) it may require recovery. The recovery is currently run automatically on next activation (action open) when needed.
Optional parameter <new_name> takes effect only with --encrypt option and it activates device <new_name> immediately after encryption initialization gets finished. That's useful when device needs to be ready as soon as possible and mounted (used) before full data area encryption is completed.
Action supports following additional <options> [--encrypt, --decrypt, --device-size, --resilience, --resilience-hash, --hotzone-size, --init-only, --resume-only, --reduce-device-size, --master-key-file, --key-size].
Plain dm-crypt encrypts the device sector-by-sector with a single, non- salted hash of the passphrase. No checks are performed, no metadata is used. There is no formatting operation.  When the raw device is mapped (opened), the usual device operations can be used on the mapped device, including filesystem creation.  Mapped devices usually reside in /dev/mapper/<name>.
The following are valid plain device type actions:
open --type plain <device> <name> create <name> <device> (OBSOLETE syntax)
<options> can be [--hash, --cipher, --verify-passphrase, --sector-size, --key-file, --keyfile-offset, --key-size, --offset, --skip, --size, --readonly, --shared, --allow-discards, --refresh]
Example: 'cryptsetup open --type plain /dev/sda10 e1' maps the raw encrypted device /dev/sda10 to the mapped (decrypted) device /dev/mapper/e1, which can then be mounted, fsck-ed or have a filesystem created on it.
LUKS, the Linux Unified Key Setup, is a standard for disk encryption.  It adds a standardized header at the start of the device, a key-slot area directly behind the header and the bulk data area behind that. The whole set is called a 'LUKS container'.  The device that a LUKS container resides on is called a 'LUKS device'.  For most purposes, both terms can be used interchangeably. But note that when the LUKS header is at a nonzero offset in a device, then the device is not a LUKS device anymore, but has a LUKS container stored in it at an offset.
LUKS can manage multiple passphrases that can be individually revoked or changed and that can be securely scrubbed from persistent media due to the use of anti-forensic stripes. Passphrases are protected against brute-force and dictionary attacks by PBKDF2, which implements hash iteration and salting in one function.
LUKS2 is a new version of header format that allows additional extensions like different PBKDF algorithm or authenticated encryption.  You can format device with LUKS2 header if you specify --type luks2 in luksFormat command.  For activation, the format is already recognized automatically.
Each passphrase, also called a key in this document, is associated with one of 8 key-slots.  Key operations that do not specify a slot affect the first slot that matches the supplied passphrase or the first empty slot if a new passphrase is added.
The <device> parameter can also be specified by a LUKS UUID in the format UUID=<uuid>. Translation to real device name uses symlinks in /dev/disk/by-uuid directory.
To specify a detached header, the --header parameter can be used in all LUKS commands and always takes precedence over the positional <device> parameter.
The following are valid LUKS actions:
luksFormat <device> [<key file>]
Initializes a LUKS partition and sets the initial passphrase (for key-slot 0), either via prompting or via <key file>. Note that if the second argument is present, then the passphrase is taken from the file given there, without the need to use the --key-file option. Also note that for both forms of reading the passphrase from a file you can give '-' as file name, which results in the passphrase being read from stdin and the safety-question being skipped.
You cannot call luksFormat on a device or filesystem that is mapped or in use, e.g. mounted filesysem, used in LVM, active RAID member etc.  The device or filesystem has to be un-mounted in order to call luksFormat.
To use LUKS2, specify --type luks2.
<options> can be [--hash, --cipher, --verify-passphrase, --key-size, --key-slot, --key-file (takes precedence over optional second argument), --keyfile-offset, --keyfile-size, --use-random | --use-urandom, --uuid, --master-key-file, --iter-time, --header, --pbkdf-force-iterations, --force-password, --disable-locks].
For LUKS2, additional <options> can be [--integrity, --integrity-no-wipe, --sector-size, --label, --subsystem, --pbkdf, --pbkdf-memory, --pbkdf-parallel, --disable-locks, --disable-keyring, --luks2-metadata-size, --luks2-keyslots-size, --keyslot-cipher, --keyslot-key-size].
WARNING: Doing a luksFormat on an existing LUKS container will make all data the old container permanently irretrievable unless you have a header backup.
open --type luks <device> <name> luksOpen <device> <name> (old syntax)
Opens the LUKS device <device> and sets up a mapping <name> after successful verification of the supplied passphrase.
First, the passphrase is searched in LUKS tokens. If it's not found in any token and also the passphrase is not supplied via --key-file, the command prompts for it interactively.
<options> can be [--key-file, --keyfile-offset, --keyfile-size, --readonly, --test-passphrase, --allow-discards, --header, --key- slot, --master-key-file, --token-id, --token-only, --token-type, --disable-external-tokens, --disable-keyring, --disable-locks, --type, --refresh, --serialize-memory-hard-pbkdf].
luksSuspend <name>
Suspends an active device (all IO operations will block and accesses to the device will wait indefinitely) and wipes the encryption key from kernel memory. Needs kernel 2.6.19 or later.
After this operation you have to use luksResume to reinstate the encryption key and unblock the device or close to remove the mapped device.
WARNING: never suspend the device on which the cryptsetup binary resides.
<options> can be [--header, --disable-locks].
luksResume <name>
Resumes a suspended device and reinstates the encryption key. Prompts interactively for a passphrase if --key-file is not given.
<options> can be [--key-file, --keyfile-size, --header, --disable-keyring, --disable-locks, --type]
luksAddKey <device> [<key file with new key>]
Adds a new passphrase. An existing passphrase must be supplied interactively or via --key-file.  The new passphrase to be added can be specified interactively or read from the file given as positional argument.
NOTE: with --unbound option the action creates new unbound LUKS2 keyslot. The keyslot cannot be used for device activation.  If you don't pass new key via --master-key-file option, new random key is generated. Existing passphrase for any active keyslot is not required.
<options> can be [--key-file, --keyfile-offset, --keyfile-size, --new-keyfile-offset, --new-keyfile-size, --key-slot, --master-key-file, --force-password, --header, --disable-locks, --iter-time, --pbkdf, --pbkdf-force-iterations, --unbound, --type, --keyslot-cipher, --keyslot-key-size].
luksRemoveKey <device> [<key file with passphrase to be removed>]
Removes the supplied passphrase from the LUKS device. The passphrase to be removed can be specified interactively, as the positional argument or via --key-file.
<options> can be [--key-file, --keyfile-offset, --keyfile-size, --header, --disable-locks, --type]
WARNING: If you read the passphrase from stdin (without further argument or with '-' as an argument to --key-file), batch-mode (-q) will be implicitly switched on and no warning will be given when you remove the last remaining passphrase from a LUKS container. Removing the last passphrase makes the LUKS container permanently inaccessible.
luksChangeKey <device> [<new key file>]
Changes an existing passphrase. The passphrase to be changed must be supplied interactively or via --key-file.  The new passphrase can be supplied interactively or in a file given as positional argument.
If a key-slot is specified (via --key-slot), the passphrase for that key-slot must be given and the new passphrase will overwrite the specified key-slot. If no key-slot is specified and there is still a free key-slot, then the new passphrase will be put into a free key-slot before the key-slot containing the old passphrase is purged. If there is no free key-slot, then the key-slot with the old passphrase is overwritten directly.
WARNING: If a key-slot is overwritten, a media failure during this operation can cause the overwrite to fail after the old passphrase has been wiped and make the LUKS container inaccessible.
<options> can be [--key-file, --keyfile-offset, --keyfile-size, --new-keyfile-offset, --iter-time, --pbkdf, --pbkdf-force-iterations, --new-keyfile-size, --key-slot, --force-password, --header, --disable-locks, --type, --keyslot-cipher, --keyslot-key-size].
luksConvertKey <device>
Converts an existing LUKS2 keyslot to new pbkdf parameters. The passphrase for keyslot to be converted must be supplied interactively or via --key-file. If no --pbkdf parameters are specified LUKS2 default pbkdf values will apply.
If a keyslot is specified (via --key-slot), the passphrase for that keyslot must be given. If no keyslot is specified and there is still a free keyslot, then the new parameters will be put into a free keyslot before the keyslot containing the old parameters is purged. If there is no free keyslot, then the keyslot with the old parameters is overwritten directly.
WARNING: If a keyslot is overwritten, a media failure during this operation can cause the overwrite to fail after the old parameters have been wiped and make the LUKS container inaccessible.
<options> can be [--key-file, --keyfile-offset, --keyfile-size, --key-slot, --header, --disable-locks, --iter-time, --pbkdf, --pbkdf-force-iterations, --pbkdf-memory, --pbkdf-parallel, --keyslot-cipher, --keyslot-key-size].
luksKillSlot <device> <key slot number>
Wipe the key-slot number <key slot> from the LUKS device. Except running in batch-mode (-q) a remaining passphrase must be supplied, either interactively or via --key-file.  This command can remove the last remaining key-slot, but requires an interactive confirmation when doing so. Removing the last passphrase makes a LUKS container permanently inaccessible.
<options> can be [--key-file, --keyfile-offset, --keyfile-size, --header, --disable-locks, --type].
NOTE: If there is no passphrase provided (on stdin or through --key-file argument) and batch-mode (-q) is active, the key-slot is removed without any other warning.
erase <device> luksErase <device>
Erase all keyslots and make the LUKS container permanently inaccessible.  You do not need to provide any password for this operation.
WARNING: This operation is irreversible.
luksUUID <device>
Print the UUID of a LUKS device. Set new UUID if --uuid option is specified.
isLuks <device>
Returns true, if <device> is a LUKS device, false otherwise.  Use option -v to get human-readable feedback. 'Command successful.' means the device is a LUKS device.
By specifying --type you may query for specific LUKS version.
luksDump <device>
Dump the header information of a LUKS device.
If the --dump-master-key option is used, the LUKS device master key is dumped instead of the keyslot info. Together with --master-key-file option, master key is dumped to a file instead of standard output. Beware that the master key cannot be changed without reencryption and can be used to decrypt the data stored in the LUKS container without a passphrase and even without the LUKS header. This means that if the master key is compromised, the whole device has to be erased or reencrypted to prevent further access. Use this option carefully.
To dump the master key, a passphrase has to be supplied, either interactively or via --key-file.
To dump unbound key (LUKS2 format only), --unbound parameter, specific --key-slot id and proper passphrase has to be supplied, either interactively or via --key-file.  Optional --master-key-file parameter enables unbound keyslot dump to a file.
To dump LUKS2 JSON metadata (without basic heade information like UUID) use --dump-json-metadata option.
<options> can be [--dump-master-key, --dump-json-metadata, --key-file, --keyfile-offset, --keyfile-size, --header, --disable-locks, --master-key-file, --type, --unbound, --key- slot].
WARNING: If --dump-master-key is used with --key-file and the argument to --key-file is '-', no validation question will be asked and no warning given.
luksHeaderBackup <device> --header-backup-file <file>
Stores a binary backup of the LUKS header and keyslot area. Note: Using '-' as filename writes the header backup to a file named '-'.
WARNING: This backup file and a passphrase valid at the time of backup allows decryption of the LUKS data area, even if the passphrase was later changed or removed from the LUKS device. Also note that with a header backup you lose the ability to securely wipe the LUKS device by just overwriting the header and key-slots. You either need to securely erase all header backups in addition or overwrite the encrypted data area as well.  The second option is less secure, as some sectors can survive, e.g. due to defect management.
luksHeaderRestore <device> --header-backup-file <file>
Restores a binary backup of the LUKS header and keyslot area from the specified file. Note: Using '-' as filename reads the header backup from a file named '-'.
WARNING: Header and keyslots will be replaced, only the passphrases from the backup will work afterward.
This command requires that the master key size and data offset of the LUKS header already on the device and of the header backup match. Alternatively, if there is no LUKS header on the device, the backup will also be written to it.
token <add|remove|import|export> <device>
Action add creates new keyring token to enable auto-activation of the device.  For the auto-activation, the passphrase must be stored in keyring with the specified description. Usually, the passphrase should be stored in user or user-session keyring.  The token command is supported only for LUKS2.
For adding new keyring token, option --key-description is mandatory.  Also, new token is assigned to key slot specified with --key-slot option or to all active key slots in the case --key-slot option is omitted.
To remove existing token, specify the token ID which should be removed with --token-id option.
WARNING: The action token remove removes any token type, not just keyring type from token slot specified by --token-id option.
Action import can store arbitrary valid token json in LUKS2 header. It may be passed via standard input or via file passed in --json-file option. If you specify --key-slot then successfully imported token is also assigned to the key slot.
Action export writes requested token json to a file passed with --json-file or to standard output.
<options> can be [--header, --token-id, --key-slot, --key-description, --disable-external-tokens, --disable-locks, --disable-keyring, --json-file].
convert <device> --type <format>
Converts the device between LUKS1 and LUKS2 format (if possible). The conversion will not be performed if there is an additional LUKS2 feature or LUKS1 has unsupported header size.
Conversion (both directions) must be performed on inactive device. There must not be active dm-crypt mapping established for LUKS header requested for conversion.
--type option is mandatory with following accepted values: luks1 or luks2.
WARNING: The convert action can destroy the LUKS header in the case of a crash during conversion or if a media error occurs. Always create a header backup before performing this operation!
<options> can be [--header, --type].
config <device>
Set permanent configuration options (store to LUKS header).  The config command is supported only for LUKS2.
The permanent options can be --priority to set priority (normal, prefer, ignore) for keyslot (specified by --key-slot) or --label and --subsystem.
<options> can be [--priority, --label, --subsystem, --key-slot, --header].
loop-AES EXTENSION cryptsetup supports mapping loop-AES encrypted partition using a compatibility mode.
open --type loopaes <device> <name> --key-file <keyfile> loopaesOpen <device> <name> --key-file <keyfile>  (old syntax)
Opens the loop-AES <device> and sets up a mapping <name>.
If the key file is encrypted with GnuPG, then you have to use --key-file=- and decrypt it before use, e.g. like this: gpg --decrypt <keyfile> | cryptsetup loopaesOpen --key-file=- <device> <name>
WARNING: The loop-AES extension cannot use the direct input of key file on real terminal because the keys are separated by end-of- line and only part of the multi-key file would be read. If you need it in script, just use the pipe redirection: echo $keyfile | cryptsetup loopaesOpen --key-file=- <device> <name>
Use --keyfile-size to specify the proper key length if needed.
Use --offset to specify device offset. Note that the units need to be specified in number of 512 byte sectors.
Use --skip to specify the IV offset. If the original device used an offset and but did not use it in IV sector calculations, you have to explicitly use --skip 0 in addition to the offset parameter.
Use --hash to override the default hash function for passphrase hashing (otherwise it is detected according to key size).
<options> can be [--key-file, --key-size, --offset, --skip, --hash, --readonly, --allow-discards, --refresh].
See also section 7 of the FAQ and http://loop-aes.sourceforge.net for more information regarding loop-AES.
TCRYPT (TrueCrypt-compatible and VeraCrypt) EXTENSION cryptsetup supports mapping of TrueCrypt, tcplay or VeraCrypt encrypted partition using a native Linux kernel API.  Header formatting and TCRYPT header change is not supported, cryptsetup never changes TCRYPT header on-device.
TCRYPT extension requires kernel userspace crypto API to be available (introduced in Linux kernel 2.6.38).  If you are configuring kernel yourself, enable "User-space interface for symmetric key cipher algorithms" in "Cryptographic API" section (CRYPTO_USER_API_SKCIPHER .config option).
Because TCRYPT header is encrypted, you have to always provide valid passphrase and keyfiles.
Cryptsetup should recognize all header variants, except legacy cipher chains using LRW encryption mode with 64 bits encryption block (namely Blowfish in LRW mode is not recognized, this is limitation of kernel crypto API).
VeraCrypt is just extension of TrueCrypt header with increased iteration count so unlocking can take quite a lot of time (in comparison with TCRYPT device).
To open a VeraCrypt device with a custom Personal Iteration Multiplier (PIM) value, use either the --veracrypt-pim=<PIM> option to directly specify the PIM on the command- line or use --veracrypt-query-pim to be prompted for the PIM.
The PIM value affects the number of iterations applied during key derivation. Please refer to https://www.veracrypt.fr/en/Personal%20Iterations%20Multiplier%20%28PIM%29.html for more detailed information.
If you need to disable VeraCrypt device support, use --disable-veracrypt option.
NOTE: Activation with tcryptOpen is supported only for cipher chains using LRW or XTS encryption modes.
The tcryptDump command should work for all recognized TCRYPT devices and doesn't require superuser privilege.
To map system device (device with boot loader where the whole encrypted system resides) use --tcrypt-system option.  You can use partition device as the parameter (parameter must be real partition device, not an image in a file), then only this partition is mapped.
If you have the whole TCRYPT device as a file image and you want to map multiple partition encrypted with system encryption, please create loopback mapping with partitions first (losetup -P, see losetup(8) man page for more info), and use loop partition as the device parameter.
If you use the whole base device as a parameter, one device for the whole system encryption is mapped. This mode is available only for backward compatibility with older cryptsetup versions which mapped TCRYPT system encryption using the whole device.
To use hidden header (and map hidden device, if available), use --tcrypt-hidden option.
To explicitly use backup (secondary) header, use --tcrypt-backup option.
NOTE: There is no protection for a hidden volume if the outer volume is mounted. The reason is that if there were any protection, it would require some metadata describing what to protect in the outer volume and the hidden volume would become detectable.
open --type tcrypt <device> <name> tcryptOpen <device> <name>  (old syntax)
Opens the TCRYPT (a TrueCrypt-compatible) <device> and sets up a mapping <name>.
<options> can be [--key-file, --tcrypt-hidden, --tcrypt-system, --tcrypt-backup, --readonly, --test-passphrase, --allow-discards, --disable-veracrypt, --veracrypt-pim, --veracrypt-query-pim, --header, --cipher, --hash].
The keyfile parameter allows a combination of file content with the passphrase and can be repeated. Note that using keyfiles is compatible with TCRYPT and is different from LUKS keyfile logic.
If --PBKDF2 variants with the specified hash algorithms are checked. This could speed up unlocking the device (but also it reveals some information about the container).
If you use --header in combination with hidden or system options, the header file must contain specific headers on the same positions as the original encrypted container.
WARNING: Option --allow-discards cannot be combined with option --tcrypt-hidden. For normal mapping, it can cause the destruction of hidden volume (hidden volume appears as unused space for outer volume so this space can be discarded).
tcryptDump <device>
Dump the header information of a TCRYPT device.
If the --dump-master-key option is used, the TCRYPT device master key is dumped instead of TCRYPT header info. Beware that the master key (or concatenated master keys if cipher chain is used) can be used to decrypt the data stored in the TCRYPT container without a passphrase.  This means that if the master key is compromised, the whole device has to be erased to prevent further access. Use this option carefully.
<options> can be [--dump-master-key, --key-file, --tcrypt-hidden, --tcrypt-system, --tcrypt-backup, --cipher, --hash].
The keyfile parameter allows a combination of file content with the passphrase and can be repeated.
See also https://en.wikipedia.org/wiki/TrueCrypt for more information regarding TrueCrypt.
Please note that cryptsetup does not use TrueCrypt code, please report all problems related to this compatibility extension to the cryptsetup project.
BITLK (Windows BitLocker-compatible) EXTENSION (EXPERIMENTAL) cryptsetup supports mapping of BitLocker and BitLocker to Go encrypted partition using a native Linux kernel API.  Header formatting and BITLK header changes are not supported, cryptsetup never changes BITLK header on-device.
WARNING: This extension is EXPERIMENTAL.
BITLK extension requires kernel userspace crypto API to be available (for details see TCRYPT section).
Cryptsetup should recognize all BITLK header variants, except legacy header used in Windows Vista systems and partially decrypted BitLocker devices.  Activation of legacy devices encrypted in CBC mode requires at least Linux kernel version 5.3 and for devices using Elephant diffuser kernel 5.6.
The bitlkDump command should work for all recognized BITLK devices and doesn't require superuser privilege.
For unlocking with the open a password or a recovery passphrase or a startup key must be provided.
Additionally unlocking using master key is supported. You must provide BitLocker Full Volume Encryption Key (FVEK) using the --master-key-file option. The key must be decrypted and without the header (only 128/256/512 bits of key data depending on used cipher and mode).
Other unlocking methods (TPM, SmartCard) are not supported.
open --type bitlk <device> <name> bitlkOpen <device> <name>  (old syntax)
Opens the BITLK (a BitLocker-compatible) <device> and sets up a mapping <name>.
<options> can be [--key-file, --readonly, --test-passphrase, --allow-discards --master-key-file].
bitlkDump <device>
Dump the header information of a BITLK device.
<options> can be [--dump-master-key --master-key-file].
Please note that cryptsetup does not use any Windows BitLocker code, please report all problems related to this compatibility extension to the cryptsetup project.
repair <device>
Tries to repair the device metadata if possible. Currently supported only for LUKS device type.
This command is useful to fix some known benign LUKS metadata header corruptions. Only basic corruptions of unused keyslot are fixable. This command will only change the LUKS header, not any key-slot data. You may enforce LUKS version by adding --type option.
WARNING: Always create a binary backup of the original header before calling this command.
benchmark <options>
Benchmarks ciphers and KDF (key derivation function).  Without parameters, it tries to measure few common configurations.
To benchmark other ciphers or modes, you need to specify --cipher and --key-size options or --hash for KDF test.
NOTE: This benchmark is using memory only and is only informative. You cannot directly predict real storage encryption speed from it.
For testing block ciphers, this benchmark requires kernel userspace crypto API to be available (introduced in Linux kernel 2.6.38).  If you are configuring kernel yourself, enable "User- space interface for symmetric key cipher algorithms" in "Cryptographic API" section (CRYPTO_USER_API_SKCIPHER .config option).
<options> can be [--cipher, --key-size, --hash].
--verbose, -v Print more information on command execution.
--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.
--type <device-type> Specifies required device type, for more info read BASIC ACTIONS section.
--hash, -h <hash-spec> Specifies the passphrase hash for open (for plain and loopaes device types).
Specifies the hash used in the LUKS key setup scheme and volume key digest for luksFormat. The specified hash is used as hash- parameter for PBKDF2 and for the AF splitter.
The specified hash name is passed to the compiled-in crypto backend.  Different backends may support different hashes.  For luksFormat, the hash algorithm must provide at least 160 bits of output, which excludes, e.g., MD5. Do not use a non-crypto hash like "crc32" as this breaks security.
Values compatible with old version of cryptsetup are "ripemd160" for open --type plain and "sha1" for luksFormat.
Use cryptsetup --help to show the defaults.
--cipher, -c <cipher-spec> Set the cipher specification string.
cryptsetup --help shows the compiled-in defaults.  The current default in the distributed sources is "aes-cbc-essiv:sha256" for plain dm-crypt and "aes-xts-plain64" for LUKS.
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.
XTS mode requires kernel 2.6.24 or later and plain64 requires kernel 2.6.33 or later. More information can be found in the FAQ.
--verify-passphrase, -y When interactively asking for a passphrase, ask for it twice and complain if both inputs do not match. Advised when creating a regular mapping for the first time, or when running luksFormat. Ignored on input from file or stdin.
--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.
With LUKS, passphrases supplied via --key-file are always the existing passphrases requested by a command, except in the case of luksFormat where --key-file is equivalent to the positional key file argument.
If you want to set a new passphrase via key file, you have to use a positional argument to luksAddKey.
See section NOTES ON PASSPHRASE PROCESSING for more information.
--keyfile-offset value Skip value bytes at the beginning of the key file.  Works with all commands that accept key files.
--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.