[SOLVED] Can I copy data from zfs snapshot directly ?

chengkinhung

Renowned Member
Feb 11, 2016
57
10
73
25
Hi, everybody,

I am tring to migrate one VM from ZFS disk to LVM disk, I can dd clone the full ZFS disk, but this VM is running, so I like to create a snapshot for this ZFS disk first, but I can not find the way to access the device path of this snapshot. Could you please tell us how to copy data from ZFS snapshot or where I can find the snapshot device ? I am using ProxMox 7.4-16 , thanks very much.
 
I find the way to do:
Code:
# zfs snapshot pool/vm-100-disk-0@mysns
# zfs set snapdev=visible pool/vm-100-disk-0
after that, the devices of this snapshot will show under /dev/zvol/pool/
Code:
# /dev/zvol/pool/vm-100-disk-0@mysns -> ../../zd0
# /dev/zvol/pool/vm-100-disk-0@mysns-part1 -> ../../zd0p1
when completed:
Code:
# zfs set snapdev=hidden pool/vm-100-disk-0
# zfs destroy pool/vm-100-disk-0@mysns
 
Last edited:
because I will still need the snapshot to run rsync later, even when I restored VM from backup, I need to keep the same data till I can run latest rsync. The data is over 2TB, it is not easy.