ZFS: Should I use /dev/myzdev or /dev/zvol/myzdev ?

alc

Active Member
Feb 18, 2020
26
2
43
40
When listing their contents, both will list every disk I have stored there, and they will both update on each change.

Is there a difference between them ?

When exporting a disk, is there one of them I should prefer ?
(--> I do manual backups as VMDK because of multi-hypervisor environment, so I use qemu-img by targetting a disk directly).

Thanks!
 
AFAICT they are both just symlinks to /dev/zdXXX. So take whatever fits your bill.

I think the more important question is how you assure the consistency of your backups. Do you take snapshots and back up them?

You can make them visible by setting the snapdev property to visible on the dataset.

zfs set snapdev=visible <path to dataset>
 
I do a 'qemu-img convert -O vmdk /dev/myzdev/mydisk /destination' after having shut down the machine, and turn them on afterwards on a same script.

It's a rudimentary backup solution but I can afford the downtime, so I think it's definitely consistent, right ?
(I'm very new to hypervisors).
Note that my destination has ZFS snapshots by itself, so I also have "time-machine-like" restore at hand with this solution.
 
Okay, if you would keep your VMs running, taking a snapshot and using that would ensure too that the data does not change while you back it up.

If the target is a ZFS too you could also consider to send the data directly zfs to zfs incrementally with for example pve-zsync. Once you need to have the data on another hypervisor you could still do the conversion to vmdk or whatever you need.
 
  • Like
Reactions: alc