1

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

illsecure
  • 157
  • 3
  • 9
  • On classical hard-disks this might work with some file systems, on SSDs it probably won't. – CodesInChaos Nov 17 '12 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 Nov 19 '12 at 19:36

2 Answers2

4

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? .

David Cary
  • 2,720
  • 4
  • 19
  • 20
  • 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 (https://www.marksanborn.net/howto/wiping-a-hard-drive-with-dd/)? – Motivated Dec 31 '18 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 Jan 03 '19 at 02:38
0

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
Yohann
  • 197
  • 1
  • 6