Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

4
  • showmount -r remote will tell me if remote is exporting anything, but is there any way for me to determine if remote:/mnt/dir is being exported without starting a subshell (i.e. a pipeline)? Commented Dec 30, 2014 at 21:17
  • showmount -e remote will tell you if remote has exported anything. showmount -r will only give you an error message as that option doesn't exist. You could try to use shell substring matching to basically grep for a regular expression in the showmount output. Maybe have a look at e.g. stackoverflow.com/questions/12619720/… Commented Dec 31, 2014 at 12:02
  • Or put the other way around, I don't know of any standalone command which can specifically query a remote NFS server for one particular mount, and I don't think that exists. Only other two viable ways would be to query the remote server locally via ssh (although even then there's no reliable way to determine if a given directory is currently exported due to the stateless nature of NFS). Other approach could be to try to mount the NFS export from the client and check for the exit code and then the local mount and its contents. Commented Dec 31, 2014 at 12:16
  • My mistake with the -r option versus -e – that's what I meant :) The 'attempt approach' has been suggested before. I don't particularly like it, but it's looking like a real option. Commented Dec 31, 2014 at 13:16