======================================= FreeBSD - Get ZFS Dataset Out Of VDI ======================================= I was migrating Freebsd vms out of Virtualbox and into vnet jails which everyone should do. I had a vm and the data storage disk had grown to about 20TB that had to transferred out. Using zfs send | zfs recv to do the transfer was going to take more than a 19 days. I was able to do it in in 24 hours using qemu which required the vdi disk to be free :0( ------------------------------------ # take a snapshot of the dataset ssh root@192.168.69.70 "zfs snapshot -r tank@stream" # shut down the vm vboxmanage controlvm pistachio acpipowerbutton # create a dataset on the host where zfs create tank/jail/pistachio/disk/tank # install qemu-tools pkg install qemu-tools # create this where you have enough storage zfs create -s -V 20T -o volblocksize=128K -o compression=lz4 -o sync=disabled tank/temp_vdi # start the process qemu-img convert -p -t writeback -m 16 -f vdi -O raw /export/vm/pistachio/pistachio-disk2.vdi /dev/zvol/tank/temp_vdi # scan for zpools and get the pool id zpool import -d /dev/zvol/tank # import zpool import -o readonly=on -N -d /dev/zvol/tank old_tank # find that snapshot you took hours ago zfs list -t snapshot -r old_tank # bring it on home zfs send -R -c old_tank@stream | zfs recv -F -u tank/jail/pistachio/disk/tank # some cleanup zpool export old_tank zfs destroy tank/temp_vdi --------------------------------------- At this point that data migration is complete but you of course should fix up your zfs mountpoints and canmount etc. before mounting. ======================================= done =======================================