LXC: Move volume why using rsync

janos

Well-Known Member
Aug 24, 2017
174
16
58
Hungary
www.awh.hu
Hello,

If i move volume a LXC volume, it basically create a new volume, format it and copy data with rsync.

Why not copy the disk image itself, why need rsync?

For example, if i want to move volume from rbd to local raw file, i can also do it with rbd export, and if i modify CT conf file, it working fine.

The reason why im asking, because based on my experience, when there is a lot of small files in container (or in general), rsync much slower than DD or any disk image copy method. Yeah i know, DD, or rbd export copy empty blokks also, but if the volume trimmed before it, possible to skip this.
 
Why not copy the disk image itself, why need rsync?

Simple: rsync works with every possible backend storage and is therefore used. Of course can you always do faster, more refined methods, but they bloat the code and make it very hard to debug and to test. There is also no other method of moving a ZFS dataset to a file directly, the filesystem is missing.
 
Im not using ZFS, what is this ZFS dataset? Is this not a block storage device? (somehow have to access raw device kernel also)

In ZFS there are - as in LVM - volumes, they come in a file-fashion and are called dataset and they come in a block-fashion called zvol.