ZFS how to find what process is using zvol?

Is there a way to find out which processes is using a zvol or dataset and then making it impossible to delete or rollback?

Code:
zfs rollback oceanpool/iscsi/1000G@zfs-auto-snap_minut-2016-03-04-10h00
cannot rollback 'oceanpool/iscsi/1000G': dataset is busy

And after a few minutes it works. The question I have is why?

Tried to google it but didn't seem to find anything related.
 
Don't really understand the command, when I use sudo procstat -af | grep zvol it gives me no result, but I know I have ctl running with iSCSI and FC target. and when I run

Code:
anders@bsdserver:~ % sudo procstat -af | grep ctl
  485 moused  4 v c rw------  1  0 -  /dev/consolectl
  506 moused  4 v c rw------  1  0 -  /dev/consolectl
  523 devd  3 v c r-------  1  299004 -  /dev/devctl
  529 unbound  7 s - rw---n--  1  0 UDS /var/run/local_unbound.ctl
  802 ctl  cwd v d r-------  -  - -  /
  802 ctl  root v d r-------  -  - -  /
40960 ctld  text v r r-------  -  - -  /usr/sbin/ctld
40960 ctld  cwd v d r-------  -  - -  /
40960 ctld  root v d r-------  -  - -  /
40960 ctld  jail v d r-------  -  - -  /
40960 ctld  0 v c rw------  3  0 -  /dev/null
40960 ctld  1 v c rw------  3  0 -  /dev/null
40960 ctld  2 v c rw------  3  0 -  /dev/null
40960 ctld  3 s - rw------  1  0 UDD /var/run/logpriv
40960 ctld  4 v c rw------  1  0 -  /dev/cam/ctl
40960 ctld  5 v r -w---n-l  1  0 -  /var/run/ctld.pid
40960 ctld  6 s - rw------  1  0 TCP 0.0.0.0:3260 0.0.0.0:0
40960 ctld  7 s - rw------  1  0 TCP ::.3260 ::.0
90748 Xorg  7 v c rw------  1  0 -  /dev/nvidiactl
90748 Xorg  19 v c rw------  1  0 -  /dev/nvidiactl

This is the result but I still don't see anything pointing to my zvols any ideas?
 
Always too quick to "help". I thought something like mount to see which paths the volume provides and procstat to grep those paths. But it's more complicated, I guess

getting my coat,
Juha
 
But it's more complicated, I guess.

Actually, no. It's just that "zvol" is not a mountpoint or process name, so grep won't find it.

If the dataset is a network share, the first thing I'd do before modifying it is stop the share services. The process using the dataset might not even be local, and diving head-first down that rabbit hole probably isn't how you want to spend your day.
 
Back
Top