On default FreeBSD configuration (vfs.zfs.vol.recursive == 0) it's impossible to create ZFS pools on vdevs. When users try to do this they see generic and confusing error message:
# zfs create -V 1G -s zroot/kwiat
# zpool create -f kwiat /dev/zvol/zroot/kwiat
cannot create 'kwiat': no such pool or dataset
For someone not experienced in ZFS it will take some time to learn how to workaround this as it seems it's not documented anywhere. What's more, on Linux it just works.
My ideas how to improve this:
1) Better error message when vfs.zfs.vol.recursive==0 and backing device is zvol.
Example: "cannot create 'kwiat': creating pool on zvol is dangerous. See man zpool(8) for more info."
2) Document it in the zpool(8) manpage in "zpool create" section
After reboot, pool on zvol cannot be imported even with vfs.zfs.vol.recursive=1. zpool import command hangs indefinitely and ignores ^C.
Output of procstat -k of that process:
PID TID COMM TDNAME KSTACK
49700 102119 zpool - mi_switch sleepq_switch _sx_xlock_hard _sx_xlock spa_all_configs zfs_ioc_pool_configs zfsdev_ioctl devfs_ioctl vn_ioctl devfs_ioctl_f kern_ioctl sys_ioctl amd64_syscall fast_syscall_common
(In reply to Mateusz Kwiatkowski from comment #1)
That kind of a hang is exactly why vfs.zfs.vol.recursive is zero by default.
(In reply to Andriy Gapon from comment #2)
That's my guess too. UX could be better either way.