Re: bash script: move large LV to another machine

Ed Heron <[email protected]> Fri, 16 Sep 2011 13:28:14 -0600
Newsgroups gmane.org.user-groups.nmlug
Message-ID <[email protected]>
On Fri, 2011-09-16 at 12:29 -0600, Geoff Chesshire wrote:
> Hi Ed,
> 
> > I have little idea why it is not writing the entire 32M block.
> 
> I wonder if the problem is in the way the socket is breaking up the 32M  
> write into packets for the internet.  Perhaps if you set ibs=32M on the  
> read side and obs=32M on the write side (don't set bs=32M), then the  
> default 512 byte blocks would not need to be broken up.  You could try  
> different sizes, e.g. obs=1K on the read side and ibs=1K on the write  
> side.  I bet this will fix it.
> 
> Geoff

  Interesting thought.  I don't want to do checksums in 512 byte pieces,
but I could just change the copy section to:

    let lcl_blk=src_blk*65536
    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"

  It appears to work!  Yay!

  So, should I expand it to make it more generically usable?  Something
like dev-sync [<src_addr>:]<src_dev> [<dst_addr>:]<dst_dev>


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