在Linux上使用nfsv3命令
showmmount -d显示在nfs服务器上挂载dir的远程客户端。对于具有远程挂载目录的nfs4,显示挂载命令不显示任何内容。如何知道本地计算机上哪个远程客户端正在使用nfs服务器?
发布于 2022-11-01 14:36:57
找到解决办法了。
netstat -ta | grep nfsd|grep ESTA|awk '{print $5}'|cut -d : -f 1或
ss -rta | grep nfsd|grep ESTA|awk '{print $5}'|cut -d : -f 1把我所有的客户都联系起来。
为了显示打开的目录和使用的文件,我们可以查询好的旧procfs,假设我的客户端是215识别的。
cd /proc/fs/nfsd/clients/215我看到三个文件
ctl info states在文件信息中,我可以看到客户端的ip、使用的端口、主机名。
clientid: ******************
address: "192.168.0.2:850"
status: confirmed
name: "Linux NFSv4.2 myclient.host.example"
minor version: 2
Implementation domain: "kernel.org"
Implementation name: "Linux 6.1.12 #1 SMP PREEMPT_DYNAMIC Sat Feb 18 16:45:16 CET 2023 x86_64"
Implementation time: [0, 0]
callback state: UP
callback address: 192.168.0.2:0文件状态显示正在使用的文件、权限和其他信息。
cat状态
- ***********: { type: open, access: r-, deny: --, superblock: "00:18:4627", filename: "video/My vacations.mp4", owner: "open id:******************" }
- *********************: { type: deleg, access: r, superblock: "00:18:4627", filename: "video/My vacations.mp4" }https://unix.stackexchange.com/questions/723244
复制相似问题