Re: bash script: move large LV to another machine

Ed Heron <[email protected]> Fri, 16 Sep 2011 11:43:13 -0600
Newsgroups gmane.org.user-groups.nmlug
Message-ID <[email protected]>
On Fri, 2011-09-16 at 10:26 -0600, Ed Heron wrote:
> ... 
> > You could use the "notrunc" argument to avoid this.  You might also try  
> > the "fdatasync" argument.
> 
>   I'll take a look at those.

  I added conv=notrunc,fdatasync to my write dd without change.  I
removed the 2>/dev/null from it as well so I could see what results it
might be reporting.

0+1 records in
0+1 records out
32768 bytes (33 kB) copied, 0.00047 seconds, 69.7 MB/s

  I have little idea why it is not writing the entire 32M block.

  I tried, on the source, putting the first block that is different in a
local file, copying that file to the destination server, then trying to
use dd to write it in the correct place.  It seems to go well.

[root@src ~]# dd if=/dev/vg/lv of=vg.lv.1037 bs=32M skip=1037 count=1
1+0 records in
1+0 records out
33554432 bytes (34 MB) copied, 0.371395 seconds, 90.3 MB/s
[root@src ~]# scp vg.lv.1037 dst:.
vsrv2b.tmp.1037                    100%   32MB  32.0MB/s   00:01

[root@dst ~] # dd conv=notrunc,fdatasync if=vg.lv.1037 of=/dev/vg/lv \
bs=32M seek=1037 count=1
1+0 records in
1+0 records out
33554432 bytes (34 MB) copied, 0.498312 seconds, 67.3 MB/s

now that block matches.  but my script doesn't work.  weird.  I'm going
to change my script to create a temp file, copy the file and dd the
piece.  I wonder if dd puts any info into the data stream that is
messing with the destination dd.


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