lsof does not show anything.
No command pfiles or fuser ?
No command pfiles or fuser ?
lsof
is a port, right, and if it really doesn't support ZFS (I wonder why listing opened files should somehow depend on the underlying filesystem? Shouldn't the VFS be enough?), this is probably missing upstream, so little the maintainer can do about that.# procstat -f PID | egrep ' T V | v r '
PID COMM FD T V FLAGS REF OFFSET PRO NAME
32326 dd text v r r------- - - - /bin/dd
32326 dd 4 v r rw------ 2 1975517184 - /pool/random.dd
# procstat -f `ps -o pid= -U UID` | egrep ' T V | v r '
PID COMM FD T V FLAGS REF OFFSET PRO NAME
6217 sshd text v r r------- - - - /usr/sbin/sshd
6310 zsh text v r r------- - - - /usr/local/bin/zsh
6310 zsh 12 v r r------- 1 0 - /usr/local/share/zsh/5.8/functions/Completion.zwc
6310 zsh 13 v r r------- 1 0 - /usr/local/share/zsh/5.8/functions/Zle.zwc
6310 zsh 14 v r r------- 1 0 - /usr/local/share/zsh/5.8/functions/Completion/Base.zwc
… perhaps lsof does not understand ZFS …
# gpart show /dev/da2
gpart: No such geom: /dev/da2.
# lsblk da2
DEVICE MAJ:MIN SIZE TYPE LABEL MOUNT
da2 0:154 14G - - -
# zpool import Transcend ; zpool status Transcend && zfs load-key Transcend/VirtualBox && zfs mount Transcend/VirtualBox ; mount | grep Transcend
pool: Transcend
state: ONLINE
scan: scrub repaired 0B in 01:26:19 with 0 errors on Mon May 31 22:14:58 2021
config:
NAME STATE READ WRITE CKSUM
Transcend ONLINE 0 0 0
gpt/FreeBSD%20ZFS ONLINE 0 0 0
cache
da2 ONLINE 0 0 0
errors: No known data errors
Enter passphrase for 'Transcend/VirtualBox':
Transcend on /Volumes/t500 (zfs, local, nfsv4acls)
Transcend/VirtualBox on /Volumes/t500/VirtualBox (zfs, local, nfsv4acls)
# lsof /Volumes/t500/VirtualBox
lsof: WARNING: device cache mismatch: /dev/da1p1
lsof: WARNING: no ZFS support has been defined.
See 00FAQ for more information.
lsof: WARNING: /root/.lsof_mowa219-gjp4-8570p was updated.
# lsof /Volumes/t500/VirtualBox
lsof: WARNING: no ZFS support has been defined.
See 00FAQ for more information.
# zpool export Transcend
cannot unmount '/Volumes/t500/VirtualBox': pool or dataset is busy
#
I'm using procstat to list regular files opened by process or user. …
gvfsd-trash
whenever a pool can not be exported. YMMV. umount -f
root@mowa219-gjp4-8570p:~ # ps ax -o pid= | xargs procstat -f 2 > /dev/null
procstat: sysctl(kern.proc): No such process
procstat: procstat_getprocs()
root@mowa219-gjp4-8570p:~ # sh
# ps ax -o pid=|xargs procstat -f 2>/dev/null | grep t500
# zpool export Transcend
# exit
root@mowa219-gjp4-8570p:~ # echo $SHELL
/bin/csh
root@mowa219-gjp4-8570p:~ #
you cant easily redirect (only) stderr in csh or at least i dont know howToo obviousthanks again. Still, I'm curious about why the first syntax doesn't work in csh …
If you are trying to figure out which process or user is generating disk load then try top command.Thanks, things become problematic when a person can't guess which user or process to specify.
top -m io
It is not necessary, just use -fa flag for procstat.ps ax -o pid=|xargs procstat -f 2>/dev/null
procstat -fa