LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 03-12-2006, 11:25 PM   #1
Xentrix
LQ Newbie
 
Registered: Mar 2004
Location: Christchurch, New Zealand
Distribution: Kubuntu 7.04
Posts: 9

Rep: Reputation: 0
command for erasing hard drive


I've done some searches for a command that used to be on here but can no longer find it (I even had it book marked)

It gave a consule command to set all sectors to 0 on a slave drive or partition and explained which letters to change to acheive it.

If anyone has it or knows it, I would love to get it again (i'll write it down in a text book cover this time)

Cheers
Phil
 
Old 03-13-2006, 12:51 AM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,290

Rep: Reputation: 378Reputation: 378Reputation: 378Reputation: 378
dd if=/dev/zero of=<hard drive or partition to 0 fill)

Make sure you set of correctly, or you will likely wipe out something important. Note that residual data can be recovered even from a zero filled sector on a hard drive, but it requires special tools. If you require absolute security, wipe with a program that writes over the drive repeatedly with random data.
 
Old 03-13-2006, 01:07 AM   #3
J.W.
LQ Veteran
 
Registered: Mar 2003
Location: Boise, ID
Distribution: Mint
Posts: 6,642

Rep: Reputation: 87
There are a variety of utilities for this purpose, One is:

http://dban.sourceforge.net/
 
Old 03-13-2006, 02:09 AM   #4
Xentrix
LQ Newbie
 
Registered: Mar 2004
Location: Christchurch, New Zealand
Distribution: Kubuntu 7.04
Posts: 9

Original Poster
Rep: Reputation: 0
Though I better check before typing it

My hdd's are listed as hda and hdb (using Xandros 2) i'll assume (the mother of all disasters) that this is a fairly global label for hdd's. So if I add hdb to the end of the command, that will zap the one I want. Or have I missed the bus?


dd if=/dev/zero of=hdb

PS Have download dban as well, would rather have a go with a command 1st though. Cheers.
 
Old 03-13-2006, 06:32 AM   #5
barrett9h
LQ Newbie
 
Registered: Jun 2004
Location: Rio / Brazil
Distribution: Slackware
Posts: 11

Rep: Reputation: 0
you forgot the full path of the device:
dd if=/dev/zero of=/dev/hdb
 
Old 03-13-2006, 06:48 AM   #6
kevkim55
Member
 
Registered: Dec 2005
Location: Edmonton
Distribution: BLFS, Gentoo
Posts: 353

Rep: Reputation: 32
What is that you want to do exactly ? Delete the contents of the whole drive or just a partition ?
If it is the whole drive, follow the instruction by btmiller or barrett9h.

If it is just a partition then be careful. For eg. if you have 5 partitions on a drive say hada1, hda2, hda3, hda4, hda5 & hda6 (hda4 being the extended partition) and if you want to zero out hda5 then, using dd if=/dev/zero of=/dev/hda5 would zero out the contents of the partition hda5 including the partition table which would point at partition hda6. Which means, you'd lose the partition hda6 as you zeroed out the partition table which pointed at hda6.

To make sure you skip the partition table do the following:
dd if=/dev/zero of=/dev/hda6 bs=512 skip=1

Of course, you'll have to know the drive name and partition number be it hda3, hdb3 or sda3 or whatever. The above explanation assumes hda as the drive name.

If you need further clarifications, provide the details of your hard drives and partitions layout and also, which of the partitions you wanna zero out.

Last edited by kevkim55; 03-13-2006 at 06:51 AM.
 
Old 03-13-2006, 07:34 AM   #7
zidane_tribal
Member
 
Registered: Apr 2005
Location: chained to my console.
Distribution: LFS 6.1
Posts: 143

Rep: Reputation: 18
Quote:
Originally Posted by Xentrix
My hdd's are listed as hda and hdb (using Xandros 2) i'll assume (the mother of all disasters) that this is a fairly global label for hdd's. So if I add hdb to the end of the command, that will zap the one I want. Or have I missed the bus?


dd if=/dev/zero of=hdb

PS Have download dban as well, would rather have a go with a command 1st though. Cheers.
in general, the rule of thumb (the father of all disasters ) is that hd* is labelled after the onboard ide chain.

ide0 master = hda
ide0 slave = hdb
ide1 master = hdc
ide1 slave = hdd

do, however, always doublecheck, if you blank the worng drive, its remarkably upsetting. oh, and if you have bizarre hardware configurations, this will go right out the window.
 
Old 03-13-2006, 09:55 AM   #8
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Quote:
Originally Posted by zidane_tribal
You dont need a reason to help people.
That is maybe the best sig I have seen in a long time.....

From the galloping nitpicker: There is a difference between erasing and wiping. Writing all zeros is not considered 100% secure. Utilities like dban do multiple writes to ensure no residual data can be found.

And of course, just deleting file and partitions still leaves the data on the disk where it can easily be recovered.
 
Old 03-13-2006, 08:14 PM   #9
Xentrix
LQ Newbie
 
Registered: Mar 2004
Location: Christchurch, New Zealand
Distribution: Kubuntu 7.04
Posts: 9

Original Poster
Rep: Reputation: 0
Just want to delete a slave drive. It has a botched duel boot install on it that isn't worth trying to retrieve. It's not national securtity by any means. Just want it blankish with peice of mind to play with another distro.

I've written (the old way, with a pen)down the commands and other info for keeps.

Cheers and thankyou all that replied.
Happy camper.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Secure erasing files from hard drive zio2003 Linux - Newbie 4 01-31-2006 10:26 PM
Command to check hard drive satimis Linux - General 4 06-25-2004 02:42 AM
Erasing Hard Drive with dd taking waaayyyy too long mtrisk Linux - Hardware 3 06-23-2004 01:20 AM
Need help burning/erasing DVDs from command line enygma Linux - Software 2 03-17-2003 12:24 PM
command for hard drive space in megs Goatdemon Linux - General 6 11-05-2002 05:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 01:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration