cancel
Showing results for 
Search instead for 
Did you mean: 

nfs share command

SOLVED
Go to solution
Ron Irving
Trusted Contributor

nfs share command

Hi all!!

Ok, if I have a directory on server, sourceserver, we'll call it /dir/2dir/targetdir, and I want to nfs export it to another server, server2:/targetshare

The line in my /etc/fstab on the target server is: sourceserver:/dir/2dir/tagetdir /targetdir nfs defaults 0 2

I have my /etc/exports on the target beast as:
/dir/2dir/targetdir targetserver:/targetdir

I run the share command:
share -F nfs -o rw /dir/2dir/targetdir
then:
exportfs -a

Do I have to do a dance every time it reboots? I've set the nfsclient=1 and the nfsserver=1 appropriately.

Am I missing something?
Should have been an astronaut.
13 REPLIES
Ron Irving
Trusted Contributor

Re: nfs share command

Oh...I forgot...the mount -a works like a champ when I'm on the target server.
Should have been an astronaut.
Dennis Handly
Acclaimed Contributor

Re: nfs share command

>I have my /etc/exports on the target beast as:
/dir/2dir/targetdir targetserver:/targetdir

What are you trying to do here? You can't daisy chain mounts.

>Do I have to do a dance every time it reboots?

Which reboots?
Ron Irving
Trusted Contributor

Re: nfs share command

so, if I want to nfs mount /dirA on another server, how should my /etc/exports file look? What if either one reboots? Do I have to run the share command every time?
Should have been an astronaut.
Andrew Rutter
Honored Contributor

Re: nfs share command

hi,

What versions of hpux are you using? 11.31 doesnt use the /etc/exports file but uses
/etc/dfs/dfstab file and uses the share command.

11.11 uses /etc/exports file and exportfs command

seems like your trying to use two different ways of doing things

so if 11.31 you would add your entry to this file on the target server and specify here the clients and r/w options

you should also add the mountpoint on the clients fstab to mount it at reboot, not on the servers fstab.

Andy
Dennis Handly
Acclaimed Contributor

Re: nfs share command

>if I want to NFS mount /dirA on another server, how should my /etc/exports file look?

That file must either list all of your clients you want to have access or allow all.

>What if either one reboots? Do I have to run the share command every time?

If it is in the client's /etc/fstab, it will be mounted when the client reboots. If it is in the server's /etc/exports or /etc/dfs/dfstab, it will be exported when the server reboots.

Basically what Andy said.
Ron Irving
Trusted Contributor

Re: nfs share command

Ok. The systems are down presently, but here's what I have in my /etc/exports file:

/u02/oracle/StageR12 access=fobapp

where fobapp is the server mounting the StageR12

Here's the line, (I think,) on fobapp's /etc/fstab

fobdb:/u01/oracle/StageR12 /StageR12 nfs defaults 0 2

How am I doing so far?
Should have been an astronaut.
Ron Irving
Trusted Contributor

Re: nfs share command

AH!! (He says as the light goes on)

I'm running 11.31, so as was said previously, /etc/dfs/dfstab would be the thing to use.

The question is: upon reboot, as long as the /etc/dfs/dfstab file is set correctly, and the /etc/fstab has the appropriate parameter, I should be good to go?

Should have been an astronaut.
Andrew Rutter
Honored Contributor

Re: nfs share command

ron,

yes it loks like you got it.

when you have added the entries to the dfstab file then issue the share command or stop and start nfs on the target server

#shareall (on the target server)

will share all nfs points

#share (on the target server)

will display all the shared points on your target server

run the mount command on the clients and it should work.

Andy
Ron Irving
Trusted Contributor

Re: nfs share command

Soooooooooooooo...

...once the dfstab on the 'exporting' server is correct, and the /etc/fstab on the 'mounting' server is correct, and I reboot, (exporting first, mounting 2nd,) then everything should export and mount happily, correct?

Should have been an astronaut.
Dennis Handly
Acclaimed Contributor

Re: nfs share command

>/u02/oracle/StageR12 access=fobapp
>where fobapp is the server mounting the StageR12

Or more precise, fobapp is the client mounting StageR12.

>once the dfstab on the 'exporting' server is correct, and the /etc/fstab on the 'mounting' server is correct, and I reboot, (exporting first, mounting 2nd,) then everything should export and mount happily, correct?

Yes.
You can also use the automounter to mount NFS filesystems as needed on your clients.
Ron Irving
Trusted Contributor

Re: nfs share command

Thank you so much...here's the line in my dfstab:

/usr/sbin/share -F nfs -o rw=/u02/oracle/StageR12

Does that look good?
Should have been an astronaut.
Dennis Handly
Acclaimed Contributor
Solution

Re: nfs share command

>/usr/sbin/share -F nfs -o rw=/u02/oracle/StageR12
>Does that look good?

rw= takes a list of machines not filesystems.

If you want to share StageR12 to all machines you can do:
/usr/sbin/share -F nfs -o rw /u02/oracle/StageR12

Or just:
/usr/sbin/share -F nfs /u02/oracle/StageR12
Ron Irving
Trusted Contributor

Re: nfs share command

Thanks Dennis, Andy, and all you "smarter-than-me" guys!!!

Have a beer!! (Can we buy beer with our points? I AM Canadian)
Should have been an astronaut.