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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
08-15-2012, 04:07 AM
|
#1
|
LQ Newbie
Registered: Jun 2012
Location: India
Distribution: Ubuntu
Posts: 12
Rep:
|
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.
|
|
|
08-15-2012, 04:41 AM
|
#2
|
Senior Member
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238
Rep:
|
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.
|
08-15-2012, 05:21 AM
|
#3
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
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.
|
08-15-2012, 05:39 AM
|
#4
|
Senior Member
Registered: May 2010
Distribution: No more Linux. Done with it.
Posts: 1,238
Rep:
|
|
|
1 members found this post helpful.
|
08-15-2012, 05:56 AM
|
#5
|
Moderator
Registered: Dec 2009
Location: Germany
Distribution: Whatever fits the task best
Posts: 17,148
|
Quote:
Originally Posted by Mr. Alex
|
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.
|
08-15-2012, 06:09 AM
|
#6
|
LQ Newbie
Registered: Jun 2012
Location: India
Distribution: Ubuntu
Posts: 12
Original Poster
Rep:
|
Thanks
Thanks next time I will try out these options.
|
|
|
All times are GMT -5. The time now is 08:02 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|