I have an NFS share which is shared across about two other machines. I recently realized that one of the servers isn't sharing the directory and is keeping files all for itself. Is there a way to see if the NFS share is mounted in the directory I think it is in?
Asked
Active
Viewed 4.2k times
29
-
`mount -l` works ;) – Naftuli Kay Sep 12 '11 at 21:16
5 Answers
53
Maybe you are looking for
df .
When you are in the directory you want to know the mountpoint of?
-
3
-
@TK Kocheran The mount command is another way to find out, but then you probably should do "mount -l | grep XXX" so you filter the output a little, and still you may have ambiguous output (if you have dirs with similar names). The df command will tell you where the current dir is mounted and what type so there is not ambiguity in this method. But the result should be the same... – Johan Sep 13 '11 at 08:13
-
See also [that recent discussion on the austin-group mailing list](https://www.mail-archive.com/[email protected]/msg01678.html) that mentions corner cases where it may not work. – Stéphane Chazelas Nov 03 '17 at 09:40
11
Straphka idea to use df will work well if you add some flags like the -T that shows filesystem type, (and maybe the -P for posix compability). And to top it off we can use awk to filter the output so we only print the type output column.
df -PTh . | awk '{print $2}'
or if you like to check up on a dir called smb/media/ in your homedir.
df -PTh ~/smb/media/ | awk '{print $2}'
Johan
- 4,523
- 2
- 26
- 33
10
You can use this:
stat -f -c %T .
It outputs nfs, ext2/ext3 or something different.
guettli
- 1,309
- 3
- 22
- 40