Fedora – Formatting LUKS encrypted disk

encryptionexternal-hddfedoraluks

How do I format LUKS encrypted disk if I don't know the passphrase?

I recently switched my HDD for a new SSD disk in my laptop and now when I connect the old HDD externally I can't mount disk event with the right passphrase (I assume I am doing something wrong at this point). However I want to format that disk and use it as regular external HDD, so is there a way how to do that? All tutorials I've found requires the knowledge of passphrase.

This is what I get during unlocking

Error unlocking /dev/dm-6: Command-line `cryptsetup luksOpen "/dev/dm-6" 
"luks-5a73e3e1-6b40-415f-8c40-ca14faecc7cb" ' 
exited with non-zero exit status 1: .

Best Answer

If you want to overwrite the data of the encrypted disk with non-encrypted data anyway (i.e. you don't care about the current contents), you don't have to unlock the drive/partition first.

If the partition has a particular uncommon partition type, you might want to change that, but it is not necessary. You can just use mkfs.ext4 (or any filesystem type you prefer) on the partition which contains the LUKS encrypte partition.

Related Question