Using dd to securely erase a hard drive


Recommended Posts

I am getting ready to sell/give away some PCs. To securely erase their hard drives, I am using dd.

Below is what I have set to run (entered into a terminal):

dd if=/dev/zero bs=1024 of=/dev/sda && dd if=/dev/urandom bs=1024 of=/dev/sda && dd if=/dev/zero bs=1024 of=/dev/sda

I was expecting this to take probably about a day to complete. One machine (with a 640GB hard drive) has been going for a few hours now. Another machine (with a 200GB drive) seems to have completed (after about three to four hours), and displayed the following in the terminal:

dd: writing `/dev/sda': No space left on device

195360985+0 records in

195360984+0 records out

200049647616 bytes (200 GB) copied, 13789 s, 14.5 MB/s

I'm not sure if all three dd writes I specified took place, or if it got to the end of the hard disk after the first pass and quit. Could someone confirm?

I should have written a script instead of using "&&".

dd also doesn't display a progress bar. Should I also be specifying the size of the hard disk? If so, how is this done? This may also fix the problem above.

doing anything with random is just a waste of time.. writing zeros is more than secure enough

simple

dd if=/dev/zero of=/dev/sda

is all that is needed, if you want to speed it up a bit more, use bs=1m

Depends on the M/m thing, mac requires either lower or upper case and linux requires the inverse case, can never remember which way round it is or why it's such a stupid system.

Alternatively, there's always NAB (Nuke and Boot)

NAB (Nuke and Boot) aka dBan was brilliant but isnt it abandonware, There was a bug in the latest version where it almost never worked on any newer drives then the last version.

Thanks for all your replies. :)

I ended up writing a script (I don't think using && is correct).

So far, it's been 48 hours, and the PC with the 640GB drive is still on the urandom phase! Looks like it won't complete for another day.

I thought I would do three passes for extra security. The PCs had some confidential data on them. I should ask someone at a hard disk recovery lab about this.

I will try specifying a bigger block size next time - I'm not sure if there are any downsides to this. The hard disks are being written to at about 15 to 20 MB/s at present.

A single zerofill pass should probably be enough.

http://en.wikipedia....erwrites_needed

Which has a reference to:

http://www.wired.com...assange-laptop/

where it's mentioned that the army data forensic contractors could not recover anything from Manning's drive before the single zero-fill pass.

"The PCs had some confidential data on them"

So -- were they the launch codes for the US Nuclear arsenal? Even if they were - single Zero write would remove the ability for anyone to recover.

Since when is 20MBps the speed of a modern hdd, this should of taken you a few minutes to accomplish not days and days!

here

http://www.vidarhole..._drive_data.pdf

Overwriting Hard Drive Data: The Great Wiping Controversy

Abstract. Often we hear controversial opinions in digital forensics on the required or desired number of passes to utilize for properly overwriting, sometimes referred to as wiping or erasing, a modern hard drive. The controversy has caused much misconception, with persons commonly quoting that data can be recovered if it has only been overwritten once or twice. Moreover, referencing that it actually takes up to ten, and even as many as 35 (referred to as the Gutmann scheme because of the 1996 Secure Deletion of Data from Magnetic and Solid-State Memory published paper by Peter Gutmann) passes to securely overwrite the previous data. One of the chief controversies is that if a head positioning system is not exact enough, new data written to a drive may not be written back to the precise location of the original data. We demonstrate that the controversy surrounding this topic is unfounded.

4 Conclusion

The purpose of this paper was a categorical settlement to the controversy surrounding the misconceptions involving the belief that data can be recovered following a wipe procedure. This study has demonstrated that correctly wiped data cannot reasonably be retrieved even if it is of a small size or found only over small parts of the hard drive. Not even with the use of a MFM or other known methods. The belief that a tool can be developed to retrieve gigabytes or terabytes of information from a wiped drive is in error.

Although there is a good chance of recovery for any individual bit from a drive, the chances of recovery of any amount of data from a drive using an electron microscope are negligible. Even speculating on the possible recovery of an old drive, there is no likelihood that any data would be recoverable from the drive. The forensic recovery of data using electron microscopy is infeasible. This was true both on old drives and has become more difficult over time. Further, there is a need for the data to have been written and then wiped on a raw unused drive for there to be any hope of any level of recovery even at the bit level, which does not reflect real situations. It is unlikely that a recovered drive will have not been used for a period of time and the interaction of defragmentation, file copies and general use that overwrites data areas negates any chance of data recovery. The fallacy that data can be forensically recovered using an electron microscope or related means needs to be put to rest.

This topic is now closed to further replies.
  • Posts

    • AnyDesk 9.7.7 by Razvan Serea AnyDesk is a fast remote desktop system and enables users to access their data, images, videos and applications from anywhere and at any time, and also to share it with others. AnyDesk is the first remote desktop software that doesn't require you to think about what you can do. CAD, video editing or simply working comfortably with an office suite for hours are just a few examples. AnyDesk is designed for modern multi-core CPUs. Most of AnyDesk's image processing is done con­currently. This way, AnyDesk can utilize up to 90% of modern CPUs. AnyDesk works across multiple platforms and operating systems: Windows, Linux, Free BSD, Mac OS, iOS and Android. Just 7 megabytes - downloaded in a glimpse, sent via email, or fired up from your USB drive, AnyDesk will turn any desktop into your desktop in se­conds. No administrative privileges or installation needed. AnyDesk 9.7.7 fixes: Fixed an issue that prevented users from creating meetings without an active license Download: AnyDesk 9.7.7 | 8.0 MB (Free for private use, paid upgrade available) Links: AnyDesk Home Page | Other platforms | Release History | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • I used a Pixel 10 Pro XL when it first came out for about 8 months. When I first got it, it was using Google assistant and that was fast, when asking it to call somone etc. Then it automatically switched with some update to Gemini. Doing even the simplist of things like asking it to call someone in my contacts was soooooo slow compared to Google assistant. I guess it had to go out to the cloud to do that? Back on iPhone and while Siri is dumb right now, it does do those simple things, like call someone, set a timer, star the stop watch etc, really fast. That an while I like Google Material Design 3 over iOS 26, they Pixel 10 Pro XL was so slow in comparison to the iPhone 17 Pro I am using.
    • I use Gemini in my rotation of AI clients...that work pays for. It is good at most things, better than copilot for imgage searching and making images, worse at writing vs Claude and way worse at hadling technical issues when it comes to Azure stuff. I also use YT premium and maps. Anything else Google is a pass for me. I have now seen multiple people locked out of their Google accounts for reasons that are just very vauge.
    • Microsoft is building an AI datacenter that "uses less water than a fast food restaurant" by Ivan Jenic Image: Microsoft Microsoft has announced plans to build a new datacenter campus in Pecos, Texas, as the company continues to invest billions in AI infrastructure. The new facility, called project Kilby, will reportedly have a capacity of 2 gigawatts and will be one of the largest single capacity additions in the company’s history. To power the campus, Microsoft signed a 20-year deal with Chevron to supply natural gas from the Permian Basin, America's largest oil field. This deal is set to become the largest collaboration to date between a U.S. oil and gas giant and Big Tech. It’s no secret that Big Tech has often been criticized for exploiting natural resources for its AI developments. Microsoft is trying to mitigate some of that negative consensus by promising to build its own power supply for the new datacenter, independent of the public grid. The Pecos datacenter will be powered by a power plant hub, built by Chevron, with up to 2.5 gigawatts of gas-fired capacity, with potential to scale to up to 5 gigawatts. The facility will include at least seven GE Vernova turbines, with first power potentially coming online as early as late 2027 or early 2028. The power plant hub is part of an approximately $7 billion investment by Chevron, making it one of the largest dedicated energy projects tied to a single datacenter campus in the U.S. Microsoft hasn’t publicly disclosed the amount it’s investing in the new datacenter. Microsoft has also committed to implementing a closed-loop cooling system that will only require an initial water charge to operate. The company said that “the total lifecycle water use of this datacenter is only a fraction of that consumed annually by a typical fast-food restaurant.” What the press release doesn’t mention, however, is how much water the natural gas plant itself will consume, or how a 20-year fossil fuel commitment squares with the company's pledge to be carbon negative by 2030. The construction of the new datacenter should provide over 6,000 construction jobs at peak build-out, and create hundreds of operational job roles once the facility is built. Via: Reuters
  • Recent Achievements

    • Dedicated
      tuben earned a badge
      Dedicated
    • Week One Done
      mnsgroup earned a badge
      Week One Done
    • Conversation Starter
      sumytbe earned a badge
      Conversation Starter
    • One Year In
      B4dM1k3 earned a badge
      One Year In
    • One Year In
      DarkWun earned a badge
      One Year In
  • Popular Contributors

    1. 1
      +primortal
      524
    2. 2
      +Edouard
      199
    3. 3
      PsYcHoKiLLa
      94
    4. 4
      Michael Scrip
      82
    5. 5
      Steven P.
      67
  • Tell a friend

    Love Neowin? Tell a friend!