Re: wipe utilities

From: sarnoldat_private
Date: Wed Jun 20 2001 - 11:35:54 PDT

  • Next message: Chris Ess: "Re: wipe utilities"

    On Wed, Jun 20, 2001 at 11:44:31AM -0400, Darren Welch wrote:
    > I am looking to draft a corporate policy requiring all hard drives to
    > be wiped before being decommissioned, sold, donated, etc.
    
    Good idea.
    
    > The wipe utility must be able to make numerous (up to seven)
    > uninterrupted passes and support a wide array of file systems (fat,
    > ntfs, etc). 
    
    Hmm. I would hope the wiper doesn't care about the filesystem. A hard
    drive is a hard drive, no matter what filesystem was on the thing.
    
    > Also, the software must support the ability to assign a particular hex
    > character as the wipe character.
    
    Good idea.
    
    My preferred technique is to hook the drive up to a box running any
    flavor of Unix, including the BSDs and the Linuxes. The 'dd' utility can
    easily satisfy all your requirements.
    
    dd if=/dev/zero of=/dev/hda
    
    That will write a whole mess of zeros to your hard drive. Getting other
    values written will require a bit more work, though I would hope
    something such as the following would be a good first shot (noting of
    course that a smarter implementation would probably go much faster):
    
    # boring.c
    #include <stdio.h>
    int main(int argc, char *argv[]) {
    	while(1) {
    		printf("%d", argv[1]);
    	}
    }
    
    ./boring | dd if=- of=/dev/hda
    
    Yeah, it needs work, but it isn't far from being pretty reasonable.
    
    Note that these device names are for IDE drives under Linux. Under other
    versions of Unix-like operating systems the device names will be
    different. SCSI drives will be different.
    
    If stochastic differences are sufficient, you could probably get away
    with a small shell script such as this:
    
    #!/bin/sh
    dd if=/dev/zero		of=/dev/hda
    dd if=/dev/urandom	of=/dev/hda
    dd if=/dev/zero		of=/dev/hda
    dd if=/dev/urandom	of=/dev/hda
    dd if=/dev/zero		of=/dev/hda
    dd if=/dev/urandom	of=/dev/hda
    dd if=/dev/zero		of=/dev/hda
    dd if=/dev/urandom	of=/dev/hda
    
    The urandom device isn't terribly fast, but you may be able to "get away
    with" fewer runs due to the more random behavior. <shrug>
    
    Cheers! :)
    



    This archive was generated by hypermail 2b30 : Thu Jun 21 2001 - 12:05:20 PDT