[linux-lvm] Migrating LVM

malahal at us.ibm.com malahal at us.ibm.com
Wed Apr 21 15:36:00 UTC 2010


Ray Morris [support at bettercgi.com] wrote:
>     pvmove is good for when you have to keep the machine
> live during the copy.  dd is about 10 times as fast if you
> can be down during the copy.  This specific dd invocation
> is the fastest I've found for the purpose, running 2-3 times
> faster than a simple dd without arguments:
> 
> dd if=/dev/old_vg/$1 bs=64M iflag=direct | dd of=/dev/new_vg/$1 bs=64M  
> oflag=direct

Interesting! You are doing direct I/O to avoid copying from cache to user
buffer for read and vice-versa for write, but you are losing the ability
to do them parallel! You are doing the next best, that is creating two
"dd" threads -- one for reading and another for writing. Since the pipe
is really implemented in memory, why should this be faster than normal
"dd" that uses page cache? Likely that kswapd is not kicking early
enough?

Enhancing "dd" to create a reader and a writer thread would really
help, I believe.

Thanks, Malahal.




More information about the linux-lvm mailing list