Possible Duplicate:
How can I reliably erase all information on a hard drive?

If I wipe free space with zeros instead of random data to finish fast will that write old file to be unrecoverable, will use this command on ubuntu on ntfs and ext4 volumes.

cat /dev/zero > Wiped

Will that be secure or I must Use /dev/urandom

  • On classical hard-disks this might work with some file systems, on SSDs it probably won't. Commented Nov 17, 2012 at 11:18
  • If you have a SSD doing this command WILL decrease its lifespan. There are SSD tools that will perform a similar function and do it the correct way. As for filling in freespace with only 0's, no thats not enough, since your filling in 0's with 0's.
    – Ramhound
    Commented Nov 19, 2012 at 19:36

2 Answers 2


The only way to really guarantee that data cannot be recovered is (a) use full-disk encryption, so all sensitive data is already encrypted before it hits the media, and then (b) destroy the encryption key when you no longer want the data on that media.

spinning disks

Yes, a single zero-fill, on a spinning disk, is adequate.

Civilian data recovery companies cannot recover data off spinning disks after a single zero-fill. There is no evidence that anyone else can, either. In spite of the popular urban legends you might have heard. a b c d e

solid-state media

A zero-fill is probably inadequate on solid-state media, but using random-data-fill or multiple passes or both, aren't any better.

Solid-state "disks" typically have extra space used for wear-leveling that cannot be read or written to with normal tools. Sensitive data that ends up in this extra space is not guaranteed to be erased, no matter what data patterns you write and no matter how many passes you make.

See Is it enough to only wipe a flash drive once? .

  • Can you comment on "If you write the entire drive with zeros, it will be quite easy to see what data was written before" from (marksanborn.net/howto/wiping-a-hard-drive-with-dd)?
    – Motivated
    Commented Dec 31, 2018 at 22:21
  • 1
    @Motivated: I'm guessing that 2008 article is repeating a popular urban legend based on a common misunderstanding of the 1996 Gutmann article. The references in this answer (from 2009 and later) all seem to agree that a single pass of zero-fill is adequate.
    – David Cary
    Commented Jan 3, 2019 at 2:38

You can also use shred (Most Linux distribution come with shred already installed.)

$ shred -f -u -v -z filename

Explanations :

-f change permissions to allow writing if necessary
-u truncate and remove file after overwriting
-v be verbose (detailed) and show progress
-z add a final overwrite with zeros to hide shredding

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