Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 23 Sep 2008 22:17:20 +0100
From:      RW <fbsd06@mlists.homeunix.com>
To:        freebsd-questions@freebsd.org
Subject:   Re: blocksize when using dd to copy disks? bigger = better?
Message-ID:  <20080923221720.184885a7@gumby.homeunix.com.>
In-Reply-To: <20080923153700.GA85529@gizmo.acns.msu.edu>
References:  <6e5cf6a70809230804g1d2f0359g566c756ebfe9a038@mail.gmail.com> <20080923153700.GA85529@gizmo.acns.msu.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Tue, 23 Sep 2008 11:37:00 -0400
Jerry McAllister <jerrymc@msu.edu> wrote:

> On Tue, Sep 23, 2008 at 11:04:13AM -0400, Joachim Rosenfeld wrote:
> 
> > When mirroring a disk with dd, I notice that a blocksize of 512 runs
> > awfully slow, but with bs=1MB (2^10bytes), it runs fairly quickly.
> > 
> > Can someone explain the implications of this? Did all the data not
> > copy properly with the larger blocksize?
> 
> If you are on a beach moving sand and you pick up one grain at a
> time and move it, it will take a very long time because the overhead
> of moving yourself is much higher than the amount of sand moved.
> If you use the largest bucket or scoop that you can handle, then
> it goes much faster because the same body motions result in much
> more being moved.    Moving data has a similar dynamic.

I tried playing around with this once, and I found that the speed rose
rapidly up to a certain blocksize, then levelled-out for a decade or so
and then dropped to half of the peak speed. IIRC in that particular case
the optimum range was something like 20k-200k.

I presume what happens is that you can make the blocksize too big for
the other buffering, and end-up alternating reads and writes rather
than doing them in parallel.



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20080923221720.184885a7>