CRYPTSETUP-ERASE(8)
π CRYPTSETUP-ERASE π
okay so bestie, this is the cryptsetup-erase manual page (you'll also see it as cryptsetup-luksErase), and it's literally the "nuke the keys" button. Let's get into it π
β¨ NAME β¨
cryptsetup-erase, cryptsetup-luksErase β erase all keyslots π
πΈ SYNOPSIS πΈ
cryptsetup erase [<options>] <device>
cryptsetup luksErase [<options>] <device>
π¦ DESCRIPTION π¦
So this one erases all the keyslots and yeets the volume key entirely. Unless your device is set up with OPAL self-encrypting drive support, you do not need to hand over any password for this. Like, none. It just goes. π
This operation is irreversible. Unless you have a header backup, every bit of old encrypted data in the container is permanently irretrievable. Periodt. And heads up β a header backup cannot be used to recover data from OPAL self-encrypting drives, because those keys get permanently removed from the hardware. Gone gone.
Also, lowkey important: the erase does not wipe or overwrite the data area. It only removes all active keyslots from the LUKS device. If you wanna know how to wipe the whole device including the encrypted data, go read the cryptsetup FAQ. π
And note β the --hw-opal-factory-reset option for an OPAL self-encrypting drive will erase ALL data on the drive, regardless of which partition you run it on. Not just yours. The whole drive. π
<options> can be [--header, --disable-locks, --hw-opal-factory-reset, --key-file].
π OPTIONS π
--batch-mode,-qβ Suppresses all confirmation questions. Use with care, bestie! If the--verify-passphraseoption is not specified, this option also switches off the passphrase verification. β οΈ--debugor--debug-jsonβ Run in debug mode with full diagnostic logs. Debug output lines are always prefixed by#. If--debug-jsonis used, additional LUKS2 JSON data structures are printed. Very giving "I want to see everything" energy. π--disable-locksβ Disable lock protection for metadata on disk. This option is valid only for LUKS2 and is 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).
--header <device or file storing the LUKS header>β Use to specify a detached LUKS2 header when erasing an OPAL self-encrypting drive.--help,-?β Show help text and default parameters. Your lil cheat sheet. π«Ά--hw-opal-factory-resetβ Erase ALL data on the OPAL self-encrypting drive. This option does not require a valid LUKS2 header to be present on the device to run. After providing the correct PSID via interactive prompt or via the--key-fileparameter, the device is erased. π- PSID is usually printed on the OPAL drive label (either directly or as a QR code). PSID must be entered without any dashes, spaces or underscores.
- PSID should be treated as sensitive information, because it lets anyone with remote access to the OPAL drive destroy data even if the device is locked. Be sure you do not leak PSID through transparent packaging during transport or images of the drive posted online. Like, please don't post it. π«πΈ
--key-file,-dfile (LUKS2 with HW OPAL only) β Read the Admin PIN or PSID (with--hw-opal-factory-reset) from the file, depending on the options used. If the name given is-, then the secret will be read from stdin. In this case, reading will not stop at newline characters. π§--usageβ Show short option help. The tiny version.--version,-Vβ Show the program version. Slay, what version we on? β
π REPORTING BUGS π
Found a bug? Report it at the cryptsetup mailing list <cryptsetup@lists.linux.dev> or in the Issues project section at <https://gitlab.com/cryptsetup/cryptsetup/-/issues/new>. π
Please attach the output of the failed command with the --debug option added. It helps so much, fr fr. π
π SEE ALSO π
- Cryptsetup FAQ
<https://gitlab.com/cryptsetup/cryptsetup/wikis/FrequentlyAskedQuestions> cryptsetup(8),integritysetup(8)andveritysetup(8)
π CRYPTSETUP π
Part of the cryptsetup project <https://gitlab.com/cryptsetup/cryptsetup/>. π
and that's the whole page, bestie!! this was cryptsetup version 2.8.8, dated 2026-09-07, from the cryptsetup 2.8.8 era β now go back up your headers before you erase anything, i'm literally begging π«Άπβ¨
π¦ where this page comes from
- arch rolling: cryptsetup 2.8.8-1 Β· GPL-2.0-or-later
- fedora 44: cryptsetup 2.8.8-1.fc44 Β· GPL-2.0-or-later WITH cryptsetup-OpenSSL-exception AND LGPL-2.1-or-later WITH cryptsetup-OpenSSL-exception
- nixpkgs unstable: cryptsetup 2.8.8
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms