Operating System - HP-UX
1847108 Members
5188 Online
110263 Solutions
New Discussion

NFS mount of filesystem RW *and* RO

 
B. Chapman
Frequent Advisor

NFS mount of filesystem RW *and* RO

Hi,

I need to mount a filesystem to two different machines, and, I need to export to machine A as READ-ONLY, and export to machine B as READ-WRITE.

Is this possible? And if so, what is the syntax in /etc/exports?

Thanks in advance!
Ben Chapman
chapmanb@saic.com
7 REPLIES 7
Mark Grant
Honored Contributor

Re: NFS mount of filesystem RW *and* RO

Haven't tried this but you would have, I guess, two entries in /etc/exports. One with the "rw" option and the "access" for machine A and the other with the "ro" option and the "access" for machine B. I imagine that would work.
Never preceed any demonstration with anything more predictive than "watch this"
Pete Randall
Outstanding Contributor

Re: NFS mount of filesystem RW *and* RO

Ben,

I don't think you can do this on the export. From the man page:

"The ro and rw
options cannot be used on the same exports line."

You would have to control the mount options on the individual machines in order to accomplish this.


Pete

Pete
KapilRaj
Honored Contributor

Re: NFS mount of filesystem RW *and* RO

export it as rw and mount as "ro" (first node) "rw" on the second node.

Kaps
Nothing is impossible
Mark Grant
Honored Contributor

Re: NFS mount of filesystem RW *and* RO

How about this from the man page for "exports"


rw=hostname[:hostname]...Export the directory read-mostly. Read-mostly means read-only to most machines, but read-write to those specified.
Never preceed any demonstration with anything more predictive than "watch this"
G. Vrijhoeven
Honored Contributor

Re: NFS mount of filesystem RW *and* RO

Hi Ben,

Not sure it is possible, but you can try this:
#exports
/mountpoint -access=machineA,ro
/mountpoint -access=machineB,rw

exportfs -va

And see what gets exported
Bharat Katkar
Honored Contributor

Re: NFS mount of filesystem RW *and* RO

Never tried that one but see if this works edit /etc/exports and add this entries:

/mountpoint ro=MACHINE_A, rw=MACHINE_B

Regards,
You need to know a lot to actually know how little you know
iminus
Frequent Advisor

Re: NFS mount of filesystem RW *and* RO

Can you try use two lines and one specify A as RO the next specify B as RW? I'm not sure about this one...
hope it helps