Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To wipe free space safely without wiping existing data execute :

dd if=/dev/zero of=zerofillfile bs=1M

This fills and overwrites the free space with the zerofillfile.

Afterwards remove the file by executing : rm -f zerofillfile.

To wipe free space safely without wiping existing data execute :

dd if=/dev/zero of=zerofillfile bs=1M

This fills and overwrites the free space with the zerofillfile.

Afterwards remove the file by executing : rm -f zerofillfile.

To wipe free space safely without wiping existing data execute :

dd if=/dev/zero of=zerofillfile 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