Re: bash script: move large LV to another machine

Ed Heron <[email protected]> Fri, 16 Sep 2011 14:37:05 -0600
Newsgroups gmane.org.user-groups.nmlug
Message-ID <[email protected]>
On Fri, 2011-09-16 at 14:09 -0600, Ed Heron wrote:
> On Fri, 2011-09-16 at 13:53 -0600, Geoff Chesshire wrote:
> > On Fri, 16 Sep 2011 13:28:14 -0600, Ed Heron <Ed-MBvgLuVkLo/[email protected]> wrote:
> > 
> > > dd if=$src_dev ibs=512 skip=$lcl_blk count=65536 | ssh $dst_addr "dd  
> > > conv=notrunc,fdatasync of=$dst_dev obs=512 seek=$lcl_blk count=65536"
> > 
> > Note that the "count=65536" on the receiving side assumes ibs=512, but you  
> > don't strictly need to specify this count.  You could as well use
> > 
> > dd if=$src_dev ibs=32M obs=1K skip=$src_blk count=1 | ssh $dst_addr "dd  
> > conv=notrunc,fdatasync of=$dst_dev ibs=1K obs=32M seek=$src_blk"
> > 
> > That way, dd can still read the source device and write the destination  
> > device in 32Mb chunks.  Smaller chunks may be better, though, in order to  
> > overlap i/o and communication; it's just a matter of optimization.
> > 
> > Geoff
> 
>   I guess the gymnastics to change block sizes for the transfer aren't
> significant and retain script context.  I'll try it.
> 
>   If this were the only thing running on the machines, it wouldn't make
> much difference.  As a working virtualization host, I'm not sure which
> would be nicer to the VMs; 1 big read or lots of little reads.

  Unfortunately, it didn't work.  The source read 1 record and sent
32768 records.  The destination read 32767+2 records and wrote 1+0
record.  A subsequent checksum test said the pieces didn't match.

1+0 records in
32768+0 records out
33554432 bytes (34 MB) copied, 2.30826 seconds, 14.5 MB/s
32767+2 records in
1+0 records out
33554432 bytes (34 MB) copied, 2.52882 seconds, 13.3 MB/s

  Since it just keeps testing and sending the same piece, I notice the
receiver reports records in all over the place.  ifconfig on both sides
say there aren't any errors, but this is starting to look like data
corruption to me.


_______________________________________________
NMLUG mailing list
[email protected]
http://lists.b9.com/cgi-bin/mailman/listinfo/nmlug