SECURE erase of a HDD drive (FREE)

jimbo45

New Member
VIP Member
Guru
Messages
4,373
Location
Hafnarfjörður IS
Hi there

sometimes you want to REALLY erase a HDD -- this FREE method will write X'00' - Hex zeros - on every writeable are on your disk -- destroying / removing previous data -- while this isn't of military strength or "CIA" proof it's certainly good enough for normal home purposes. A normal delete doesn't actually delete DATA until that space is reclaimed and overwritten, it merely deletes the file entry from the directory so unscrupulous people could access some of your data.

If a Disk has been contaminated with a Virus this is also a good way to ensure it's GONE too !!. I always do this procedure if I'm giving away an old computer of I acquire some used HDD's == you never know what might be on them.

I also do this if I'm installing / re-installing Windows from scratch -so I'm 100% sure that the Windows disk is clean -- nothing lurking in the MBP / partition table areas of the disk.

You need access to a Linux system either as a Host or even as a VM - works fine -- or even simply boot up one of the LIVE distros available anywhere so you don't even need to install anything and boot from a USB.

now simply use this simple command :

dd if=/dev/zero of=/dev/sda bs=4k conv=notrunc

if is the INPUT file I- in this case simply a Null / hex 00
of is your output disk in this case /dev/sda. you can use the command df which will list your disks (or even FDISK -l similar to the Windows command),

To check just type
dd if=/dev/sda | hexdump -C | grep [^00]

Most windows users could easily handle this I'm sure -- pity Windows doesn't AFAIK have this type of command in it to erase completely a Disk. Merely doing "CLEAN, create partition primary and reformatting it won't erase a disk completely - some of these data recovery systems can even recover data from a newly formatted partition).

If this type of approach scares you - then you could look for some Windows freebie 3rd party software -- but I'm beginning to get a bit paranoid about some 3rd party software that's making the rounds these days especially with things like HDD utilities --often it's not the utility itself but the download sites - which confuse people as to where the download is, have toolbars / other helpers / adware / trialware etc.

I regard myself as a fairly experienced use and I regularly find some sites really hard to get the proper download from --nearly loaded wrong software more than once - so using an OS IMO is the safest way. !!

(BTW you can also CLONE a complete disk with this too -- although it takes a while as it's a byte to byte copy -- and if target disk is larger than source disk you'll have to re-size partition with a partition manager such as GPARTED (usually standard in the Linux Live systems. -dd if=/dev/sda of=/dev/sdb bs=64k conv=notrunc,noerror).

Actually that's all Clonezilla is anyway - just a GUI wrapped around the DD command !!!

While there are some useful commands in the windows command shell it seems that it's getting ever harder to find and use them -- it would be nice if things like the Power shell had some sort of decent documentation -- or even brief documentation like the Linux Man command. Perhaps in the general dumbing down of the system these days Ms doesn't want people to know that there IS even a command line any more !!!

Cheers
jimbo
 

My Computer

System One

  • OS
    Linux Centos 7, W8.1, W7, W2K3 Server W10
    Computer type
    PC/Desktop
    Monitor(s) Displays
    1 X LG 40 inch TV
    Hard Drives
    SSD's * 3 (Samsung 840 series) 250 GB
    2 X 3 TB sata
    5 X 1 TB sata
    Internet Speed
    0.12 GB/s (120Mb/s)
Back
Top