O'Sullivan, Damian wrote:
> Hi,
>> I am doing a lot of disk cloning/erasing with dd. I was wondering how I
> would find out the best value for bs so that it will run as fast as
> possible. I understand there are probably a few factors such as
> RAM,disks etc.
Visualise the buffers, and try to figure out how to keep them filled.
In summary just set bs=cache size of disk.
2MB is a good Greatest Common Divisor bs.
8MB is usual on current disks.
>> Eg :
>> No compression :
> dd if=/dev/hda of=/someotherdisk/image.bin bs=????
HD1 buffer (8MB) ----- dd buffer (=bs) -------- HD2 buffer (8MB)
There is only one thread of execution here so
reads/writes will be serialized within dd.
As long as you don't specify conv=sync then the write to the
disk platters should be parallelized with the read from the disk platters.
I.E. the write() within dd will return after the data hits
the disk cache (or the kernel disk scheduler).
>> Compression
>> dd if=/dev/hda bs=???? | gzip | of=/someotherdisk/image.bin bs=????
There are 3 threads of execution here with the following buffers:
HD1 buffer (8MB)
dd buffer (=bs)
pipe buffer (4KiB)
gzip buffer (32KiB)
dd buffer (=bs)
HD2 buffer (8MB)
So as long as bs >= 32KiB you're fine.
> Also if doing over a network it would be slower how do I factor that in?
>> dd if=/dev/cciss/c0d0 of=/tmp/SomeNfsMountedPlace/image.bin bs=????
I'm not sure of the buffers/processing involved here.
I will though point out an old related thread:
http://www.linux.ie/lists/pipermail/ilug/2001-April/031344.html
> Disk wiping :
>> dd if=/dev/zero of=/dev/hda bs=???
again just try to match the cache size of your disk here.
Pádraig.
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!