If you have a hard disk you need to scrap or sell and you want to remove your data from it, this is the place for you. In our case, we had 700 3TB disks that need to be wiped and resold so we wanted to make sure it would be very difficult for even professionals to get the data off of them.
If you know what you are doing but just need the script click HERE to download it or skip down to QUICK SCRIPT TO WIPE HARD DRIVE, below.
The script below is self explanatory for anyone familiar with DISKPART but if you are not, you need to figure our which DISK and which VOLUME you want to kill. To do that we simply run through the script manually once and then all of the others will be the same:
- Connect a disk you want to kill (as stated, we used a USB kit)
- Open a CMD prompt as an administrator
- Type DISKPART and press enter
- Type LIST DISK and press enter then note the number of the disk you want to wipe
- Type SELECT DISK x and press enter where X is the disk you want to wipe
- Type CLEAN and press enter – this will wipe the disk
- Type CONVERT GPT and press enter
- Type CREATE PARTITION PRIMARY and press enter
- Type LIST VOLUME and note the new volume numberIf you want to finish this disk off continue through this list, or just modify THIS script to match your VOLUME # and DISK # and run it
- Type SELECT VOLUME x and press enter, where x is the volume you want to kill
- Type FORMAT QUICK FS=NTFS LABEL=NEW2U and press enter
- Type ASSIGN LETTER=”U” and press enter
- Type EXIT and press enter
Once you know the DISK # and the VOLUME # you can download THIS SCRIPT and unzip and run it. In fact there are two scripts included:
QUICK SCRIPT TO WIPE HARD DRIVE:
Download the disk wiping script HERE or build one yourself using the code below.
You can run first script by bringing up a CMD prompt as an administrator, change the directory you unzipped the files into (I used C:\TEMP) and then type:
DISKPART /S WIPE.CMD
Where WIPE.CMD is the following:
select disk 1
create partition primary
select volume 3
format quick FS=NTFS label=New2U
QUICK SCRIPT TO WIPE DRIVE, OVERWRITE then WIPE AGAIN:
Simply removing partitions and volumes does not make it impossible to recover the data. To do that you have to overwrite parts of the disk. To meet various government and industry standards, various “destructive wipe” tools will copy zeros to every sector on a disk, perhaps more than once. For most people that is overkill, so we devised a faster, simpler solution:
- Wipe the disk using the above script
- Automate the copying of files to the disk
- Wipe the disk again
This is definitely NOT as secure as certified solutions that write over the whole disk, but it is a whole last faster and very effective.
In our case the disks had data striped across many disks which means to get a single file back, you would need to have more than one disk and rebuild the RAID array before you could even attempt a recovery. Good luck with that. The CIA with an unlimited budget and manpower can do this but no-one else is.
To make this more flexible our script calls to copy anything named TEMP in the same folder as the script, to the doomed drive. The idea being you can easily copy more or less as you see fit. If you are more worried about protecting the data on your former disk, copy more stuff or larger stuff.
In our case I simply took a 10MB EXE file, renamed it TEMP.EXE and then made 20 copies of it. That means our script would copy 200MB of garbage to the drive. If you had more time, you could find a larger file, rename it temp.anything and then make 100 copies of it. The script would then copy those files larger file to the doomed drive making it even more unlikely recoverable.
The WIPE-COPY-WIPE.bat file HERE does just that. This is not acceptable for government data but just fine for almost everyone else.
If you want more information on how to overwrite a drive, you will like THIS article.