1752664 Members
5341 Online
108788 Solutions
New Discussion юеВ

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 13
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.