especially in times of EU-GDPRDSGVO but also for the user’s privacy effectively shredding data is important.

if the admin-user wants to wipe-shred-secure-delete entire harddisks look at this article.

GNU Linux Debian 10 can do that 🙂

update: 2024: want to resell harddisk? shred it many many times for example with the help of this shred_harddisk_with_logs.sh “secure & fast wipe and refurbishment harddisk script v1.1 by dwaves.org GPLv2” script! 🙂

# install software
# deb based
hostnamectl; # tested on
  Operating System: Debian GNU/Linux 10 (buster)
            Kernel: Linux 4.19.0-14-amd64
      Architecture: x86-64
apt install zip secure-delete

# rpm based
hostnamectl; # tested on
  Operating System: CentOS Linux 8
       CPE OS Name: cpe:/o:centos:centos:8
            Kernel: Linux 4.18.0-240.10.1.el8_3.x86_64
      Architecture: x86-64
yum install zip srm.x86_64

# encrypt all files also filenames (good idea to also encrypt meta info too)
# warning! name the folder or file.zip to encrypt something random ! X-D
FILENAME=$RANDOM
mv -v /folder/to/encrypt /folder/to/$FILENAME
zip -r $FILENAME.zip /folder/to/$FILENAME

#      OUTPUT-FILE             INPUT-FILE
zip -e $FILENAME.encrypted.zip $FILENAME.zip

lsb_release -a; # tested on
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 10 (buster)
Release:	10
Codename:	buster

apt install wipe
wipe *
Yes? # type Yes hit Enter
... overwrite 34x passes with zeros # pretty fast :)

# srm is complaining about "HARDLINKED" files for whatever reason
# then shred the unencrypted version of the file
# default mode: overwrite with 38x passes of random (recommended unless it is really not possible)
srm -vr /folder/to/$FILENAME
srm -vr $FILENAME.zip

# minimum paranoia: overwrite with 1x pass of random
srm -rfllv /folder/to/$FILENAME
srm -rfllv $FILENAME.zip

related manpages:

wipe.man.txt

zip.man.txt

srm.man.txt

can only do files:

shred.man.txt

GNU Linux – automatic harddisk wipe secure delete erase script with dd

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