Find the answer to your Linux question:
Results 1 to 7 of 7
Hi, I'm trying to wipe an entire 20GB drive with the shred command using Knoppix. Specifically this is the command I'm entering Code: shred -n 2 -f -v /dev/hda To ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    128

    Problem wiping a drive with shred command


    Hi,
    I'm trying to wipe an entire 20GB drive with the shred command using Knoppix. Specifically this is the command I'm entering
    Code:
    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?

    TIA.

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

    code you will need:

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

  3. #3
    Super Moderator devils casper's Avatar
    Join Date
    Jun 2006
    Location
    Chandigarh, India
    Posts
    24,729
    I would suggest you to write zeros in whole harddisk through dd command instead of using shred.
    Code:
    dd if=/dev/zero of=/dev/hda
    Or

    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
    $spacer_close
  5. #4
    Just Joined! FoolishGhoul's Avatar
    Join Date
    May 2008
    Location
    Cumbria
    Posts
    2
    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
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    128
    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
    Linux Newbie
    Join Date
    Apr 2008
    Posts
    128
    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
    oz
    oz is offline
    forum.guy
    Join Date
    May 2004
    Location
    arch linux
    Posts
    18,733
    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.
    oz

Posting Permissions

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