LinuxCommandLibrary

systemd-cryptsetup

Manage encrypted volume mappings

TLDR

Attach (open) encrypted volume

$ systemd-cryptsetup attach [mapping_name] [/dev/sdXY]
copy
Attach with options
$ systemd-cryptsetup attach [mapping_name] [/dev/sdXY] none [crypttab_options]
copy
Attach with keyfile
$ systemd-cryptsetup attach [mapping_name] [/dev/sdXY] [/path/to/keyfile] [options]
copy
Detach (close) mapping
$ systemd-cryptsetup detach [mapping_name]
copy

SYNOPSIS

systemd-cryptsetup attach VOLUME DEVICE [KEY] [OPTIONS]
systemd-cryptsetup detach VOLUME

DESCRIPTION

systemd-cryptsetup creates or removes decrypted mappings of encrypted LUKS volumes. It is the systemd equivalent of `cryptsetup open` and `cryptsetup close`.
Arguments follow the same format as `/etc/crypttab` entries. This tool is primarily used internally by systemd to unlock encrypted devices during boot based on crypttab configuration.

CAVEATS

Typically called by systemd automatically, not manually. The mapping appears at `/dev/mapper/<name>`. Supports all crypttab options like luks, discard, etc.

HISTORY

systemd-cryptsetup integrates encrypted volume management with systemd's boot process, enabling automatic unlocking based on `/etc/crypttab` configuration.

SEE ALSO

> TERMINAL_GEAR

Curated for the Linux community

Copied to clipboard

> TERMINAL_GEAR

Curated for the Linux community