Simple instructions to copy a vm disk in a zfs pool

rdfamily

New Member
Apr 18, 2025
10
1
3
Hi, I have looked at a lot of posts and can't fin a simple command that I can use to copy a vm disk in a zfs pool
the disk is VMPool/vm-121-disk-0 and I want to make a copy of it as VMPool/vm-121-disk-1
I tried the zfs clone command and it gave em an error that the @ snapshot was missing.
can anyone provide instructions on copying a vm disk residing in a zfs pool.
Thanks
 
I don't want to copy the vm I want to copy just that disk and add it to the same vm as a second disk.
 
/me: " ... "

For this kind of thing you can treat the vm similar to what you would do on a physical instance.

Add a vdisk of the same size to the VM and use e.g. dd or clonezilla to copy the entire disk over. You may have to change partition UUIDs on the target disk afterward to avoid mount confusion. Best to do this from single-user mode with all daemons shutdown or from a rescue ISO with nothing mounted.

If you don't need all partitions, etc and it's a simple 1-partition / 1-filesystem disk, just create the same filesystem type on the destination disk and copy files over with Midnight Commander or rsync.

PROTIP: The copy will go faster if each vdisk is on a different datastore, less I/O contention.

If you want to do it at the host level, shutdown the vm and look into the qm man page for importdisk, or use Disk action / Move Storage -- and don't delete the source. The original disk will be replaced with the copied version on the destination datastore, but will still show up as "unused disk" and can be re-attached.

https://www.google.com/search?q=pro...wLji4B-YIwgcFMC40LjXIBxo&sclient=gws-wiz-serp

https://www.google.com/search?q=pro...gBwCyBwC4BwDCBwMyLTHIBwU&sclient=gws-wiz-serp