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 
1
  • 1
    removing as in conversion while keeping any encrypted data on it, or as in reformatting from scratch? Commented Dec 30, 2021 at 15:20

1 Answer 1

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.

3
  • Means I cant get back to normal file saving flash drive? Commented Dec 30, 2021 at 15:08
  • I've updated the answer with the insuctions how to make your flash drive unecrypted. Commented Dec 30, 2021 at 15:37
  • 1
    Yes Sir it worked, thanks a lot and Happy New Year. Commented Dec 31, 2021 at 16:04

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.