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

    • Less powerful than a PS5 at twice the price! I wonder if they use that for marketing? Totally DoA.
    • Astra 0.6.1 Beta by Razvan Serea Astra is an audiophile music player designed for local music libraries, supporting MP3, FLAC, WAV, AAC, OGG, M4A, OPUS, WMA, AIFF, and more via FFmpeg. It offers gapless playback with pre-buffering, multichannel audio remapping, and Dolby Atmos decoding, ensuring albums play seamlessly while maintaining high-fidelity sound. Astra features real-time DSP visualizers powered by a native C++ engine, including an oscilloscope, spectrum analyzer, and vectorscope. A fully parametric 10-band EQ with live frequency response, built-in presets, and AutoEQ headphone calibration import lets you precisely shape your sound. Playback controls include shuffle, repeat, and drag-and-drop queue management, while the library automatically extracts metadata, album artwork, and supports global search, favorites, and recently played tracking. Additional features include output device selection, delay calibration, customizable themes, fullscreen and mini-player modes, Discord Rich Presence, optional Last.fm scrobbling, and an opt-in local API for integrations. Astra delivers a complete, high-quality desktop audio experience with no telemetry, accounts, or streaming. Astra 0.6.1 Beta changelog: Lyrics Initial XLRC support via @boof2015/xlrc 0.2.0 (#131) XLRC sidecar scanning, manual import, and renderer support Word timing, furigana, translations, voice labels, and translation-priority controls for XLRC Fullscreen lyrics overhaul with additional layout polish Manual lyrics editor with LRC, XLRC, and plain-text modes Drag-and-drop lyrics import plus sync offset controls Clickable synced lyrics for seeking, with popout and transport lyrics updates (#138) Fixed lyrics info sidebar scrolling (#138) Added a workaround for LRCLIB instability Metadata & Library Metadata editor rebuilt as a side panel Virtual DB metadata overrides and optional direct file tag writing Bulk metadata editing for title, artist, album, album artist, genre, year, track/disc numbers, and artwork Undo/redo support for virtual metadata edits Clear overrides action and default save-mode preference Artist page grid view added, with later design and sizing refinements Improved Jump to Playing with smart source, queue, album, artist, and library track targets Fixed smart source jump behavior Playlists Fixed VLC-style M3U import failures (#127) Added playlist export to M3U/M3U8 (#118) Improved imported playlist path resolution and missing-entry preservation Shuffle added to playlist pages (#121) Remove tracks directly from playlist views (#128) Fixed create-playlist-from-track modal closing when clicking inside it (#137) Multi-select quality-of-life fixes Right-click context menus no longer clear multiselections UI & Navigation Fixed UI scaling regressions in sidebar and home surfaces (#122, #123) Fixed transport bar regression (#126) Fixed horizontal scrolling on Home and Library rails Fixed artist grid sizing while searching Updated playlist action buttons and related layout polish Additional fullscreen lyrics visual adjustments Visualization Scopes and visualizers now respect UI scaling settings (#155) Added shared canvas sizing logic for correct DPR/backing-store behavior Canvas sizing tests added for visualizer scaling regressions Discord RPC Discord Rich Presence activity structure refactored Compact status can prioritize title or artist Profile info line can show file info or album Title and artist links can target YouTube Music, Last.fm, or be disabled Optional small Astra badge for cover-art presence Configurable “clear when paused” timing Added Discord activity tests Scrobbling Fixed custom Last.fm2 API profiles being accidentally blocked Expanded scrobbler profile protocol handling coverage Stability & Tests Added/expanded tests for XLRC parsing, lyrics presentation, metadata editor state, playlist import/export path handling, artist grid layout, horizontal scrolling, canvas sizing, and Discord RPC activity building Download: Astra 0.6.1 Beta | 138.0 MB (Open Source) View: Astra Home Page | Github | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
    • How does it compare to the "SeeStar S30 Pro" and the "Vespera PRO 2"?
    • Indeed. And note that those units are MUCH cheaper than this new Steam Machine...ahem.
  • Recent Achievements

    • Week One Done
      Almohandis earned a badge
      Week One Done
    • Rookie
      dorf went up a rank
      Rookie
    • First Post
      mike_rumble earned a badge
      First Post
    • Dedicated
      tuben earned a badge
      Dedicated
    • Week One Done
      mnsgroup earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      501
    2. 2
      +Edouard
      209
    3. 3
      PsYcHoKiLLa
      100
    4. 4
      Michael Scrip
      85
    5. 5
      neufuse
      69
  • Tell a friend

    Love Neowin? Tell a friend!