The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Special Forums > Filesystems, Disks and Memory
.
google unix.com



Filesystems, Disks and Memory Discuss NAS, SAN, RAID, Robotic Libraries, backups, RAM, DRAM, SCSI, IDE, EIDE topics here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
minfree contents of the disk vr_mari SUN Solaris 7 05-15-2009 02:01 PM
hard disk and san lo-lp-kl AIX 4 06-12-2008 01:13 PM
Hard Disk hmaraver UNIX Desktop for Dummies Questions & Answers 4 07-03-2005 03:50 PM
RAM, Hard Disk ramaraju UNIX for Dummies Questions & Answers 2 03-01-2005 08:35 PM
How to Copy Contents from CD to Hard disk vr76413 UNIX for Dummies Questions & Answers 4 07-06-2003 12:20 AM

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 06-02-2009
jake24 jake24 is offline
Registered User
  
 

Join Date: May 2009
Posts: 7
Unhappy Erasing hard disk contents using dd or dcfldd

Hi,

I am writing a script to wipe my hard disk, in a relatively secure manner by over-writing the disk with 3 patterns. So, I run the dd/dcfldd command 3 times with a sync call in between each command call in the script.

Code:
#!/bin/sh
dcfldd pattern=99 conv=notrunc of=/dev/sda
sync
dcfldd pattern=jj conv=notrunc of=/dev/sda
sync
dcfldd pattern=hell conv=notrunc of=/dev/sda
sync
I want to know if the above code would in fact,result in my hard disk being over-written with the given patterns in that order? Since I have introduced a sync in between each command call, any remaining buffers to be written onto the disk would have been physically written before the next pattern is being copied to the disk by dcfldd.

Please help me. I really want to understand the impact.
  #2 (permalink)  
Old 06-04-2009
Corona688 Corona688 is offline
Registered User
  
 

Join Date: Aug 2005
Location: Saskatchewan
Posts: 1,909
If this is a hard drive and not some solid-state storage device, overwriting the entire disk with plain ordinary zeroes will prevent anyone except NSA men in cleanroom spacesuits from reading the previous data. If your data thieves are that motivated, all bets are off anyway.

I'd make your patterns prime number lengths, perhaps 5, 7, and 11 characters, to give maximum annoyance to the cleanroom spacesuit people since this will make a very long-interval thing for them to have to predict and compensate for.

Last edited by Corona688; 06-04-2009 at 04:33 PM..
  #3 (permalink)  
Old 06-04-2009
wireonfire wireonfire is offline
Registered User
  
 

Join Date: Oct 2008
Posts: 19
I'm in no way an expert on this. But I'd think you can try to read the swiped disk using dd and see if there is any old data.

dd if=/dev/sda of=somefile ....
  #4 (permalink)  
Old 06-04-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,788
As Peter Gutmann put it
Quote:
Originally Posted by Secure Deletion of Data from Magnetic and Solid-State Memory (Epilogue)
As the paper says, "A good scrubbing with random data will do about as well as can be expected". This was true in 1996, and is still true now.
If you've got /dev/urandom (or some similar source or "randomness") dd that to your disk. If it's not available, choose any pattern, and overwrite a second time using the complement number.

If you've got to delete HDDs often and/or want to be extra sure, DBAN is very recommendable.
  #5 (permalink)  
Old 06-04-2009
robsonde robsonde is offline
Registered User
  
 

Join Date: Dec 2007
Posts: 158
Even after random data has been written to the drive it maybe possible to recover data using special tools that government agencies have access to.

If this is a problem for you and you really think that the government is out to get you, then you should simply destroy the drive and buy a new one.

Exactly how you destroy it is up to you but I read that the US government has a system for destroying computer equipment by cross cut, crush, grind, burn and then spread on the roads as grit in winter.
  #6 (permalink)  
Old 06-05-2009
jake24 jake24 is offline
Registered User
  
 

Join Date: May 2009
Posts: 7
Thanks everyone for the responses.
Actually my doubt is if I am doing 2 swipes over the disk with a pattern and its compliment, using either dd/dcfldd for the purpose in a script, then the first swipe should have actually ended up physically on the sectors on disk before the second swipe.
With the script I have pasted in my first post, is the sync in between 2 swipes sufficient to ensure that?
Can anyone help me with some pointers on the impact of OS/disk caches on the way to disk sectors?
  #7 (permalink)  
Old 06-05-2009
pludi's Avatar
pludi pludi is offline Forum Staff  
Moderator
  
 

Join Date: Dec 2008
Location: .at
Posts: 1,788
The sync is useful, but not really necessary (IMO). It does tell the kernel to write it's caches and metadata to disk, but you can't force the HDD cache. But even with a 64MB on-disk cache: that will be full & written to disc 2 seconds after you started writing the second pass.
Sponsored Links
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -4. The time now is 07:17 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language translation by Google.
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0