LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Security
User Name
Password
Linux - Security This forum is for all security related questions.
Questions, tips, system compromises, firewalls, etc. are all included here.

Notices


Reply
  Search this Thread
Old 04-21-2010, 05:47 AM   #1
fishjohn
LQ Newbie
 
Registered: Feb 2010
Posts: 29

Rep: Reputation: 15
fast way to completley erase 1TB drive?


I have 1TB drive, I need to completley erase/overwrite all data.
What would be the quickest way under linux?

thanks.
 
Old 04-21-2010, 05:50 AM   #2
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
dd if=/dev/zero of=/dev/sdx count=1025000 bs=1025000

Substitute the correct device for /dev/sdx

jlinkels
 
1 members found this post helpful.
Old 04-21-2010, 07:41 AM   #3
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Quote:
Originally Posted by jlinkels View Post
Substitute the correct device for /dev/sdx
That would be a very, very good idea

BTW, AFAIK there's no need for the count=<whatever>. Without it, dd will keep going until it gets to the end -- which avoids the danger of not calculating it correctly.
 
Old 04-21-2010, 07:47 AM   #4
cola
Senior Member
 
Registered: Sep 2007
Posts: 1,045

Rep: Reputation: 65
What will be the default count and block size if one does:
Code:
dd if=/dev/zero of=/dev/sdx
 
Old 04-21-2010, 08:03 AM   #5
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
bs=512
count is indefinite

jlinkels
 
1 members found this post helpful.
Old 04-21-2010, 08:05 AM   #6
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
I think dd usually defaults to a block size of 512 (easy to check)

As already stated, the default count is "forever"--ie it keeps going until there's nothing left to do.
 
Old 04-21-2010, 08:08 AM   #7
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 fishjohn View Post
I have 1TB drive, I need to completley erase/overwrite all data.
What would be the quickest way under linux?

thanks.
With dd, you can find the "quickest" way by experimenting with the block size but---regardless--- wiping a 1TB drive is going to take a while.

Do a timed test with a low value of count, and you can extrapolate to know just how long. (I'm guessing dinner + a good night's sleep)
 
Old 04-21-2010, 08:40 AM   #8
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Not at all. If this is a reasonable modern system, the speed should be limited by the transfer rate of the disk. The specified transfer rate of a 1 TB disk is about 3 GB/s. Let's be pessimistic and assume 1 GB/s. Then it would be done in 20 minutes or so.

jlinkels
 
Old 04-21-2010, 12:13 PM   #9
pixellany
LQ Veteran
 
Registered: Nov 2005
Location: Annapolis, MD
Distribution: Mint
Posts: 17,809

Rep: Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743Reputation: 743
Code:
[root@mystical mherring]# dd if=/dev/sda of=/dev/null bs=1024000 count=100
100+0 records in
100+0 records out
102400000 bytes (102 MB) copied, 1.73307 s, 59.1 MB/s
1TB = ~10E12 Bytes @ 59E6 Bytes/sec = ~ 4 hours
 
Old 04-21-2010, 12:45 PM   #10
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
I'd run something like:

Code:
dd if=/dev/zero of=/dev/sda bs=4M
You can try different 'bs' options, because performance can vary based upon the value. I don't specify a 'count' if you want to wipe every last bit.
 
1 members found this post helpful.
Old 04-21-2010, 08:52 PM   #11
jlinkels
LQ Guru
 
Registered: Oct 2003
Location: Bonaire, Leeuwarden
Distribution: Debian /Jessie/Stretch/Sid, Linux Mint DE
Posts: 5,195

Rep: Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043Reputation: 1043
Same here:

Code:
jlinkels-lt:/tmp# dd if=/dev/sda of=/dev/null bs=4M count=256
256+0 records in
256+0 records out
1073741824 bytes (1.1 GB) copied, 20.3907 s, 52.7 MB/s
jlinkels-lt:/tmp#
Didn't know it was that bad.

jlinkels
 
Old 04-22-2010, 01:43 AM   #12
catkin
LQ 5k Club
 
Registered: Dec 2008
Location: Tamil Nadu, India
Distribution: Debian
Posts: 8,578
Blog Entries: 31

Rep: Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208Reputation: 1208
Returning to the original question and given the demonstrations of how slow dd is, I wonder if there is some OEM-specific way of telling the HDD firmware to do the job, perhaps a destructive low level format?
 
Old 04-22-2010, 02:16 AM   #13
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
I always smile when the 'how to clear a drive' question comes up. The various recipes for DD, the hours of work, DBAN and our local council even link to this: http://www.killdisk.com/downloadfree.htm when telling people how to clear old hard discs. All this is fine and dandy but....

http://cmrr.ucsd.edu/people/Hughes/SecureErase.shtml
...probably the quickest way to do it is with Gordon Hughes 'Secure Erase' which is built in to most post 2001 HDD drives. It takes about 2 1/2 hours to per 500gb - fraction of the time of other methods.

To run it requires a bootable floppy/cd/usb as it's a dos.exe file that talks to the ATA controller on the motherboard and sends the drive the correct ATA commands to securely erase it.

As drives get bigger the time taken to use other tools rises exponentially so I hope that helps someone out.

On a side note I was recently read that wiping drives with patterns more than 1 time is really a waste of time. A single wipe of any pattern will render any data beyond recovery for your average Joe. Even a forensics lab using an atomic force microscope to view the platters would take three months to recover a 36k jpeg file that has been single wiped with any pattern.
 
Old 04-22-2010, 02:25 AM   #14
spampig
Member
 
Registered: Feb 2010
Location: /Earth/UK/England/Hampshire
Distribution: Debian, Ubuntu, CentOS, Slackware
Posts: 262
Blog Entries: 2

Rep: Reputation: 56
Adding to that, Scott gives some great 'talks' on drives. Normally I'm not a fan of Youtube videos but this series is rather good. It's well shot, to the point and without the usually waffle:

http://www.youtube.com/user/SuperFly.../0/fst8IZup44c
 
Old 04-22-2010, 09:15 AM   #15
H_TeXMeX_H
LQ Guru
 
Registered: Oct 2005
Location: $RANDOM
Distribution: slackware64
Posts: 12,928
Blog Entries: 2

Rep: Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301Reputation: 1301
Quote:
Originally Posted by spampig View Post
On a side note I was recently read that wiping drives with patterns more than 1 time is really a waste of time. A single wipe of any pattern will render any data beyond recovery for your average Joe. Even a forensics lab using an atomic force microscope to view the platters would take three months to recover a 36k jpeg file that has been single wiped with any pattern.
I didn't know they could recover it at all. Any links ? Cuz I would like to see some undeniable proof for this urban myth, that if you wipe once with zeros, the gubmint using uber technology, can still reliably recover something.
 
  


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 Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Best 1TB external hard drive? tommytea Linux - Newbie 2 07-05-2009 02:32 PM
adding another 1TB drive to raid5 array. javaholic Linux - Server 5 08-26-2008 10:59 AM
Ext3 Filesystem overhead on a 1TB drive Lommer Linux - Newbie 7 03-20-2008 08:55 AM
Problems with WD My Book 1TB external drive BWebb Linux - Hardware 2 03-20-2008 01:34 AM
Mac User Completley: Completley New to Linux! HELP! nelio87 Linux - Newbie 2 06-22-2002 09:46 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Security

All times are GMT -5. The time now is 06:42 PM.

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