stat
or /proc/[PID]/mountinfo
should still tell you what the device numbers are:
[root@XXXlin01 block]# stat --printf="%d" /tmp/mnt; echo
24
[root@XXXlin01 block]# stat --printf="%d" /tmp/mnt2; echo
25
[root@XXXlin01 block]# grep "/tmp/mnt" /proc/22195/mountinfo
40 20 0:24 / /tmp/mnt rw,relatime - tmpfs none rw
41 20 0:25 / /tmp/mnt2 rw,relatime - tmpfs none rw
Both outputs show 0:25
and 0:24
as the device numbers in question. The "0" device number is used for "unnamed" mounts (such as tmpfs, sysfs, nfs, procfs, etc). For example, here is an NFS mount:
[root@XXXlin01 block]# grep "/LinuxHome" /proc/22195/mountinfo
39 36 0:23 / /home/jad87 rw,relatime - nfs duhsnas-xxx:/ifs/Application\040File\040Shares/DUHS/LinuxHomeDir_fs/jad87 rw,vers=3,rsize=4096,wsize=4096,namlen=255,soft,proto=tcp,timeo=14,retrans=2,sec=sys,mountaddr=10.1x.92.106,mountvers=3,mountport=300,mountproto=udp,local_lock=none,addr=10.1x.92.106
42 36 0:26 / /home/tsa20 rw,relatime - nfs 10.1x.92.117:/ifs/Application\040File\040Shares/DUHS/LinuxHomeDir_fs/tsa20 rw,vers=3,rsize=4096,wsize=4096,namlen=255,soft,proto=tcp,timeo=14,retrans=2,sec=sys,mountaddr=10.1x.92.117,mountvers=3,mountport=300,mountproto=udp,local_lock=none,addr=10.1x.92.117
The NFS mounts above are 0:23
and 0:26
respectively.
Best Answer
NFS is a file system, as per its name. User processes that open/read/seek/write/close files on an NFS-mounted directory don't know that it's an NFS file system because the kernel makes NFS look like any other file system.
So, a user process that reads an NFS-mounted file will generate a
read(2)
system call that ends up causing some kernel code to run. All NFS traffic will come from the Linux/Unix kernel itself, not from a user-level process. Hence the "?" as a PID.