cryptsetup-reencrypt

title: cryptsetup-reencrypt(8)

summary: reencrypt LUKS encrypted volumes in\-place

text:
# cryptsetup-reencrypt(8)

## NAME
cryptsetup-reencrypt - reencrypt LUKS encrypted volumes in-place

## SYNOPSIS
cryptsetup reencrypt [<options>] <device> or --active-name <name> [<new_name>]

## DESCRIPTION
Run LUKS device reencryption.

There are 3 basic modes of operation:

•device reencryption (reencrypt)

•device encryption (reencrypt --encrypt/--new/-N)

•device decryption (reencrypt --decrypt)

<device> or --active-name <name> (LUKS2 only) is mandatory parameter.

Cryptsetup reencrypt action can be used to change reencryption parameters which otherwise require full on-disk data change (re-encryption). The reencrypt action reencrypts data on LUKS device in-place.

You can regenerate volume key (the real key used in on-disk encryption unclocked by passphrase), cipher, cipher mode or encryption sector size (LUKS2 only).

Reencryption process may be safely interrupted by a user via SIGINT signal (ctrl+c). Same applies to SIGTERM signal (i.e. issued by systemd during system shutdown).

For in-place encryption mode, the reencrypt action additionally takes all options available for luksFormat action for respective LUKS version (see cryptsetup-luksFormat man page for more details). See cryptsetup-luksFormat(8).

NOTE that for encrypt and decrypt mode, the whole device must be treated as unencrypted — there are no quarantees of confidentiality as part of the device contains plaintext.

ALWAYS BE SURE YOU HAVE RELIABLE BACKUP BEFORE USING THIS ACTION ON LUKS DEVICE.

<options> can be [--batch-mode, --block-size, --cipher, --debug, --debug-json, --decrypt, --device-size, --disable-locks, --encrypt, --force-offline-reencrypt, --hash, --header, --hotzone-size, --iter-time, --init-only, --keep-key, --key-file, --key-size, --key-slot, --keyfile-offset, --keyfile-size, --tries, --timeout, --pbkdf, --pbkdf-force-iterations, --pbkdf-memory, --pbkdf-parallel, --progress-frequency, --progress-json, --reduce-device-size, --resilience, --resilience-hash, --resume-only, --sector-size, --use-directio, --use-random, --use-urandom, --use-fsync, --uuid, --verbose, --volume-key-file, --write-log].

## LUKS2 REENCRYPTION
With <device> parameter cryptsetup looks up active <device> dm mapping. If no active mapping is detected, it starts offline LUKS2 reencryption otherwise online reencryption takes place.

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: either encrypt mode with --reduce-device-size option or decrypt mode with original LUKS2 header exported in --header file.

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 or explicitly by user (action repair).

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.

## LUKS1 REENCRYPTION
Current working directory must be writable and temporary files created during reencryption must be present. During reencryption process the LUKS1 device is marked unavailable and must be offline (no dm-crypt mapping or mounted filesystem).

WARNING: The LUKS1 reencryption code is not resistant to hardware or kernel failures during reencryption (you can lose your data in this case).

## OPTIONS
--block-size value (LUKS1 only)

Use re-encryption block size of value in MiB. Values can be between 1 and 64 MiB.

--use-directio (LUKS1 only)

Use direct-io (O_DIRECT) for all read/write data operations related to block device undergoing reencryption. Useful if direct-io operations perform better than normal buffered operations (e.g. in virtual environments).

--use-fsync (LUKS1 only)

Use fsync call after every written block. This applies for reencryption log files as well.

--write-log (LUKS1 only)

Update log file after every block write. This can slow down reencryption but will minimize data loss in the case of system crash.

--type <device-type>

Specifies required (encryption mode) or expected (other modes) LUKS format. Accepts only luks1 or luks2.

--hash, -h <hash-spec>

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).

--cipher, -c <cipher-spec>

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.

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.

--verify-passphrase, -y

When interactively asking for a passphrase, ask for it twice and complain if both inputs do not match. 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.

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.

--keyfile-offset value

Skip value bytes at the beginning of the key file.

--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.

--volume-key-file, --master-key-file (OBSOLETE alias)

Use (set) new volume key stored in a file.

WARNING: If you create your own volume key, you need to make sure to do it right. Otherwise, you can end up with a low-entropy or otherwise partially predictable volume key which will compromise security.

--use-random, --use-urandom

Define which kernel random number generator will be used to create the volume key.

--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.

--key-slot, -S <0-N>

For LUKS operations that add key material, this option allows you to specify which key slot is selected for the new key. 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.

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.

--key-size, -s bits

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.

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.

--offset, -o <number of 512 byte sectors>

Start offset in the backend device in 512-byte sectors. This option is only relevant for the encrypt mode. The --offset option sets the data offset (payload) of data device and must be aligned to 4096-byte sectors (must be multiple of 8). This option cannot be combined with --align-payload option.

--device-size size[units]

Instead of real device size, use specified value. 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.

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).

--pbkdf <PBKDF spec>

Set Password-Based Key Derivation Function (PBKDF) algorithm for LUKS keyslot. The PBKDF can be: pbkdf2 (for PBKDF2 according to RFC2898), argon2i for Argon2i or argon2id for Argon2id (see Argon2 <https://www.cryptolux.org/index.php/Argon2> for more info). For LUKS1, only PBKDF2 is accepted (no need to use this option). The default PBKDF for LUKS2 is set during compilation time and is available in cryptsetup --help output.

A PBKDF is used for increasing dictionary and brute-force attack cost for keyslot passwords. The parameters can be time, memory and parallel cost.

For PBKDF2, only time cost (number of iterations) applies. For Argon2i/id, there is also memory cost (memory required during the process of key derivation) and parallel cost (number of threads that run in parallel during the key derivation.

Note that increasing memory cost also increases time, so the final parameter values are measured by a benchmark. The benchmark tries to find iteration time (--iter-time) with required memory cost --pbkdf-memory. If it is not possible, the memory cost is decreased as well. The parallel cost --pbkdf-parallel is constant and is checked against available CPU cores.

You can see all PBKDF parameters for particular LUKS2 keyslot with cryptsetup-luksDump(8) command.

NOTE: If you do not want to use benchmark and want to specify all parameters directly, use --pbkdf-force-iterations with --pbkdf-memory and --pbkdf-parallel. This will override the values without benchmarking. Note it can cause extremely long unlocking time. Use only in specific cases, for example, if you know that the formatted device will be used on some small embedded system.

MINIMAL AND MAXIMAL PBKDF COSTS: For PBKDF2, the minimum iteration count is 1000 and maximum is 4294967295 (maximum for 32bit unsigned integer). Memory and parallel costs are unused for PBKDF2. For Argon2i and Argon2id, minimum iteration count (CPU cost) is 4 and maximum is 4294967295 (maximum for 32bit unsigned integer). Minimum memory cost is 32 KiB and maximum is 4 GiB. (Limited by addressable memory on some CPU platforms.) If the memory cost parameter is benchmarked (not specified by a parameter) it is always in range from 64 MiB to 1 GiB. The parallel cost minimum is 1 and maximum 4 (if enough CPUs cores are available, otherwise it is decreased).

--iter-time, -i <number of milliseconds>

The number of milliseconds to spend with PBKDF passphrase processing for the new LUKS header.

--pbkdf-memory <number>

Set the memory cost for PBKDF (for Argon2i/id the number represents kilobytes). Note that it is maximal value, PBKDF benchmark or available physical memory can decrease it. This option is not available for PBKDF2.

--pbkdf-parallel <number>

Set the parallel cost for PBKDF (number of threads, up to 4). Note that it is maximal value, it is decreased automatically if CPU online count is lower. This option is not available for PBKDF2.

--pbkdf-force-iterations <num>

Avoid PBKDF benchmark and set time cost (iterations) directly. It can be used for LUKS/LUKS2 device only. See --pbkdf option for more info.

--progress-frequency seconds

Print separate line every seconds with reencryption progress.

--progress-json

Prints progress data in JSON format suitable mostly for machine processing. It prints separate line every half second (or based on --progress-frequency value). The JSON output looks as follows during progress (except it’s compact single line):

```
{

  "device":"/dev/sda"       // backing device or file

  "device_bytes":"8192",    // bytes of I/O so far

  "device_size":"44040192", // total bytes of I/O to go

  "speed":"126877696",      // calculated speed in bytes per second (based on progress so far)

  "eta_ms":"2520012"        // estimated time to finish an operation in milliseconds

  "time_ms":"5561235"       // total time spent in IO operation in milliseconds
}
```

Note on numbers in JSON output: Due to JSON parsers limitations all numbers are represented in a string format due to need of full 64bit unsigned integers.

--timeout, -t <number of seconds>

The number of seconds to wait before timeout on passphrase input via terminal. It is relevant every time a passphrase is asked. It has no effect if used in conjunction with --key-file. This option is useful when the system should not stall if the user does not input a passphrase, e.g. during boot. The default is a value of 0 seconds, which means to wait forever.

--tries, -T

How often the input of the passphrase shall be retried. The default is 3 tries.

--align-payload <number of 512 byte sectors>

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.

--uuid <UUID>

When used in encryption mode use the provided UUID for the new LUKS header instead of generating a new one. LUKS1 (only in decryption mode): To find out what UUID to pass look for temporary files LUKS-UUID.[|log|org|new] of the interrupted decryption process.

The UUID must be provided in the standard UUID format, e.g. 12345678-1234-1234-1234-123456789abc.

--header <device or file storing the LUKS header>

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. 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.

--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.

--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).

--disable-locks

Disable lock protection for metadata on disk. This option is valid only for LUKS2 and ignored for other formats. 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.

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).

--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.

--sector-size bytes (LUKS2 only)

Reencrypt device with new encryption sector size enforced. WARNING: Increasing encryption sector size may break hosted filesystem. Do not run reencryption with --force-offline-reencrypt if unsure what block size was filesystem formatted with.

--label <LABEL> --subsystem <SUBSYSTEM>

Set label and subsystem description for LUKS2 device. The label and subsystem are optional fields and can be later used in udev scripts for triggering user actions once the device marked by these labels is detected.

--luks2-metadata-size <size>

This option can be used to enlarge the LUKS2 metadata (JSON) area. The size includes 4096 bytes for binary metadata (usable JSON area is smaller of the binary area). According to LUKS2 specification, only these values are valid: 16, 32, 64, 128, 256, 512, 1024, 2048 and 4096 kB The <size> can be specified with unit suffix (for example 128k).

--luks2-keyslots-size <size>

This option can be used to set specific size of the LUKS2 binary keyslot area (key material is encrypted there). The value must be aligned to multiple of 4096 bytes with maximum size 128MB. The <size> can be specified with unit suffix (for example 128k).

--keyslot-cipher <cipher-spec>

This option can be used to set specific cipher encryption for the LUKS2 keyslot area.

--keyslot-key-size <bits>

This option can be used to set specific key size for the LUKS2 keyslot area.

--encrypt, --new, -N

Initialize (and run) device in-place encryption mode.

--decrypt

Initialize (and run) device decryption mode.

--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.

--resume-only (LUKS2 only)

Resume reencryption (any mode) operation already described in LUKS2 metadata. If no reencrypt operation is initialized, the command with --resume-only parameter fails. Useful for resuming reencrypt operation without accidentally triggering new reencryption operation.

--resilience mode (LUKS2 only)

Reencryption resilience mode can be one of checksum, journal or none. checksum: default mode, where individual checksums of ciphertext hotzone sectors are stored, so the recovery process can detect which sectors were already reencrypted. It requires that the device sector write is atomic.

journal: the hotzone is journaled in the binary area (so the data are written twice).

none: performance mode. There is no protection and the only way it’s safe to interrupt the reencryption is similar to old offline reencryption utility.

Resilience modes can be changed unless datashift mode is used for operation initialization (encryption with --reduce-device-size option)

--resilience-hash hash (LUKS2 only)

The hash algorithm used with "--resilience checksum" only. The default hash is sha256. With other resilience modes, the hash parameter is ignored.

--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 <size> 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.

--reduce-device-size size

This means that last size sectors on the original device will be lost, data will be effectively shifted by specified number of sectors. It could be useful if you added some space to underlying partition or logical volume (so last size sectors contains no data).

For units suffix see --device-size parameter description.

WARNING: This is a destructive operation and cannot be reverted. Use with extreme care - accidentally overwritten filesystems are usually unrecoverable.

LUKS2: Initialize LUKS2 reencryption with data device size reduction (currently only encryption mode is supported).

Recommended minimal size is twice the default LUKS2 header size (--reduce-device-size 32M) for encryption mode.

LUKS1: Enlarge data offset to specified value by shrinking device size.

You cannot shrink device more than by 64 MiB (131072 sectors).

--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.

--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.

--version, -V

Show the program version.

--usage

Show short option help.

--help, -?

Show help text and default parameters.

## EXAMPLES
NOTE: You may drop --type luks2 option as long as LUKS2 format is default.

### LUKS2 ENCRYPTION EXAMPLES
Encrypt LUKS2 device (in-place). Make sure last 32 MiB on /dev/plaintext is unused (e.g.: does not contain filesystem data):

cryptsetup reencrypt --encrypt --type luks2 --reduce-device-size 32m /dev/plaintext_device

Encrypt LUKS2 device (in-place) with detached header put in a file:

cryptsetup reencrypt --encrypt --type luks2 --header my_luks2_header /dev/plaintext_device

Initialize LUKS2 in-place encryption operation only and activate the device (not yet encrypted):

cryptsetup reencrypt --encrypt --type luks2 --init-only --reduce-device-size 32m /dev/plaintext_device my_future_luks_device

Resume online encryption on device initialized in example above:

cryptsetup reencrypt --resume-only /dev/plaintext_device or cryptsetup reencrypt --active-name my_future_luks_device

### LUKS2 REENCRYPTION EXAMPLES
Reencrypt LUKS2 device (refresh volume key only):

cryptsetup reencrypt /dev/encrypted_device

### LUKS2 DECRYPTION EXAMPLES
Decrypt LUKS2 device with header put in head of data device (header file does not exist):

cryptsetup reencrypt --decrypt --header /export/header/to/file /dev/encrypted_device

Decrypt LUKS2 device with detached header (header file exists):

cryptsetup reencrypt --decrypt --header detached-luks2-header /dev/encrypted_device

Resume interrupted LUKS2 decryption:

cryptsetup reencrypt --resume-only --header luks2-hdr-file /dev/encrypted_device

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


cryptsetup-refresh

package: cryptsetup

title: cryptsetup-refresh(8)

summary: refresh parameters of an active mapping

text:
# cryptsetup-refresh(8)

## NAME
cryptsetup-refresh - refresh parameters of an active mapping

## SYNOPSIS
cryptsetup refresh [<options>] <name>

## DESCRIPTION
Refreshes parameters of active mapping <name>.

Updates parameters of active device <name> without the need to deactivate the device (and umount filesystem). Currently, it supports parameters refresh on following devices: LUKS1, LUKS2 (including authenticated encryption), plain crypt and loop-AES.

Mandatory parameters are identical to those of an open action for the 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 the device without any optional parameter will refresh the device with default setting (respective to device type).

LUKS2 only:

The --integrity-no-journal parameter affects only LUKS2 devices with the underlying dm-integrity device.

Adding option --persistent stores any combination of device parameters above in LUKS2 metadata (only after successful refresh operation).

The --disable-keyring parameter refreshes a device with volume key passed in dm-crypt driver.

<options> can be [--allow-discards, --perf-same_cpu_crypt, --perf-submit_from_crypt_cpus, --perf-no_read_workqueue, --perf-no_write_workqueue, --header, --disable-keyring, --disable-locks, --persistent, --integrity-no-journal].

## OPTIONS
--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.

--perf-same_cpu_crypt

Perform encryption using the same cpu that IO was submitted on. The default is to use an unbound workqueue so that encryption work is automatically balanced between available CPUs. NOTE: This option is available only for low-level dm-crypt performance tuning, use only if you need a change to default dm-crypt behaviour. Needs kernel 4.0 or later.

--perf-submit_from_crypt_cpus

Disable offloading writes to a separate thread after encryption. There are some situations where offloading write bios from the encryption threads to a single thread degrades performance significantly. The default is to offload write bios to the same thread. NOTE: This option is available only for low-level dm-crypt performance tuning, use only if you need a change to default dm-crypt behaviour. Needs kernel 4.0 or later.

--perf-no_read_workqueue, --perf-no_write_workqueue

Bypass dm-crypt internal workqueue and process read or write requests synchronously. NOTE: These options are available only for low-level dm-crypt performance tuning, use only if you need a change to default dm-crypt behaviour. Needs kernel 5.9 or later.

--header <device or file storing the LUKS header>

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. For commands that change the LUKS header (e.g. luksAddKey), specify the device or file with the LUKS header directly as the LUKS device.

--disable-locks

Disable lock protection for metadata on disk. This option is valid only for LUKS2 and ignored for other formats. 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).

--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.

--persistent

If used with LUKS2 devices and activation commands like open or refresh, the specified activation flags are persistently written into metadata and used next time automatically even for normal activation. (No need to use cryptab or other system configuration files.) If you need to remove a persistent flag, use --persistent without the flag you want to remove (e.g. to disable persistently stored discard flag, use --persistent without --allow-discards).

Only --allow-discards, --perf-same_cpu_crypt, --perf-submit_from_crypt_cpus, --perf-no_read_workqueue, --perf-no_write_workqueue and --integrity-no-journal can be stored persistently.

--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.

--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.

--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.

--version, -V

Show the program version.

--usage

Show short option help.

--help, -?

Show help text and default parameters.

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


cryptsetup-repair

title: cryptsetup-repair(8)

summary: repair the device metadata

text:
# cryptsetup-repair(8)

## NAME
cryptsetup-repair - repair the device metadata

## SYNOPSIS
cryptsetup repair [<options>] <device>

## DESCRIPTION
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.

It also repairs (upgrades) LUKS2 reencryption metadata by adding a metadata digest that protects it against malicious changes.

If LUKS2 reencryption was interrupted in the middle of writing reencryption segment the repair command can be used to perform reencryption recovery so that reencryption can continue later. Repairing reencryption requires verification of reencryption keyslot so passphrase or keyfile is needed.

<options> can be [--timeout, --verify-passphrase, --disable-locks, --type, --header, --key-file, --keyfile-size, --keyfile-offset, --key-slot].

WARNING: Always create a binary backup of the original header before calling this command.

## OPTIONS
--type <device-type>

Specifies required device type, for more info read BASIC ACTIONS section in cryptsetup(8).

--verify-passphrase, -y

When interactively asking for a passphrase, ask for it twice and complain if both inputs do not match. 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.

See section NOTES ON PASSPHRASE PROCESSING in cryptsetup(8) for more information.

--keyfile-offset value

Skip value bytes at the beginning of the key file.

--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.

--key-slot, -S <0-N>

For LUKS operations that add key material, this option allows you to specify which key slot is selected for the new key. 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.

--timeout, -t <number of seconds>

The number of seconds to wait before timeout on passphrase input via terminal. It is relevant every time a passphrase is asked. It has no effect if used in conjunction with --key-file. This option is useful when the system should not stall if the user does not input a passphrase, e.g. during boot. The default is a value of 0 seconds, which means to wait forever.

--header <device or file storing the LUKS header>

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. For commands that change the LUKS header (e.g. luksAddKey), specify the device or file with the LUKS header directly as the LUKS device.

--disable-locks

Disable lock protection for metadata on disk. This option is valid only for LUKS2 and ignored for other formats. 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).

--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.

--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.

--version, -V

Show the program version.

--usage

Show short option help.

--help, -?

Show help text and default parameters.

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


cryptsetup-resize

title: cryptsetup-resize(8)

summary: resize an active mapping

text:
# cryptsetup-resize(8)

## NAME
cryptsetup-resize - resize an active mapping

## SYNOPSIS
cryptsetup resize [<options>] <name>

## DESCRIPTION
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. 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.

<options> can be [--size, --device-size, --token-id, --token-only, --token-type, --key-slot, --key-file, --keyfile-size, --keyfile-offset, --timeout, --disable-external-tokens, --disable-locks, --disable-keyring, --verify-passphrase, --timeout].

## OPTIONS
--verify-passphrase, -y

When interactively asking for a passphrase, ask for it twice and complain if both inputs do not match. 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.

See section NOTES ON PASSPHRASE PROCESSING in cryptsetup(8) for more information.

--keyfile-offset value

Skip value bytes at the beginning of the key file.

--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.

--key-slot, -S <0-N>

For LUKS operations that add key material, this option allows you to specify which key slot is selected for the new key. 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.

--size, -b <number of 512 byte sectors>

Set the size of the device in sectors of 512 bytes.

--device-size size[units]

Sets new size of the device. If unset real device size is used. 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).

--timeout, -t <number of seconds>

The number of seconds to wait before timeout on passphrase input via terminal. It is relevant every time a passphrase is asked. It has no effect if used in conjunction with --key-file. This option is useful when the system should not stall if the user does not input a passphrase, e.g. during boot. The default is a value of 0 seconds, which means to wait forever.

--header <device or file storing the LUKS header>

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. For commands that change the LUKS header (e.g. luksAddKey), specify the device or file with the LUKS header directly as the LUKS device.

--disable-external-tokens

Disable loading of plugins for external LUKS2 tokens.

--disable-locks

Disable lock protection for metadata on disk. This option is valid only for LUKS2 and ignored for other formats. 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).

--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.

--token-id

Specify what token to use and allow token PIN prompt to take precedence over interative keyslot passphrase prompt. If omitted, all available tokens (not protected by PIN) will be checked before proceeding further with passphrase prompt.

--token-only

Do not proceed further with action if token based keyslot unlock failed. Without the option, action asks for passphrase to proceed further. It allows LUKS2 tokens protected by PIN to take precedence over interactive keyslot passphrase prompt.

--token-type type

Restrict tokens eligible for operation to specific token type. Mostly useful when no --token-id is specified. It allows LUKS2 type tokens protected by PIN to take precedence over interactive keyslot passphrase prompt.

--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.

--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.

--version, -V

Show the program version.

--usage

Show short option help.

--help, -?

Show help text and default parameters.

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


cryptsetup-status

title: cryptsetup-status(8)

summary: report the status for a mapping

text:
# cryptsetup-status(8)

## NAME
cryptsetup-status - report the status for a mapping

## SYNOPSIS
cryptsetup status [<options>] <name>

## DESCRIPTION
Reports the status for the mapping <name>.

<options> can be [--header, --disable-locks].

## OPTIONS
--header <device or file storing the LUKS header>

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. For commands that change the LUKS header (e.g. luksAddKey), specify the device or file with the LUKS header directly as the LUKS device.

--disable-locks

Disable lock protection for metadata on disk. This option is valid only for LUKS2 and ignored for other formats. 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).

--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.

--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.

--version, -V

Show the program version.

--usage

Show short option help.

--help, -?

Show help text and default parameters.

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


cryptsetup-tcryptDump

title: cryptsetup-tcryptDump(8)

text:
# cryptsetup-tcryptDump(8)

## NAME
cryptsetup-tcryptDump - dump the header information of a TCRYPT (TrueCrypt or VeraCrypt compatible) device

## SYNOPSIS
cryptsetup tcryptDump [<options>] <device>

## DESCRIPTION
Dump the header information of a TCRYPT (TrueCrypt or VeraCrypt compatible) device.

If the --dump-volume-key option is used, the TCRYPT device volume key is dumped instead of TCRYPT header info. Beware that the volume key (or concatenated volume 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 volume key is compromised, the whole device has to be erased to prevent further access. Use this option carefully.

<options> can be [--dump-volume-key, --key-file, --tcrypt-hidden, --tcrypt-system, --tcrypt-backup, --veracrypt (ignored), --disable-veracrypt, --veracrypt-pim, --veracrypt-query-pim, --cipher, --hash, --header, --verify-passphrase, --timeout].

The keyfile parameter allows a combination of file content with the passphrase and can be repeated.

## OPTIONS
--hash, -h <hash-spec>

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.

--cipher, -c <cipher-spec>

Set the cipher specification string for plain device type. For tcrypt device type it restricts checked cipher chains when looking for header.

--verify-passphrase, -y

When interactively asking for a passphrase, ask for it twice and complain if both inputs do not match. 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.

See section NOTES ON PASSPHRASE PROCESSING in cryptsetup(8) for more information.

--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.

--timeout, -t <number of seconds>

The number of seconds to wait before timeout on passphrase input via terminal. It is relevant every time a passphrase is asked. It has no effect if used in conjunction with --key-file. This option is useful when the system should not stall if the user does not input a passphrase, e.g. during boot. The default is a value of 0 seconds, which means to wait forever.

--header <device or file storing the LUKS header>

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. For commands that change the LUKS header (e.g. luksAddKey), specify the device or file with the LUKS header directly as the LUKS device.

--tcrypt-hidden, --tcrypt-system, --tcrypt-backup

Specify which TrueCrypt on-disk header will be used to open the device. See TCRYPT section in cryptsetup(8) for more info.

--veracrypt

This option is ignored as VeraCrypt compatible mode is supported by default.

--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.

--veracrypt-pim, --veracrypt-query-pim

Use a custom Personal Iteration Multiplier (PIM) for VeraCrypt device. See TCRYPT section in cryptsetup(8) for more info.

--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.

--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.

--version, -V

Show the program version.

--usage

Show short option help.

--help, -?

Show help text and default parameters.

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


cryptsetup-token

title: cryptsetup-token(8)

summary: manage LUKS2 tokens

text:
# cryptsetup-token(8)

## NAME
cryptsetup-token - manage LUKS2 tokens

## SYNOPSIS
cryptsetup token <add|remove|import|export|unassign> [<options>] <device>

## DESCRIPTION
Action add creates a 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.

Action unassign removes token binding to specified keyslot. Both token and keyslot must be specified by --token-id and --key-slot parameters.

If --token-id is used with action add or action import and a token with that ID already exists, option --token-replace can be used to replace the existing token.

<options> can be [--header, --token-id, --key-slot, --key-description, --disable-external-tokens, --disable-locks, --disable-keyring, --json-file, --token-replace, --unbound].

## OPTIONS
--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.

--token-replace

Replace an existing token when adding or importing a token with the --token-id option.

--key-slot, -S <0-N>

For LUKS operations that add key material, this option allows you to specify which key slot is selected for the new key. 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.

--header <device or file storing the LUKS header>

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. For commands that change the LUKS header (e.g. luksAddKey), specify the device or file with the LUKS header directly as the LUKS device.

--disable-external-tokens

Disable loading of plugins for external LUKS2 tokens.

--disable-locks

Disable lock protection for metadata on disk. This option is valid only for LUKS2 and ignored for other formats. 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).

--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.

--key-description <text>

Set key description in keyring for use with token command.

--token-id

Specify token number. If omitted, first unused token id is used when adding or importing new token.

--unbound

Creates new LUKS2 keyring token assigned to no keyslot. Usable only with add action.

--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.

--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.

--version, -V

Show the program version.

--usage

Show short option help.

--help, -?

Show help text and default parameters.

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


integritysetup

title: integritysetup(8)

summary: manage dm\-integrity (block level integrity) volumes

text:
# integritysetup(8)

## NAME
integritysetup - manage dm-integrity (block level integrity) volumes

## SYNOPSIS
integritysetup <action> [<options>] <action args>

## DESCRIPTION
Integritysetup is used to configure dm-integrity managed device-mapper mappings.

Device-mapper integrity target provides read-write transparent integrity checking of block devices. The dm-integrity target emulates an additional data integrity field per-sector. You can use this additional field directly with integritysetup utility, or indirectly (for authenticated encryption) through cryptsetup.

## BASIC ACTIONS
Integritysetup supports these operations:

### FORMAT
format <device>

Formats <device> (calculates space and dm-integrity superblock and wipes the device).

<options> can be [--data-device, --batch-mode, --no-wipe, --journal-size, --interleave-sectors, --tag-size, --integrity, --integrity-key-size, --integrity-key-file, --sector-size, --progress-frequency, --progress-json].

### OPEN
open <device> <name>

create <name> <device> (OBSOLETE syntax)

Open a mapping with <name> backed by device <device>.

<options> can be [--data-device, --batch-mode, --journal-watermark, --journal-commit-time, --buffer-sectors, --integrity, --integrity-key-size, --integrity-key-file, --integrity-no-journal, --integrity-recalculate, --integrity-recalculate-reset,--integrity-recovery-mode, --allow-discards].

### CLOSE
close <name>

remove <name> (OBSOLETE syntax)

Removes existing mapping <name>.

<options> can be [--deferred] or [--cancel-deferred]

### STATUS
status <name>

Reports status for the active integrity mapping <name>.

### DUMP
dump <device>

Reports parameters from on-disk stored superblock.

### RESIZE
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. After resize, the recalculating flag is set. If --wipe flag is set and the size of the device is increased, the newly added section will be wiped.

Increasing the size of integrity volumes is available since the Linux kernel version 5.7, shrinking should work on older kernels too.

<options> can be [--size, --device-size, --wipe].

## OPTIONS
--progress-frequency <seconds>

Print separate line every <seconds> with wipe progress.

--progress-json

Prints wipe progress data in json format suitable mostly for machine processing. It prints separate line every half second (or based on --progress-frequency value). The JSON output looks as follows during wipe progress (except it’s compact single line):

```
{

  "device":"/dev/sda"       // backing device or file

  "device_bytes":"8192",    // bytes wiped so far

  "device_size":"44040192", // total bytes to wipe

  "speed":"126877696",      // calculated speed in bytes per second (based on progress so far)

  "eta_ms":"2520012"        // estimated time to finish wipe in milliseconds

  "time_ms":"5561235"       // total time spent wiping device in milliseconds
}
```

Note on numbers in JSON output: Due to JSON parsers limitations all numbers are represented in a string format due to need of full 64bit unsigned integers.

--no-wipe

Do not wipe the device after format. A device that is not initially wiped will contain invalid checksums.

--wipe

Wipe the newly allocated area after resize to bigger size. If this flag is not set, checksums will be calculated for the data previously stored in the newly allocated area.

--journal-size, -j BYTES

Size of the journal.

--interleave-sectors SECTORS

The number of interleaved sectors.

--integrity-recalculate

Automatically recalculate integrity tags in kernel on activation. The device can be used during automatic integrity recalculation but becomes fully integrity protected only after the background operation is finished. This option is available since the Linux kernel version 4.19.

--integrity-recalculate-reset

Restart recalculation from the beginning of the device. It can be used to change the integrity checksum function. Note it does not change the tag length. This option is available since the Linux kernel version 5.13.

--journal-watermark PERCENT

Journal watermark in percents. When the size of the journal exceeds this watermark, the journal flush will be started.

--journal-commit-time MS

Commit time in milliseconds. When this time passes (and no explicit flush operation was issued), the journal is written.

--tag-size, -t BYTES

Size of the integrity tag per-sector (here the integrity function will store authentication tag). NOTE: The size can be smaller that output size of the hash function, in that case only part of the hash will be stored.

--data-device <data_device>

Specify a separate data device that contains existing data. The <device> then will contain calculated integrity tags and journal for data on <data_device>. NOTE: To not wipe the data device after initial format, also specify --no-wipe option and activate with --integrity-recalculate to automatically recalculate integrity tags.

--sector-size, -s BYTES

Sector size (power of two: 512, 1024, 2048, 4096).

--buffer-sectors SECTORS

The number of sectors in one buffer. The tag area is accessed using buffers, the large buffer size means that the I/O size will be larger, but there could be less I/Os issued.

--integrity, -I ALGORITHM

Use internal integrity calculation (standalone mode). The integrity algorithm can be CRC (crc32c/crc32), non-cryptographic hash function (xxhash64) or hash function (sha1, sha256). For HMAC (hmac-sha256) you have also to specify an integrity key and its size.

--integrity-key-size BYTES

The size of the data integrity key. Maximum is 4096 bytes.

--integrity-key-file FILE

The file with the integrity key.

--integrity-no-journal, -D

Disable journal for integrity device.

--integrity-bitmap-mode. -B

Use alternate bitmap mode (available since Linux kernel 5.2) where dm-integrity uses bitmap instead of a journal. If a bit in the bitmap is 1, the corresponding region’s data and integrity tags are not synchronized - if the machine crashes, the unsynchronized regions will be recalculated. The bitmap mode is faster than the journal mode, because we don’t have to write the data twice, but it is also less reliable, because if data corruption happens when the machine crashes, it may not be detected.

--bitmap-sectors-per-bit SECTORS

Number of 512-byte sectors per bitmap bit, the value must be power of two.

--bitmap-flush-time MS

Bitmap flush time in milliseconds.

WARNING:

In case of a crash, it is possible that the data and integrity tag doesn’t match if the journal is disabled.

--integrity-recovery-mode. -R

Recovery mode (no journal, no tag checking).

NOTE: The following options are intended for testing purposes only.: Using journal encryption does not make sense without encryption the data, these options are internally used in authenticated disk encryption with cryptsetup(8).

--journal-integrity ALGORITHM

Integrity algorithm for journal area. See --integrity option for detailed specification.

--journal-integrity-key-size BYTES

The size of the journal integrity key. Maximum is 4096 bytes.

--journal-integrity-key-file FILE

The file with the integrity key.

--journal-crypt ALGORITHM

Encryption algorithm for journal data area. You can use a block cipher here such as cbc-aes or a stream cipher, for example, chacha20 or ctr-aes.

--journal-crypt-key-size BYTES

The size of the journal encryption key. Maximum is 4096 bytes.

--journal-crypt-key-file FILE

The file with the journal encryption key.

--allow-discards

Allow the use of discard (TRIM) requests for the device. This option is available since the Linux kernel version 5.7.

--deferred

Defers device removal in close command until the last user closes it.

--cancel-deferred

Removes a previously configured deferred device removal in close command.

--verbose, -v

Print more information on command execution.

--debug

Run in debug mode with full diagnostic logs. Debug output lines are always prefixed by #.

--version, -V

Show the program version.

--batch-mode, -q

Do not ask for confirmation.

--usage

Show short option help.

--help, -?

Show help text and default parameters.

## LEGACY COMPATIBILITY OPTIONS
WARNING:

Do not use these options until you need compatibility with specific old kernel.

--integrity-legacy-padding

Use inefficient legacy padding.

--integrity-legacy-hmac

Use old flawed HMAC calculation (also does not protect superblock).

--integrity-legacy-recalculate

Allow insecure recalculating of volumes with HMAC keys (recalculation offset in superblock is not protected).

## RETURN CODES
Integritysetup returns 0 on success and a non-zero value on error.

Error codes are: 1 wrong parameters, 2 no permission, 3 out of memory, 4 wrong device specified, 5 device already exists or device is busy.

## NOTES
The dm-integrity target is available since Linux kernel version 4.12.

Format and activation of an integrity device always require superuser privilege because the superblock is calculated and handled in dm-integrity kernel target.

## EXAMPLES
Format the device with default standalone mode (CRC32C):

integritysetup format <device>

Open the device with default parameters:

integritysetup open <device> test

Format the device in standalone mode for use with HMAC(SHA256):

integritysetup format <device> --tag-size 32 --integrity hmac-sha256 --integrity-key-file <keyfile> --integrity-key-size <key_bytes>

Open (activate) the device with HMAC(SHA256) and HMAC key in file:

integritysetup open <device> test --integrity hmac-sha256 --integrity-key-file <keyfile> --integrity-key-size <key_bytes>

Dump dm-integrity superblock information:

integritysetup dump <device>

## DM-INTEGRITY ON-DISK FORMAT
The on-disk format specification available at DMIntegrity <https://gitlab.com/cryptsetup/cryptsetup/wikis/DMIntegrity> page.

## AUTHORS
The integritysetup tool is written by Milan Broz <gmazyland@gmail.com>.

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


veritysetup

title: veritysetup(8)

summary: manage dm\-verity (block level verification) volumes

text:
# veritysetup(8)

## NAME
veritysetup - manage dm-verity (block level verification) volumes

## SYNOPSIS
veritysetup <action> [<options>] <action args>

## DESCRIPTION
Veritysetup is used to configure dm-verity managed device-mapper mappings.

Device-mapper verity target provides read-only transparent integrity checking of block devices using kernel crypto API.

The dm-verity devices are always read-only.

## BASIC ACTIONS
Veritysetup supports these operations:

### FORMAT
format <data_device> <hash_device>

Calculates and permanently stores hash verification data for data_device. Hash area can be located on the same device after data if specified by --hash-offset option.

Note you need to provide root hash string for device verification or activation. Root hash must be trusted.

The data or hash device argument can be block device or file image. If hash device path doesn’t exist, it will be created as file.

<options> can be [--hash, --no-superblock, --format, --data-block-size, --hash-block-size, --data-blocks, --hash-offset, --salt, --uuid, --root-hash-file].

If option --root-hash-file is used, the root hash is stored in hex-encoded text format in <path>.

### OPEN
open <data_device> <name> <hash_device> <root_hash>

open <data_device> <name> <hash_device> --root-hash-file <path>

create <name> <data_device> <hash_device> <root_hash> (OBSOLETE syntax)

Creates a mapping with <name> backed by device <data_device> and using <hash_device> for in-kernel verification.

The <root_hash> is a hexadecimal string.

<options> can be [--hash-offset, --no-superblock, --ignore-corruption or --restart-on-corruption, --panic-on-corruption, --ignore-zero-blocks, --check-at-most-once, --root-hash-signature, --root-hash-file, --use-tasklets].

If option --root-hash-file is used, the root hash is read from <path> instead of from the command line parameter. Expects hex-encoded text, without terminating newline.

If option --no-superblock is used, you have to use as the same options as in initial format operation.

### VERIFY
verify <data_device> <hash_device> <root_hash>

verify <data_device> <hash_device> --root-hash-file <path>

Verifies data on data_device with use of hash blocks stored on hash_device.

This command performs userspace verification, no kernel device is created.

The <root_hash> is a hexadecimal string.

If option --root-hash-file is used, the root hash is read from <path> instead of from the command line parameter. Expects hex-encoded text, without terminating newline.

<options> can be [--hash-offset, --no-superblock, --root-hash-file].

If option --no-superblock is used, you have to use as the same options as in initial format operation.

### CLOSE
close <name>

remove <name> (OBSOLETE syntax)

Removes existing mapping <name>.

<options> can be [--deferred] or [--cancel-deferred].

### STATUS
status <name>

Reports status for the active verity mapping <name>.

### DUMP
dump <hash_device>

Reports parameters of verity device from on-disk stored superblock.

<options> can be [--hash-offset].

## OPTIONS
--no-superblock

Create or use dm-verity without permanent on-disk superblock.

--format=number

Specifies the hash version type. Format type 0 is original Chrome OS version. Format type 1 is current version.

--data-block-size=bytes

Used block size for the data device. (Note kernel supports only page-size as maximum here.)

--hash-block-size=bytes

Used block size for the hash device. (Note kernel supports only page-size as maximum here.)

--data-blocks=blocks

Size of data device used in verification. If not specified, the whole device is used.

--hash-offset=bytes

Offset of hash area/superblock on hash_device. Value must be aligned to disk sector offset.

--salt=hex string

Salt used for format or verification. Format is a hexadecimal string.

--uuid=UUID

Use the provided UUID for format command instead of generating new one. The UUID must be provided in standard UUID format, e.g. 12345678-1234-1234-1234-123456789abc. *--ignore-corruption , --restart-on-corruption ,

--panic-on-corruption*

Defines what to do if data integrity problem is detected (data corruption). Without these options kernel fails the IO operation with I/O error. With --ignore-corruption option the corruption is only logged. With --restart-on-corruption or --panic-on-corruption the kernel is restarted (panicked) immediately. (You have to provide way how to avoid restart loops.)

WARNING: Use these options only for very specific cases. These options are available since Linux kernel version 4.1.

--ignore-zero-blocks

Instruct kernel to not verify blocks that are expected to contain zeroes and always directly return zeroes instead. WARNING: Use this option only in very specific cases. This option is available since Linux kernel version 4.5.

--check-at-most-once

Instruct kernel to verify blocks only the first time they are read from the data device, rather than every time. WARNING: It provides a reduced level of security because only offline tampering of the data device’s content will be detected, not online tampering. This option is available since Linux kernel version 4.17.

--hash=hash

Hash algorithm for dm-verity. For default see --help option.

--fec-device=fec_device

Use forward error correction (FEC) to recover from corruption if hash verification fails. Use encoding data from the specified device. The fec device argument can be block device or file image. For format, if fec device path doesn’t exist, it will be created as file.

Block sizes for data and hash devices must match. Also, if the verity data_device is encrypted the fec_device should be too.

FEC calculation covers data, hash area, and optional foreign metadata stored on the same device with the hash tree (additional space after hash area). Size of this optional additional area protected by FEC is calculated from image sizes, so you must be sure that you use the same images for activation.

If the hash device is in a separate image, metadata covers the whole rest of the image after the hash area.

If hash and FEC device is in the image, metadata ends on the FEC area offset.

--fec-offset=bytes

This is the offset, in bytes, from the start of the FEC device to the beginning of the encoding data.

--fec-roots=num

Number of generator roots. This equals to the number of parity bytes in the encoding data. In RS(M, N) encoding, the number of roots is M-N. M is 255 and M-N is between 2 and 24 (including).

--root-hash-file=FILE

Path to file with stored root hash in hex-encoded text.

--root-hash-signature=FILE

Path to root hash signature file used to verify the root hash (in kernel). This feature requires Linux kernel version 5.4 or more recent.

--use-tasklets

Try to use kernel tasklets in dm-verity driver for performance reasons. This option is available since Linux kernel version 6.0.

--deferred

Defers device removal in close command until the last user closes it.

--cancel-deferred

Removes a previously configured deferred device removal in close command.

--verbose, -v

Print more information on command execution.

--debug

Run in debug mode with full diagnostic logs. Debug output lines are always prefixed by #.

--version, -V

Show the program version.

--batch-mode, -q

Do not ask for confirmation.

--usage

Show short option help.

--help, -?

Show help text and default parameters.

## RETURN CODES
Veritysetup returns 0 on success and a non-zero value on error.

Error codes are: 1 wrong parameters, 2 no permission, 3 out of memory, 4 wrong device specified, 5 device already exists or device is busy.

## EXAMPLES
veritysetup --data-blocks=256 format <data_device> <hash_device>

Calculates and stores verification data on hash_device for the first 256 blocks (of block-size). If hash_device does not exist, it is created (as file image).

veritysetup format --root-hash-file <path> <data_device> <hash_device>

Calculates and stores verification data on hash_device for the whole data_device, and store the root hash as hex-encoded text in <path>.

veritysetup --data-blocks=256 --hash-offset=1052672 format <device> <device>

Verification data (hashes) is stored on the same device as data (starting at hash-offset). Hash-offset must be greater than number of blocks in data-area.

veritysetup --data-blocks=256 --hash-offset=1052672 create test-device <device> <device> <root_hash>

Activates the verity device named test-device. Options --data-blocks and --hash-offset are the same as in the format command. The <root_hash> was calculated in format command.

veritysetup --data-blocks=256 --hash-offset=1052672 verify <data_device> <hash_device> <root_hash>

Verifies device without activation (in userspace).

veritysetup --data-blocks=256 --hash-offset=1052672 --root-hash-file <path> verify <data_device> <hash_device>

Verifies device without activation (in userspace). Root hash passed via a file rather than inline.

veritysetup --fec-device=<fec_device> --fec-roots=10 format <data_device> <hash_device>

Calculates and stores verification and encoding data for data_device.

## DM-VERITY ON-DISK SPECIFICATION
The on-disk format specification is available at DMVerity <https://gitlab.com/cryptsetup/cryptsetup/wikis/DMVerity> page.

## AUTHORS
The first implementation of veritysetup was written by Chrome OS authors.

This version is based on verification code written by Mikulas Patocka <mpatocka@redhat.com> and rewritten for libcryptsetup by Milan Broz <gmazyland@gmail.com>.

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


cryptsetup-ssh

package: cryptsetup-ssh-token

title: cryptsetup-ssh(8)

summary: manage LUKS2 SSH token

text:
# cryptsetup-ssh(8)

## NAME
cryptsetup-ssh - manage LUKS2 SSH token

## SYNOPSIS
cryptsetup-ssh <action> [<options>] <action args>

## DESCRIPTION
Experimental cryptsetup plugin for unlocking LUKS2 devices with token connected to an SSH server.

This plugin currently allows only adding a token to an existing key slot. See cryptsetup(8) for instructions on how to remove, import or export the token.

### Add operation
add <options> <device>

Adds the SSH token to <device>.

The specified SSH server must contain a key file on the specified path with a passphrase for an existing key slot on the device. Provided credentials will be used by cryptsetup to get the password when opening the device using the token.

Options --ssh-server, --ssh-user, --ssh-keypath and --ssh-path are required for this operation.

## OPTIONS
--key-slot=NUM

Keyslot to assign the token to. If not specified, the token will be assigned to the first key slot matching provided passphrase.

--ssh-keypath=STRING

Path to the SSH key for connecting to the remote server.

--ssh-path=STRING

Path to the key file on the remote server.

--ssh-server=STRING

IP address/URL of the remote server for this token.

--ssh-user=STRING

Username used for the remote server.

--debug

Show debug messages

--debug-json

Show debug messages including JSON metadata

--verbose, -v

Shows more detailed error messages

--help, -?

Show help

--version, -V

Print program version

## NOTES
The information provided when adding the token (SSH server address, user and paths) will be stored in the LUKS2 header in plaintext.

## AUTHORS
The cryptsetup-ssh tool is written by Vojtech Trefny.

## REPORTING BUGS
Report bugs at cryptsetup mailing list <cryptsetup@lists.linux.dev> or in Issues project section <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>.

Please attach output of the failed command with --debug option added.

## SEE ALSO
Cryptsetup FAQ <https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions>

cryptsetup(8), integritysetup(8) and veritysetup(8)

## CRYPTSETUP
Part of cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>.


cups-lpd

package: cups

title: cups-lpd(8)

text:
# cups-lpd(8)

## NAME
cups-lpd - receive print jobs and report printer status to lpd clients (deprecated)

## SYNOPSIS
cups-lpd [ -h hostname[:port] ] [ -n ] [ -o option=value ]

## DESCRIPTION
cups-lpd is the CUPS Line Printer Daemon ("LPD") mini-server that supports legacy client systems that use the LPD protocol. cups-lpd does not act as a standalone network daemon but instead operates using any of the Internet "super-servers" such as inetd(8), launchd(8), and systemd(8).

## OPTIONS
-h hostname[:port]

Sets the CUPS server (and port) to use.

-n

Disables reverse address lookups; normally cups-lpd will try to discover the hostname of the client via a reverse DNS lookup.

-o name=value

Inserts options for all print queues. Most often this is used to disable the "l" filter so that remote print jobs are filtered as needed for printing; the inetd(8) example below sets the "document-format" option to "application/octet-stream" which forces autodetection of the print file format.

## CONFORMING TO
cups-lpd does not enforce the restricted source port number specified in RFC 1179, as using restricted ports does not prevent users from submitting print jobs. While this behavior is different than standard Berkeley LPD implementations, it should not affect normal client operations.

The output of the status requests follows RFC 2569, Mapping between LPD and IPP Protocols. Since many LPD implementations stray from this definition, remote status reporting to LPD clients may be unreliable.

## ERRORS
Errors are sent to the system log.

## FILES

```
/etc/inetd.conf
/etc/xinetd.d/cups-lpd
/System/Library/LaunchDaemons/org.cups.cups-lpd.plist
```

## NOTES
The cups-lpd program is deprecated and will no longer be supported in a future feature release of CUPS.

### PERFORMANCE
cups-lpd performs well with small numbers of clients and printers. However, since a new process is created for each connection and since each process must query the printing system before each job submission, it does not scale to larger configurations. We highly recommend that large configurations use the native IPP support provided by CUPS instead.

### SECURITY
cups-lpd currently does not perform any access control based on the settings in cupsd.conf(5) or in the hosts.allow(5) or hosts.deny(5) files used by TCP wrappers. Therefore, running cups-lpd on your server will allow any computer on your network (and perhaps the entire Internet) to print to your server.

While xinetd(8) has built-in access control support, you should use the TCP wrappers package with inetd(8) to limit access to only those computers that should be able to print through your server.

cups-lpd is not enabled by the standard CUPS distribution. Please consult with your operating system vendor to determine whether it is enabled by default on your system.

## EXAMPLE
If you are using inetd(8), add the following line to the inetd.conf file to enable the cups-lpd mini-server:

```
    printer stream tcp nowait lp /usr/lib/cups/daemon/cups-lpd cups-lpd \

        -o document-format=application/octet-stream
```

CUPS includes configuration files for launchd(8), systemd(8), and xinetd(8). Simply enable the cups-lpd service using the corresponding control program.

## SEE ALSO
cups(1), cupsd(8), inetd(8), launchd(8), xinetd(8), CUPS Online Help (http://localhost:631/help), RFC 2569

## COPYRIGHT
Copyright © 2020-2024 by OpenPrinting.


cups-snmp

title: cups-snmp(8)

summary: cups snmp backend (deprecated)

text:
# cups-snmp(8)

## NAME
snmp - cups snmp backend (deprecated)

## SYNOPSIS
/usr/lib/cups/backend/snmp ip-address-or-hostname

/usr/libexec/cups/backend/snmp ip-address-or-hostname

lpinfo -v --include-schemes snmp

## DESCRIPTION
The DEPRECATED CUPS SNMP backend provides legacy discovery and identification of network printers using SNMPv1. When used for discovery through the scheduler, the backend will list all printers that respond to a broadcast SNMPv1 query with the "public" community name. Additional queries are then sent to printers that respond in order to determine the correct device URI, make and model, and other information needed for printing.

In the first form, the SNMP backend is run directly by the user to look up the device URI and other information when you have an IP address or hostname. This can be used for programs that need to configure print queues where the user has supplied an address but nothing else.

In the second form, the SNMP backend is run indirectly using the lpinfo(8) command. The output provides all printers detected via SNMP on the configured broadcast addresses. Note: no broadcast addresses are configured by default.

## ENVIRONMENT
The DebugLevel value can be overridden using the CUPS_DEBUG_LEVEL environment variable. The MaxRunTime value can be overridden using the CUPS_MAX_RUN_TIME environment variable.

## FILES
The SNMP backend reads the /etc/cups/snmp.conf configuration file, if present, to set the default broadcast address, community name, and logging level.

## NOTES
The CUPS SNMP backend is deprecated and will no longer be supported in a future version of CUPS.

## CONFORMING TO
The CUPS SNMP backend uses the information from the Host, Printer, and Port Monitor MIBs along with some vendor private MIBs and intelligent port probes to determine the correct device URI and make and model for each printer.

## SEE ALSO
backend(7), cups-snmp.conf(5), cupsd(8), lpinfo(8), CUPS Online Help (http://localhost:631/help)

## COPYRIGHT
Copyright © 2020-2024 by OpenPrinting.


cupsaccept

title: cupsaccept(8)

text:
# cupsaccept(8)

## NAME
cupsaccept/cupsreject - accept/reject jobs sent to a destination

## SYNOPSIS
cupsaccept [ -E ] [ -U username ] [ -h hostname[:port] ] destination(s)

cupsreject [ -E ] [ -U username ] [ -h hostname[:port] ] [ -r reason ] destination(s)

## DESCRIPTION
The cupsaccept command instructs the printing system to accept print jobs to the specified destinations.

The cupsreject command instructs the printing system to reject print jobs to the specified destinations. The -r option sets the reason for rejecting print jobs. If not specified, the reason defaults to "Reason Unknown".

## OPTIONS
The following options are supported by both cupsaccept and cupsreject:

-E

Forces encryption when connecting to the server.

-U username

Sets the username that is sent when connecting to the server.

-h hostname[:port]

Chooses an alternate server.

-r "reason"

Sets the reason string that is shown for a printer that is rejecting jobs.

## CONFORMING TO
The cupsaccept and cupsreject commands correspond to the System V printing system commands "accept" and "reject", respectively. Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", or "#". Also, printer and class names are not case-sensitive.

Finally, the CUPS versions may ask the user for an access password depending on the printing system configuration.

## SEE ALSO
cancel(1), cupsenable(8), lp(1), lpadmin(8), lpstat(1),

CUPS Online Help (http://localhost:631/help)

## COPYRIGHT
Copyright © 2020-2024 by OpenPrinting.


cupsctl

title: cupsctl(8)

summary: configure cupsd.conf options

text:
# cupsctl(8)

## NAME
cupsctl - configure cupsd.conf options

## SYNOPSIS
cupsctl [ -h server[:port] ] [ -E ] [ -U username ] [ --[no-]debug-logging ] [ --[no-]remote-admin ] [ --[no-]remote-any ] [ --[no-]share-printers ] [ --[no-]user-cancel-any ] [ name=value ]

## DESCRIPTION
cupsctl updates or queries the cupsd.conf file for a server. When no changes are requested, the current configuration values are written to the standard output in the format "name=value", one per line.

## OPTIONS
The following options are recognized:

-E

Enables encryption on the connection to the scheduler.

-U username

Specifies an alternate username to use when authenticating with the scheduler.

-h server[:port]

Specifies the server address. Note: This option must occur before all others.

--[no-]debug-logging

Enables (disables) debug logging to the error_log file.

--[no-]remote-admin

Enables (disables) remote administration.

--[no-]remote-any

Enables (disables) printing from any address, e.g., the Internet.

--[no-]share-printers

Enables (disables) sharing of local printers with other computers.

--[no-]user-cancel-any

Allows (prevents) users to cancel jobs owned by others.

## EXAMPLES
Display the current settings:

```
    cupsctl
```

Enable debug logging:

```
    cupsctl --debug-logging
```

Get the current debug logging state:

```
    cupsctl | grep '^_debug_logging' | awk -F= '{print $2}'
```

Disable printer sharing:

```
    cupsctl --no-share-printers
```

## KNOWN ISSUES
You cannot set the Listen or Port directives using cupsctl.

## SEE ALSO
cupsd.conf(5), cupsd(8),

CUPS Online Help (http://localhost:631/help)

## COPYRIGHT
Copyright © 2020-2024 by OpenPrinting.


cupsd

title: cupsd(8)

summary: cups scheduler

text:
# cupsd(8)

## NAME
cupsd - cups scheduler

## SYNOPSIS
cupsd [ -c cupsd.conf ] [ -f ] [ -F ] [ -h ] [ -l ] [ -s cups-files.conf ] [ -t ]

## DESCRIPTION
cupsd is the scheduler for CUPS. It implements a printing system based upon the Internet Printing Protocol, version 2.1, and supports most of the requirements for IPP Everywhere. If no options are specified on the command-line then the default configuration file /etc/cups/cupsd.conf will be used.

## OPTIONS
-c cupsd.conf

Uses the named cupsd.conf configuration file.

-f

Run cupsd in the foreground; the default is to run in the background as a "daemon".

-F

Run cupsd in the foreground but detach the process from the controlling terminal and current directory. This is useful for running cupsd from init(8).

-h

Shows the program usage.

-l

This option is passed to cupsd when it is run from launchd(8) or systemd(8).

-s cups-files.conf

Uses the named cups-files.conf configuration file.

-t

Test the configuration file for syntax errors.

## FILES

```
/etc/cups/classes.conf
/etc/cups/cups-files.conf
/etc/cups/cupsd.conf
/usr/share/cups/mime/mime.convs
/usr/share/cups/mime/mime.types
/etc/cups/printers.conf
/etc/cups/subscriptions.conf
```

## CONFORMING TO
cupsd implements all of the required IPP/2.1 attributes and operations. It also implements several CUPS-specific administrative operations.

## EXAMPLES
Run cupsd in the background with the default configuration file:

```
    cupsd
```

Test a configuration file called test.conf:

```
    cupsd -t -c test.conf
```

Run cupsd in the foreground with a test configuration file called test.conf:

```
    cupsd -f -c test.conf
```

## SEE ALSO
backend(7), classes.conf(5), cups(1), cups-files.conf(5), cups-lpd(8), cupsd.conf(5), cupsd-helper(8), cupsd-logs(8), filter(7), launchd(8), mime.convs(5), mime.types(5), printers.conf(5), systemd(8), CUPS Online Help (http://localhost:631/help)

## COPYRIGHT
Copyright © 2020-2024 by OpenPrinting.


cupsd-helper

title: cupsd-helper(8)

summary: cupsd helper programs (deprecated)

text:
# cupsd-helper(8)

## NAME
cupsd-helper - cupsd helper programs (deprecated)

## SYNOPSIS
cups-deviced request-id limit user-id options

cups-driverd cat ppd-name

cups-driverd list request_id limit options

cups-exec sandbox-profile [ -g group-id ] [ -n nice-value ] [ -u user-id ] /path/to/program argv0 ... argvN

## DESCRIPTION
The cupsd-helper programs perform long-running operations on behalf of the scheduler, cupsd(8). The cups-deviced helper program runs each CUPS backend(7) with no arguments in order to discover the available printers.

The cups-driverd helper program lists all available printer drivers, a subset of "matching" printer drivers, or a copy of a specific driver PPD file.

The cups-exec helper program runs backends, filters, and other programs. On macOS these programs are run in a secure sandbox.

## FILES
The cups-driverd program looks for PPD and driver information files in the following directories:

```
    /Library/Printers

    /opt/share/ppd

    /System/Library/Printers

    /usr/local/share/ppd

    /usr/share/cups/drv

    /usr/share/cups/model

    /usr/share/ppd
```

PPD files can be compressed using the gzip(1) program or placed in compressed tar(1) archives to further reduce their size.

Driver information files must conform to the format defined in ppdcfile(5).

## NOTES
CUPS printer drivers, backends, and PPD files are deprecated and will no longer be supported in a future feature release of CUPS. Printers that do not support IPP can be supported using applications such as ippeveprinter(1).

## SEE ALSO
backend(7), cups(1), cupsd(8), cupsd.conf(5), filter(7), ppdcfile(5), CUPS Online Help (http://localhost:631/help)

## COPYRIGHT
Copyright © 2020-2024 by OpenPrinting.


cupsenable

title: cupsenable(8)

summary: stop/start printers and classes

text:
# cupsenable(8)

## NAME
cupsdisable, cupsenable - stop/start printers and classes

## SYNOPSIS
cupsdisable [ -E ] [ -U username ] [ -c ] [ -h server[:port] ] [ -r reason ] [ --hold ] destination(s)

cupsenable [ -E ] [ -U username ] [ -c ] [ -h server[:port] ] [ --release ] destination(s)

## DESCRIPTION
cupsenable starts the named printers or classes while cupsdisable stops the named printers or classes.

## OPTIONS
The following options may be used:

-E

Forces encryption of the connection to the server.

-U username

Uses the specified username when connecting to the server.

-c

Cancels all jobs on the named destination.

-h server[:port]

Uses the specified server and port.

--hold

Holds remaining jobs on the named printer. Useful for allowing the current job to complete before performing maintenance.

-r "reason"

Sets the message associated with the stopped state. If no reason is specified then the message is set to "Reason Unknown".

--release

Releases pending jobs for printing. Use after running cupsdisable with the --hold option to resume printing.

## CONFORMING TO
Unlike the System V printing system, CUPS allows printer names to contain any printable character except SPACE, TAB, "/", or "#". Also, printer and class names are not case-sensitive.

The System V versions of these commands are disable and enable, respectively. They have been renamed to avoid conflicts with the bash(1) built-in commands of the same names.

The CUPS versions of disable and enable may ask the user for an access password depending on the printing system configuration. This differs from the System V versions which require the root user to execute these commands.

## SEE ALSO
cupsaccept(8), cupsreject(8), cancel(1), lp(1), lpadmin(8), lpstat(1), CUPS Online Help (http://localhost:631/help)

## COPYRIGHT
Copyright © 2020-2024 by OpenPrinting.


cupsfilter

title: cupsfilter(8)

text:
# cupsfilter(8)

## NAME
cupsfilter - convert a file to another format using cups filters (deprecated)

## SYNOPSIS
cupsfilter [ --list-filters ] [ -D ] [ -U user ] [ -c config-file ] [ -d printer ] [ -e ] [ -i mime/type ] [ -j job-id[,N] ] [ -m mime/type ] [ -n copies ] [ -o name=value ] [ -p filename.ppd ] [ -t title ] [ -u ] filename

## DESCRIPTION
cupsfilter is a front-end to the CUPS filter subsystem which allows you to convert a file to a specific format, just as if you had printed the file through CUPS. By default, cupsfilter generates a PDF file. The converted file is sent to the standard output.

## OPTIONS
--list-filters

Do not actually run the filters, just print the filters used to stdout.

-D

Delete the input file after conversion.

-U user

Specifies the username passed to the filters. The default is the name of the current user.

-c config-file

Uses the named cups-files.conf configuration file.

-d printer

Uses information from the named printer.

-e

Use every filter from the PPD file.

-i mime/type

Specifies the source file type. The default file type is guessed using the filename and contents of the file.

-j job-id[,N]

Converts document N from the specified job. If N is omitted, document 1 is converted.

-m mime/type

Specifies the destination file type. The default file type is application/pdf. Use printer/foo to convert to the printer format defined by the filters in the PPD file.

-n copies

Specifies the number of copies to generate.

-o name=value

Specifies options to pass to the CUPS filters.

-p filename.ppd

Specifies the PPD file to use.

-t title

Specifies the document title.

-u

Delete the PPD file after conversion.

## EXIT STATUS
cupsfilter returns a non-zero exit status on any error.

## ENVIRONMENT
All of the standard cups(1) environment variables affect the operation of cupsfilter.

## FILES

```
/etc/cups/cups-files.conf
/etc/cups/*.convs
/etc/cups/*.types
/usr/share/cups/mime/*.convs
/usr/share/cups/mime/*.types
```

## NOTES
CUPS printer drivers, filters, and backends are deprecated and will no longer be supported in a future feature release of CUPS. Printers that do not support IPP can be supported using applications such as ippeveprinter(1).

Unlike when printing, filters run using the cupsfilter command use the current user and security session. This may result in different output or unexpected behavior.

## EXAMPLE
The following command will generate a PDF preview of job 42 for a printer named "myprinter" and save it to a file named "preview.pdf":

```
    cupsfilter -m application/pdf -d myprinter -j 42 >preview.pdf
```

## SEE ALSO
cups(1), cupsd.conf(5), filter(7), mime.convs(7), mime.types(7), CUPS Online Help (http://localhost:631/help)

## COPYRIGHT
Copyright © 2020-2024 by OpenPrinting.