secure remove and delete all files and (sub)folder

!WARNING! ONCE DELETED THOSE FILES WON’T COME BACK!

hostnamectl; # tested on 
         Icon name: computer-laptop
            Kernel: Linux 4.19.0-16-amd64
      Architecture: x86-64

su - root
apt install secure-delete

# long version
srm -vr /path/to/dir/to/secure/erase

# quick & dirty version
srm -vrl /path/to/dir/to/secure/erase

Using Wipe Tool

Wipe using the Gutmann method, the theoretical basis is the college in 1996 Oakland University computer science professor Peter Gutmann in the sixth session of the USENIX security on the paper, “safely remove magnetic solid memory data”.

mirror as pdf: Peter Gutmann – Secure Deletion of Data from Magnetic and Solid-State Memory.pdf

This is by far the most secure data deleting method, covering data 35 times that any attempt to restore the data are in vain. Wipe uses repeated write 34 times to the random number generation data Gutmann, removal of the object can be a single file, folder and the whole disk. With the hard disk capacity is larger and larger, rewriting the time will be longer, so wipe also provides only 4 times rewritable fast mode.

wipe.manpage

Type the following command to install wipe tool

apt-get install wipe; # install wipe

http://www.itsprite.com/3-best-tools-to-delete-data-securely-in-linux/

Sample:

Securely Delete a file using wipe command

wipe config.txt; # wipe a file

Securely delete directory using wipe command

wipe -r /tmp; # wipe a directory

# example:
wipe -r porn/; # wipe a directory with porn, because it could be used against you

Okay to WIPE 1 directory ? (Yes/No) Yes # very good! it asks for confirmation

Wiping Amber Peach Masturbates At Home., pass 14 (23)
# c'mon guys! 28 PASSES! Really? :-D (you will have to let it run... otherwise it won't delete it, so sit back, relax, do something else :-D

Delete the entire disk partition a possible

wipe /dev/sdb1; # wipe entire partition (!!! DANGER ! NOT A DIRECTORY !!!)

alternative (tested, unpatient, canceled, took too long, did not really do anything)


apt-get install secure-delete; # install software

Second, use sfill to wipe out unused space on your disk:

sudo sfill -f <directory>; # securely delete a directory

sfill.manpage

liked this article?

  • only together we can create a truly free world
  • plz support dwaves to keep it up & running!
  • (yes the info on the internet is (mostly) free but beer is still not free (still have to work on that))
  • really really hate advertisement
  • contribute: whenever a solution was found, blog about it for others to find!
  • talk about, recommend & link to this blog and articles
  • thanks to all who contribute!
admin