LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-15-2012, 04:07 AM   #1
ashishyadav26
LQ Newbie
 
Registered: Jun 2012
Location: India
Distribution: Ubuntu
Posts: 12

Rep: Reputation: Disabled
linux utility to zero out hard disk


Hi, I use dd to zero out hard disk.
dd if=/dev/zero of=/dev/sdb2

is there a utility which dose the same but is faster, dd is terribily slow.
 
Old 08-15-2012, 04:41 AM   #2
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
Code:
dd if=/dev/zero of=/dev/sdb2 bs=1M
will be somewhat faster.

Also use forum tags for code and quotes.
 
2 members found this post helpful.
Old 08-15-2012, 05:21 AM   #3
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
As Mr.Alex stated, play with the blocksize option (bs) the standard value for that option is 512, which means that 512 Bytes are copied at a time (which is/was for a long time the standard sector size of harddisks). You can get much better performance with larger values. Which blocksize is optimal for you depends on your hardware, I got good results with blocksizes between 8 and 32 MB, Mr.Alex seems to prefer a blocksize of 1MB. Just try some values here and see which one gives you the best performance.
 
1 members found this post helpful.
Old 08-15-2012, 05:39 AM   #4
Mr. Alex
Senior Member
 
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238

Rep: Reputation: Disabled
One more thing worth to be looked at: http://dave.frop.net/disk_overwrite_...vs_dd_vs_shred .
 
1 members found this post helpful.
Old 08-15-2012, 05:56 AM   #5
TobiSGD
Moderator
 
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
Blog Entries: 2

Rep: Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886Reputation: 4886
Quote:
Originally Posted by Mr. Alex View Post
One more thing worth to be looked at: http://dave.frop.net/disk_overwrite_...vs_dd_vs_shred .
Just keep in mind that in this comparison the disk is not zeroed out, but overwritten with (pseudo) random-numbers from /dev/urandom. /dev/zero is much faster than /dev/urandom:
Code:
tobi@demon ~ :) % dd if=/dev/zero of=/dev/null bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 0.124797 s, 8.4 GB/s
tobi@demon ~ :) % dd if=/dev/urandom of=/dev/null bs=1M count=1000
1000+0 records in
1000+0 records out
1048576000 bytes (1.0 GB) copied, 63.3325 s, 16.6 MB/s
This may have an impact of the best blocksize for that task.
 
1 members found this post helpful.
Old 08-15-2012, 06:09 AM   #6
ashishyadav26
LQ Newbie
 
Registered: Jun 2012
Location: India
Distribution: Ubuntu
Posts: 12

Original Poster
Rep: Reputation: Disabled
Thanks

Thanks next time I will try out these options.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Hard drive present at Disk Utility but doesn't show up at Gparted -after secure erase Nicle Linux - Hardware 7 10-22-2011 07:11 AM
mounting linux files from another hard disk(IDE) to current hard disk(sata) the lord protector Linux - Hardware 5 05-04-2008 11:30 AM
SATA Hard disk(Windows) MBR corrupted by IDE hard disk(Linux) Peter_APIIT Fedora 6 07-07-2007 12:20 AM
60GB laptop hard disk & 200GB external USB hard disk linux compatibility powah Linux - Hardware 0 03-07-2006 10:55 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:02 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