Operating System - HP-UX
1824822 Members
3970 Online
109674 Solutions
New Discussion юеВ

How to restart NFS server safely

 
SOLVED
Go to solution
senthil_kumar_1
Super Advisor

How to restart NFS server safely

Hi All,

I am using HP-UX 11.11, NFS service are running on that.

Now i want to add some new NFS shares in /etc/exports file. so that i have to restart the NFS service running.

I have some following questions on restarting NFS service:

1)How to view what are the NFS clients are accessing NFS shares available in NFS server?


2)What happen if we are restarting the NFS server while NFS client is accessing some NFS shares?

3)Will the NFS mount points of NFS client automatically connect to NFS server after restarting the NFS server?


4)How to restart the NFS server safely? what are the commands to be used.

31 REPLIES 31
Michal Kapalka (mikap)
Honored Contributor
Solution

Re: How to restart NFS server safely

hi,

just add lines ( entries ) to the /etc/exports and use command exportfs -va

the server will automaticaly using new settings without restarting of the NFS server.

on the client side add the entries to the /etc/fstab and mount -a or youst mount it manually.


mikap
Michal Kapalka (mikap)
Honored Contributor

Re: How to restart NFS server safely

hi,

showmount -e hostname_of_nfs_server

will show you wich FS are exported for which hosts, and which access privileges.

mikap
senthil_kumar_1
Super Advisor

Re: How to restart NFS server safely

1)So if we are using "exportfs -a", the existing NFS mount will not be disconnected? am i correct?


2)But if we are restarting NFS, then all the NFS mounts will be disconnected and connected (after some times) automatically? am i correct?
Pete Randall
Outstanding Contributor

Re: How to restart NFS server safely

1) correct

2) sounds more like NFS with automounter - NFS by itself will not mount/dismount automatically.


Pete

Pete
senthil_kumar_1
Super Advisor

Re: How to restart NFS server safely

what is the purpose of the service NFSLOCK.
Johnson Punniyalingam
Honored Contributor

Re: How to restart NFS server safely

It handles file locking for remote and local NFS requests.

Have a look at the rpc.lockd manual page for details
Problems are common to all, but attitude makes the difference
Steven E. Protter
Exalted Contributor

Re: How to restart NFS server safely

Shalom,

NFS Lock handles file locking for NFS. NFS file locking in version three of NFS is not very reliable. NFS version 4, which is only available on 11.31 HP-UX handles file locking efficiently.

sEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Michal Kapalka (mikap)
Honored Contributor

Re: How to restart NFS server safely

Steven Schweda
Honored Contributor

Re: How to restart NFS server safely

> check the man page :
> [...]

Who thinks that a "man" page for an obsolete
version of Tru64 is the best source of
information for "HP-UX 11.11"?
Michal Kapalka (mikap)
Honored Contributor

Re: How to restart NFS server safely

hi Steven,

yes you have right, my misteak,

in the attachment you will find the man page.

sorry for my wrong response.

mikap
Viktor Balogh
Honored Contributor

Re: How to restart NFS server safely

>1)How to view what are the NFS clients are accessing NFS shares available in NFS server?

you can check it this way:

# showmount -a

>2)What happen if we are restarting the NFS server while NFS client is accessing some NFS shares?

the client will report a stale NFS file handle, and then you must forcibly umount the share, or you should start serving NFS again on the server
****
Unix operates with beer.
senthil_kumar_1
Super Advisor

Re: How to restart NFS server safely

So that other users can not access the same file if one user is accessing, am i correct?
Viktor Balogh
Honored Contributor

Re: How to restart NFS server safely

>So that other users can not access the same file if one user is accessing, am i correct?

No, this locking is only for writing. Concurrent acces is permitted, but only one can write to the file at once. Before every write this logfile will be stat'ed, if it fails then it cannot be written to the file.
****
Unix operates with beer.
Viktor Balogh
Honored Contributor

Re: How to restart NFS server safely

s/logfile/loCKfile/
****
Unix operates with beer.
senthil_kumar_1
Super Advisor

Re: How to restart NFS server safely

Hi All,

I have configured NFS server in HP-UX 11.31.

I have done following steps:

1)Created NFS share entry in /etc/exports on sys1 (host name of NFS server):

# vi /etc/exports

/var -root=sys3:sys2


2)Restarted NFS services needed for NFS server:

# /sbin/init.d/nfs.core start
Starting NFS CORE networking

Starting up the rpcbind
/usr/sbin/rpcbind


# /sbin/init.d/lockmgr start
Starting up the Status Monitor daemon
rpc.statd already started, using pid: 987
Starting up the lock manager daemon
/usr/sbin/rpc.lockd


# /sbin/init.d/nfs.server start
Starting NFS SERVER subsystem

Reading in /etc/dfs/dfstab
Starting up the mount daemon
/usr/sbin/rpc.mountd
Starting up the NFS server daemon
/usr/sbin/nfsd
Starting up nfsmapid daemon
/usr/sbin/nfsmapid

3)Now i have executed the below command to view the NFS shares in NFS server (sys1):

# showmount -e
no exported file systems for emdlaghpvm05

# showmount -a


4)Then i executed the below command since the NFS shares are not shown by "showmount -e":

# exportfs -va
shareall -F nfs


5)I am getting below mentioned error while mounting NFS share from NFS client (sys3):

# mount -F nfs sys1:/var /nfs
nfs mount: sys1:/var: Permission denied


How to solve this issue.


sujit kumar singh
Honored Contributor

Re: How to restart NFS server safely

Hi Senthil

As this is 11.31 you need to use the /etc/dfs/dfstab insted of /etc/exports


add the entries in the /etc/dfs/dfstab as follows:

share -F nfs /var -o root=sys1:sys2
save and exit

exportfs -au
exportfs -a

make sure that on the nfs server as well as the nfs clients the /etc/hosts have the each others entries.



if you /etc/exports there and want to convert the saem to the /etc/dfs/dfstab format, just run the commands as

exportfs -au
exp2dfs
exportfs -a
showmount -e

make sure the nfs server and the nfs clients have each others entries in the /etc/hosts file.



regards
sujit
sujit kumar singh
Honored Contributor

Re: How to restart NFS server safely

Hi Senthil

As this is 11.31 you need to use the /etc/dfs/dfstab insted of /etc/exports


add the entries in the /etc/dfs/dfstab as follows:

share -F nfs /var -o root=sys1:sys2
save and exit

exportfs -au
exportfs -a

make sure that on the nfs server as well as the nfs clients the /etc/hosts have the each others entries.



if you /etc/exports there and want to convert the saem to the /etc/dfs/dfstab format, just run the commands as

exportfs -au
exp2dfs -- this shall convert the /etc/export entries to /etc/dfs/dfstab entries.
exportfs -a
showmount -e

make sure the nfs server and the nfs clients have each others entries in the /etc/hosts file.



regards
sujit
Steven E. Protter
Exalted Contributor

Re: How to restart NFS server safely

Shalom,

showmount -e localhost

To see after all these changes you have made have altered your NFS shares.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
senthil_kumar_1
Super Advisor

Re: How to restart NFS server safely

So both "/etc/exports" and "/etc/dfs/dfstab" are differing lot in configuration method.


What about the options like root, rw, ro, anon, aync.


Could you please explain about what those options are meaning in /etc/dfs/dfstab.
Johnson Punniyalingam
Honored Contributor

Re: How to restart NFS server safely

/etc/dfstab **********
this file list the local resources to be shared at the boot time

configures NFS Server
Problems are common to all, but attitude makes the difference
Johnson Punniyalingam
Honored Contributor

Re: How to restart NFS server safely

"/etc/exports"
=*************

used under both side NFS Server and NFS client
Problems are common to all, but attitude makes the difference
Johnson Punniyalingam
Honored Contributor

Re: How to restart NFS server safely

>>What about the options like root, rw, ro, anon, aync<<

rw= read & write

ro = read only

anon=uid. If a request comes from an unknown user

async ├в Allows the server to write data at non-regular intervals. This setting works best if the exported file system is read-only. If the exported file system is read/write and hosts are making changes to the file system when the server crashes, data can be lost. By specifying the sync option, all file writes are committed to the disk before the write request by the client is completed. The sync option, however, can lower performance.

Problems are common to all, but attitude makes the difference
senthil_kumar_1
Super Advisor

Re: How to restart NFS server safely

From which version of HP-UX /etc/dfs/dfstab has been used as NFS configuration file?
senthil_kumar_1
Super Advisor

Re: How to restart NFS server safely

Is the below statement is true on HP-UX.

You cannot export a directory and its ancestor or descendant, if they are
on the same disk or logical volume. For example, if you are exporting the
root directory (/), you cannot also export /opt, unless / and /opt are on
different disks or logical volumes. Likewise, if you are exporting
/opt/frame, you cannot also export /opt unless /opt/frame and /opt
are on different disks or logical volumes. However, if a directory and its
ancestor or descendant are on different disks or logical volumes, and you
want to export both of them, you must export them using two separate
entries in /etc/exports. Use the bdf(1M) command to determine
whether your file systems are on different disks or logical volumes. Each
line in the bdf output is a separate disk or volume that requires its own
entry in /etc/exports if you want to export it.




But i tried in Linux (Redhat), on that i am able to export export a directory and its ancestor or descendant, if they are
on the same disk or logical volume.


So only HP-UX we can not do this, am i correct?