0

I wanted to encrypt a flash drive but it didn't went well. Then I tried to remove the encryption but I am unable to do it.

Here is some info: LUKS header information Version: 2 Epoch: 4 Metadata area: 16384 [bytes] Keyslots area: 16744448 [bytes] UUID: 9f4cbeda-4733-4aa9-873f-764705300bee Label: (no label) Subsystem: (no subsystem) Flags: (no flags)

Data segments:
  0: crypt
        offset: 16777216 [bytes]
        length: (whole device)
        cipher: aes-xts-plain64
        sector: 512 [bytes]

Keyslots:
Tokens:
Digests:
  0: pbkdf2
        Hash:       sha256
        Iterations: 100669
        Salt:       59 c1 f4 ec 5a d2 17 ae 9f 2a 06 73 9c c2 b8 8e 
                    e8 02 0e 26 5c 8a 5a 33 a9 3e 98 ce 20 04 b8 c0 
        Digest:     f2 f9 3b 7e 53 48 2b 24 05 4d c3 b9 42 4c 3b 1e 
                    ef 8a 1f f5 22 85 25 de fc f9 e4 02 ac 0f 8b 9d 
Ethan0456
  • 3
  • 2

1 Answers1

0

You cannot "remove" LUKS encryption AFAIK, you need to format/recreate your partition.

Steps to convert it back to a normal USB drive:

sudo unmount /mount/point
sudo cryptsetup close /dev/mapper/name
cat /dev/zero > /dev/device1
sudo mkfs.ext4 /dev/device1 (or mkfs.exfat/mkfs.vfat/mkfs.ntfs)

The cat command is not strictly necessary but really desired. If you don't run it you may discover files filled with random data.

mkfs.ext4 may refuse to run saying that there's data on the partition, in which case use the -F flag.

Artem S. Tashkinov
  • 26,392
  • 4
  • 33
  • 64