Find the answer to your Linux question:
Results 1 to 7 of 7
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    Problem wiping a drive with shred command

    I'm trying to wipe an entire 20GB drive with the shred command using Knoppix. Specifically this is the command I'm entering
    shred -n 2 -f -v /dev/hda
    To my understand from reading the man pages, this writes random data to the drive(/dev/hda) twice, forces permissions, and shows progress.

    I see progress up to about 96% for the 1st pass, then I get 2 lines of error at the end of the drive. Something like "error writing to offset x, input/output error", where x is the end of the drive.

    The 2nd pass never runs due to this error, the the program terminates back to the shell.

    Does anyone know what's wrong?


  2. #2
    Just Joined! FoolishGhoul's Avatar
    Join Date
    May 2008
    you need to unmount the drive first.

    code you will need:

    sudo umount /dev/hda
    shred -n 2 -vf /dev/hda
    might not need to sudo if you're already in superuser mode...

  3. #3
    SuperMod (Back again) devils casper's Avatar
    Join Date
    Jun 2006
    Chandigarh, India
    I would suggest you to write zeros in whole harddisk through dd command instead of using shred.
    dd if=/dev/zero of=/dev/hda

    Use DBAN.
    It is amazing what you can accomplish if you do not care who gets the credit.
    New Users: Read This First

  4. $spacer_open
  5. #4
    Just Joined! FoolishGhoul's Avatar
    Join Date
    May 2008
    yeah, i'd forgotten about that, Darik's Boot and Nuke (DBAN) is an excellent tool for wiping hard-drives of computers, have used it on many i've sold/given away/scrapped...

  6. #5
    I do know about DBAN. In fact it was the first thing I've tried. However, most of DBAN's algorithms do a final zeroization pass, which I don't want. I want the contents of the HDD to be randomized instead. Hence I'm using shred w/o the -z option, and hence I'm not using dd.

    Of course, if there is an easy way to disable the final zeroization pass then I'm open to using DBAN.

    I will try umount on the drive with shred in the meantime.

  7. #6
    Hmm, the drive doesn't seem to be mounted at all, so umount did nothing. Any other ideas? Could the drive have bad sectors or something? DBAN did complete the wipe though.

  8. #7
    Join Date
    May 2004
    arch linux
    Hi, galapogos!

    If you still need help with this please create a new thread. I'm locking this one because it has attracted 8 different spam messages already.

    Sorry for any inconvenience.

Posting Permissions

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