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

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.

RMG

Posted 2012-02-21T06:51:59.283

Reputation: 103

What's the real problem you're trying to solve? – Ignacio Vazquez-Abrams – 2012-02-21T06:54:47.947

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 – None – 2012-02-21T07:00:54.063

You're going to have to explain a little deeper than that. – Ignacio Vazquez-Abrams – 2012-02-21T07:01:57.917

Not all NFS have that problem, only those with root squash enabled have that. – J-16 SDiZ – 2012-02-21T07:05:53.470

Answers

2

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

jlliagre

Posted 2012-02-21T06:51:59.283

Reputation: 12 469

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.

Karlson

Posted 2012-02-21T06:51:59.283

Reputation: 2 163

-1

I think

findmnt -t nfs /tmp

would do this.

l1zard

Posted 2012-02-21T06:51:59.283

Reputation: 933

On which Solaris? – Karlson – 2012-02-24T19:05:48.283

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 – 2012-02-24T20:44:05.580

The question is tagged [tag:solaris] – Karlson – 2012-02-24T20:47:29.897

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 – 2012-02-24T20:51:49.987

Assume both are. – Karlson – 2012-02-24T20:52:47.720

@l1zard, If you are answering for only one OS, please state that in your answer. Also, please test that the syntax is correct before posting it. If you cannot test it at that moment, please follow up once you are able to. – Yedric – 2012-09-27T16:57:07.953