Follow

Got a real puzzle around how handles NFS mounts. From the same server they have the same device ID. This means things like fuser don't work.

Files that are opened by a process are found in /proc/PID/fd and fuser stat()s them to find the device ID, then it scans the mounts to match so you can do things like "who has files open under /mydir"?

For NFS this just does not work because all mounts from the same server will state they have files open.

Someone suggested using the fdinfo directory. This matches against the mnt_id field. Too bad it doesnt do it uniquely for sockets but still for mount points I have a solution.

Show thread

The solution I eventually used was an evil kludge. It just matches the path of the mount point and the real path of the target file (so followed symlinks etc).

Evil, but lsof does this same thing so at least I will have company.

Show thread
Sign in to participate in the conversation
Mastodon on Dropbear

The social network of the future: No ads, no corporate surveillance, ethical design, and decentralization! Own your data with Mastodon!