How to wipe a hard drive in ubuntu

Written by chris hoffman Google
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to wipe a hard drive in ubuntu
A computer's hard drive contains all of its files and data. (hard drive interior image by Curtis Sorrentino from

Ubuntu Linux is an open-source operating system that can be downloaded for free. Operating systems don't wipe deleted files immediately; portions of deleted files remain on a computer's hard drive until the operating system overwrites them. Ensure your data remains private by wiping your computer's hard drives when selling, donating or otherwise disposing of them. Wipe hard drives using the "dd" command in Ubuntu and other Linux distributions. Write zeros to the hard drive with the "dd" command, replacing all data on the hard drive with zeros.

Skill level:


  1. 1

    Insert a Ubuntu CD into your computer's disc drive and restart your computer by clicking the "Shut Down" icon at the upper-right corner of your Ubuntu desktop and clicking 'Restart" if you want to wipe your system drive. Ubuntu can't properly wipe the hard drive it's running on; wiping the hard drive Ubuntu is installed on requires booting into a live CD environment.

  2. 2

    Open a Terminal by clicking "Applications," "Accessories" and "Terminal."

  3. 3

    List attached hard drives by typing "sudo fdisk -l" into the "Terminal" window and pressing "Enter."

  4. 4

    Authenticate yourself by typing your password and pressing "Enter" when prompted.

  5. 5

    Look for the hard drive's device name in the output of the "fdisk -l" command in the "Terminal" window. If you have one hard drive, there will be one block of information starting with "Disk /dev/sda," if you have two, there will be a second block starting with "Disk /dev/sdb" and so on.

  6. 6

    Wipe a hard drive by typing "sudo dd if=/dev/zero of=device bs=1M" into the "Terminal" window, replacing "device" with the device name of the hard drive and pressing "Enter." For example, wipe the first hard drive by typing "sudo dd if=/dev/zero of=/dev/sda bs=1M" into the "Terminal" window and pressing "Enter."

Tips and warnings

  • Be careful when typing the device name of the hard drive. Wiping a hard drive erases all data on the drive, you cannot recover it.

Don't Miss


  • All types
  • Articles
  • Slideshows
  • Videos
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the site, you consent to the use of cookies. For more information, please see our Cookie policy.