I know that I wipe a USB drive from Linux by doing a dd overwriting the whole device with random data. This however may take a very long time.

Is it possible to do this faster (and still safely), by asking the drive to erase all unused space? That is to activate the flash erase process.

Edit: What I'm looking for is a way to do the electrical erase of all blocks in the flash. Blocks set aside for wear leveling should also be possible to erase.

Perhaps SD cards have better features for this.

  • 2
    First sentence is unfortunately wrong, due to logical remapping and wear levelling. This question has been asked and answered a dozen times already.
    – Ben Voigt
    Commented Jun 21, 2023 at 14:30
  • 1
    The first sentence only applies to HDDs afaik Commented Jun 21, 2023 at 15:34
  • iirc speed depends also on dd options like "bs"
    – secfren
    Commented Jun 22, 2023 at 16:40
  • 2
    Does this answer your question? Is it enough to only wipe a flash drive once?
    – Zac67
    Commented Jun 23, 2023 at 16:57
  • That is very interesting answer, but my target is USB drives. Suppose that USB drives with these features can be bought. Commented Jun 23, 2023 at 21:22

2 Answers 2


Actually I found an other solution, that secures my data. Being in a Linux world, I simply format the drive with LUKS before saving anything secret on the drive. This is actually similar to the SSD encryption in the question @Zac67 referred to.

There is a fine description of formatting a drive here: https://sorenpoulsen.com/encrypting-a-usb-flash-drive-on-ubuntu

And the best thing is that it works out of the box with latest Ubuntu. I'm sure that similar things are available for Windows.

  • 1
    Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.
    – Community Bot
    Commented Jun 23, 2023 at 23:51

On modern drives you have two kinds of storage: The official storage containing your data, which you can easily read, write or erase, and unofficial space which has no APIs to read and write them, and can contain bits of old data. For example, a one TB SSD drive will have several gigabytes of space used to make operations faster (a completely full SSD drive is really slow, so your 1000 GB drive is really 1020 GB or some number like that, so it is never completely filled and remains 💨 .

So overwriting the “official” space is easy. Overwriting the “unofficial” space isn hard. Reading it is also hard, but I wouldn’t rely on that for security.

So you turn on full disk encryption asap before anything secret is written. That will encrypt all the “official” data. To destroy all the data you just destroy the keys for full-disk encryption. Now all the official storage looks like gibberish the unofficial storage may contain bits of the original, unencrypted data, plus gibberish for all encrypted data.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .