systemd-cryptsetup Command Examples

Create or remove decrypted mappings of encrypted volumes. Equivalent of cryptsetup open and cryptsetup close. Arguments to this command are written exactly like a line in /etc/crypttab. It's used by systemd to unlock devices on boot. See also: cryptsetup. More information: https://www.freedesktop.org/software/systemd/man/latest/systemd-cryptsetup.html.

systemd-cryptsetup attach {{mapping_name}} {{/dev/sdXY}}

systemd-cryptsetup attach {{mapping_name}} {{/dev/sdXY}} none {{crypttab_options}}

systemd-cryptsetup attach {{mapping_name}} {{/dev/sdXY}} {{path/to/keyfile}} {{crypttab_options}}

systemd-cryptsetup detach {{mapping_name}}