0

How can I determine if /tmp is a mounted NFS share on Solaris?

The issue at hand stems from this SO question, where Jonathan Leffler commented that

...
If your /tmp file system is NFS mounted (unlikely, but not impossible), then root has few privileges on that file system.

4
  • What's the real problem you're trying to solve? Feb 21, 2012 at 6:54
  • Somebody pointed out that root user id might have limited permission inside /tmp folder when /tmp folder is mounted on NFS and in my case i was not able to delete some files from /tmp folder even by root user id . So i wanted to check that
    – Ritesh
    Feb 21, 2012 at 7:00
  • You're going to have to explain a little deeper than that. Feb 21, 2012 at 7:01
  • Not all NFS have that problem, only those with root squash enabled have that.
    – J-16 SDiZ
    Feb 21, 2012 at 7:05

3 Answers 3

3

On both Solaris and Linux, this will show the file system used by /tmp:

mount | grep /tmp

/tmp might not be a mount point but just a subdirectory in /, you can figure it out with:

df -k /tmp

In this latter case, to know the root file system, use

mount | head -n 1
0

On Solaris and Linux do:

mount -v | grep nfs | grep tmp

If your /tmp actually is mounted on NFS it will show up in the output.

-1

I think

findmnt -t nfs /tmp

would do this.

6
  • On which Solaris?
    – Karlson
    Feb 24, 2012 at 19:05
  • I can't see where this is stated in the question. This however works here on my centos 6 machine. no reason to rate down. this answer is not wrong.
    – l1zard
    Feb 24, 2012 at 20:44
  • The question is tagged solaris
    – Karlson
    Feb 24, 2012 at 20:47
  • Its also tagged linux. ;) How should i know which one is relevant when its not stated in the question? however lets leave it as that.
    – l1zard
    Feb 24, 2012 at 20:51
  • Assume both are.
    – Karlson
    Feb 24, 2012 at 20:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .