Results 1 to 6 of 6

Thread: [SOLVED] How do I wipe a Hard drive (fill with zeros)

  1. #1
    Join Date
    Oct 2007
    Beans
    62

    Question [SOLVED] How do I wipe a Hard drive (fill with zeros)

    Hello, I need to completely wipe a 320GB IDE HDD by filling it with zero's. Does anyone know a way to do this that won't take all year?

    Note: I don't want to wipe it by filling it with random data as further down the line I will be taking a full image of the drive which will then be compressed. The free space will compress a lot better if it is all 0 than if it is random data.

    Thanks!

  2. #2
    Join Date
    Feb 2007
    Beans
    4,045
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How do I wipe a Hard drive (fill with zeros)

    Code:
    sudo dd if=/dev/zero of=/dev/sdX
    With /dev/sdX being the drive you want to fill with zeros. Make sure you choose the correct one

  3. #3
    Join Date
    Oct 2005
    Location
    UK
    Beans
    322
    Distro
    Ubuntu Karmic Koala (testing)

    Re: How do I wipe a Hard drive (fill with zeros)

    Have a look at the first post in this thread. I think that is what you are after.

    WARNING This will completely wipe all data from the drive in question. Make sure you have the right drive information before proceeding with this command.

  4. #4
    Join Date
    Oct 2007
    Location
    Colorado
    Beans
    190
    Distro
    Ubuntu 7.04 Feisty Fawn

    Re: [SOLVED] How do I wipe a Hard drive (fill with zeros)

    Quote Originally Posted by deltaromeo View Post
    Hello, I need to completely wipe a 320GB IDE HDD by filling it with zero's. Does anyone know a way to do this that won't take all year?

    Note: I don't want to wipe it by filling it with random data as further down the line I will be taking a full image of the drive which will then be compressed. The free space will compress a lot better if it is all 0 than if it is random data.

    Thanks!
    sudo shred -n1 -z </drive>

    will overwrite the drive with random data then finish with a write of zeros. K
    Last edited by Girya; October 15th, 2008 at 02:10 PM. Reason: forgot to add the number one to the command

  5. #5
    Join Date
    Dec 2007
    Location
    Idaho
    Beans
    4,976
    Distro
    Ubuntu 20.04 Focal Fossa

    Re: [SOLVED] How do I wipe a Hard drive (fill with zeros)

    If you don't want to wait a year for dd to do it's thing you might want to change the command to something like this
    Code:
    dd if=/dev/zero of=/dev/sdXX bs=10M conv=notrunc
    #or
    dd if=/dev/random of=/dev/sdXX bs=10M conv=notrunc
    "You can't expect to hold supreme executive power just because some watery tart lobbed a sword at you"

    "Don't let your mind wander -- it's too little to be let out alone."

  6. #6
    Join Date
    Aug 2007
    Beans
    67

    Post Re: [SOLVED] How do I wipe a Hard drive (fill with zeros)

    Take the solution of an expert at http://www.feyrer.de/g4u/#shrinkimg (he is the author of g4u)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •