Ask Your Question

Fedora 26 - How to wipe free disk space and make it unrecoverable?

asked 2017-07-23 10:38:35 -0500

variant13 gravatar image

updated 2017-07-23 14:57:04 -0500

fedora 26 - 'No package secure-delete available.' when trying to manually install suite for: srm ,sfill ,sswap ,smem. Can free space on the drive be wiped unrecoverable without wiping current occupied/used disk space being used, in a safe manor?

edit retag flag offensive close merge delete


The commands below by aeperezt will delete the current files on the drive not just the free space. Do not do them.

rookieoz gravatar imagerookieoz ( 2017-07-24 23:25:23 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2017-07-25 07:24:27 -0500

clnetbox gravatar image

updated 2017-07-26 07:45:00 -0500

To wipe free space safely without wiping existing data execute :

dd if=/dev/urandom of=/path-to-mounted-partition/zerofillfile bs=1M

This fills and overwrites the free space with the zerofillfile.

Afterwards remove the file by executing : rm -f zerofillfile

Depending on how sensitive the deleted data was, consider to repeat it multiple times.

In case you wipe free space on a SSD execute fstrim before :

sudo fstrim /path-to-mounted-partition

edit flag offensive delete link more


Using if=/dev/urandom should yield better results for wiping data.

It's crucial to write zerofillfile onto the right partition, so use of=/path-where-the-partition-is-mounted/zerofillfile or navigate terminal to the correct path before executing dd command.

Wiping SSDs is trickier, free space across entire disk (other partitions' free space, unpartitioned areas) has to be overwritten.

In general multiple overwrites might be necessary to be proofed from advanced recovery techniques.

ozeszty gravatar imageozeszty ( 2017-07-26 05:50:36 -0500 )edit

@ozeszty : Thank you for your contribution. I assumed that it is a known fact that you have to navigate to the partition you want to wipe. Nevertheless I changed the content accordingly and included your suggestion into the answer. Thanks again ! :)

clnetbox gravatar imageclnetbox ( 2017-07-26 07:51:53 -0500 )edit

answered 2017-07-24 23:26:16 -0500

rookieoz gravatar image

updated 2017-07-28 02:57:47 -0500

I gave instructions on how to use dd and shred before re-reading your question.

The answer from aeperezt recommending dd will delete the current files on the drive not just the free space.

Do not do use the normal dd command if you only want to wipe already deleted files. Make sure you add the /zerofillfile portion.

edit flag offensive delete link more

answered 2017-07-23 10:55:55 -0500

aeperezt gravatar image

Best option is to overwrite the data on the target disk using dd


sudo dd if=/dev/zero of=/dev/sdX bs=4096


sudo dd if=/dev/urandom of=/dev/sdX bs=4096

Where sdX is your hard disk partition like /dev/sdb1.

Please be careful if you give the wrong partition all data will be erased and unrecoverable.

edit flag offensive delete link more



dd is sufficient or you can use scrub or dban, both overkill

bodhi.zazen gravatar imagebodhi.zazen ( 2017-07-23 12:52:03 -0500 )edit

dd is sufficient as it overwrites the existing data.

aeperezt gravatar imageaeperezt ( 2017-07-23 15:08:10 -0500 )edit

he only wants to write over free space and already deleted files. you should delete this post so people don't copy your commands expecting to keep there existing files.

rookieoz gravatar imagerookieoz ( 2017-07-24 23:15:57 -0500 )edit

How do you know/control that dd has finished ?

PingVin gravatar imagePingVin ( 2017-08-29 11:04:59 -0500 )edit

Question Tools

1 follower


Asked: 2017-07-23 10:38:35 -0500

Seen: 2,192 times

Last updated: Jul 28 '17