I believe this hasn't been correctly answered (yet) because the OP appears to be indicating two different volume groups, a source and a destination. So I'll try to answer it.
Note: This response assumes that a reference like /dev/mapper/vg_thin02
indicates a volume group in accordance with the usual Linux convention, and that any pool or thin volume in that group would be followed by a dash like so: /dev/mapper/vg_thin02-volA
.
When cloning between two volume groups (or two thin pools) on the same machine, for each source volume do:
fstrim /mnt/volA
umount /mnt/volA
lvcreate -kn -ay -V sizeofvolA -T vg_thin02/poolname -n volA
dd if=/dev/mapper/vg_thin01-volA of=/dev/mapper/vg_thin02-volA conv=sparse
Continue with "volB", "volC", etc. as necessary. The conv=sparse
argument stores the new copy in a sparse, thin-provisioned way.
The fstrim
and umount
lines show that some form of trim/discard is necessary on the source volume before it is taken offline and duplicated. If the volume is normally mounted with the discard
option this may not be necessary.
For cloning between two different machines, you can use ssh
on the source machine in conjunction with dd
on the destination:
gzip -2 </dev/mapper/vg_thin01-volA | ssh user@address "zcat | sudo dd of=/dev/mapper/vg_thin02-volA conv=sparse"