[Novalug] need dd help
Paul W. Frields
stickster at gmail.com
Tue Feb 14 17:23:34 EST 2012
On Tue, Feb 14, 2012 at 02:18:48PM -0500, Jon LaBadie wrote:
> On Tue, Feb 14, 2012 at 09:37:02AM -0500, Paul W. Frields wrote:
> > You might want to try a larger logical block size for the dd than 1k.
> > This makes a significant difference. Best is to base it on the
> > characteristics of the drive, but typically you'll get best results
> > around 8k or 16k, without much loss with bigger sizes like 1M. What
> > you want to do is avoid fighting the drive's built in write buffering
> > capabilities.
> What drive characteristic? I think the physical sector size is
> still 512 bytes, no? The 4k or larger block sizes are file system
> characteristics which have little involvement here.
> Maybe cylinder size? Or the disk's ram buffer size?
> I sometimes wonder about dd's input buffer requirement in tasks
> such as this. While the read from /dev/zero is probably very
> fast, in this usage it only needs be done once. The buffer
> could be reused as it is unchanging.
IIRC it has to do with write-caching on the destination drive. It's
been a long time since I looked into this deeply -- probably not since
the 2.2 kernel. When you do a standard dd, the default write buffer
size that dd sends is 512 bytes. If the cache size on the drive is,
say, 32KB, dd will have to do 64 writes to fill up that cache and
cause the disk to flush. That's my recollection at least.
With IDE you used to have to do some tuning with hdparm first, but
nowadays I think that the libata code that bridges to
IDE/SATA/etc. handles all that. Speaking of which, if there are other
layers in between they may change the nature of the problem compared
to the block device for the disk itself -- e.g. zeroing out a logical
volume in an LVM setup.
Paul W. Frields http://paul.frields.org/
gpg fingerprint: 3DA6 A0AC 6D58 FEC4 0233 5906 ACDB C937 BD11 3717
http://redhat.com/ - - - - http://pfrields.fedorapeople.org/
The open source story continues to grow: http://opensource.com
More information about the Novalug