|
A: share and mount commands
These are two commands used a lot by system adminstrator, share command is uesed to share the directories on local machine, then other UNIX systems could use it; mount command is used to connect the directories that shared from other UNIX systems to the local connection points, and finally to make use of the resources of other UNIX systems. Such as:
On machine A, keyed machineA# share -F nfs -o rw /share-dir
On machine B, keyed machineB# mount -F nfs machineA:/share-dir /mount-point
The first command shares the share-dir directory of machine A and the shared authority is accessible’
The second command connects the shared directory of machine A to the directory mount-point of machine B.
After finishing these two commands, on machine B users could operate the directory share-dir of machine A by accessibility to mount-point.
But sometimes when we process, on machine B after executing the mount command, error “RPC: Program not registered” would return back. This is because the machine A lacks mountd and nfsd two watch processes (daemons).. When UNIX system starts, system would auto test the file /etc/dfs/dfstab, if there’s shared resource in the file, then you have to start these two watch processes, contrariwise, not to start them. Therefore, if there’s no content in /etc/dfs/dfstab, then system could not start the two watch processes mounted and nfsd, and the shared directory by share command could not be really shared by system.
Actually the solutin for it is really simple, we could put the directories we want to shard into /etc/dfs/dfstab, then next time when system starts, the directory would be shared automatically; besides, we could manually start these watch processes. First is to log in with supervisor (root), and then enter the commands in command line:
machine_A# /etc/rc3.d/S15nfs.server start
or to type:
machine_A# /usr/lib/nfs/mountd
machine_A# /usr/lib/nfs/nfsd -a 16
then you could start these two processes.
After this, the directory could be shared, and then use mount comnmand on machine B to connect the directory of machine A to itself.
Remove share use: unshare -F nfs /data
NFS, network file system, the protocol used to share files by NUIX system directly.
NFT server: provides the system of network shared resource.
NFS client: use network shared resource.
When client sends a NFS request, the articulated process would contact articulated watch process (/usr/lib/nfs/mountd). Local articulated process would write articulated information to the file /etc/mnttab. Once client finishes NFS articulated request, the articulated information would be written into the file /etc/rmtab in server. When client uninstalls NFS shared resource, these information would be deleted from the file.
NFS server watch process
When client tries to access remote shared resources, NFS server’s watch process (/usr/lib/nfs/nfsd)response the request and return data. Server watch process is produced by /etc/init.d/nfs.server. if there’s shared contents in the file /etc/dfs/dfstab, these shared directories would auto share when watch process starts.
Client NFS watch process
There’re two watch processes on client, /usr/lib/nfs/statd and /usr/lib/nfs/lockd. They auto run when system enters running level 2.
# more /etc/dfs/dfstab
# Place share(M) commands here for automatic execution
# on entering init state 3.
#
# Issue the command '/etc/init.d/nfs.server start' to run the NFS
# daemon processes and the share commands, after adding the very
# first entry to this file.
#
# share [-F fstype] [ -o options] [-d ""] [resource]
# e.g,
# share -F nfs -o rw=engineering -d "home dirs" /export/home2
Share command
share [ -F FSType ] [ -o options ] [ -d description ] pathname
Parameters:
- F FSType specify the type of file system. If the default remote file of /etc/dfs/fstypes is of NFS, then you don’t have to specify.
- - o options: controls the authority if client could access NFS shared resources.
- -d description: the description of the shared resources.
- Pathname: the resources to share
Unshared command
unshare [ -F nfs ] pathname
Dfshares command
Used to check the shared resources of server.
# dfshares
RESOURCE SERVER ACCESS TRANSPORT
venus:/usr/share/man venus - -
#dfshares mars
RESOURCE SERVER ACCESS TRANSPORT
mars:/export mars - -
Dfmounts command
Check the used situation of the shared resource on server.
# dfmounts
RESOURCE SERVER PATHNAME CLIENTS
- venus /usr/share/man earth, pluto,(anon)
Connect remote network file system.
mount [ -F nfs ] [ -o options ] server athname mount_point
# mount venus:/usr/share/man /usr/share/man
solaris shared files have root authority -o rw,anon=0
share -F nfs -o rw,anon=0 /export/home/bea_new/wlserver6.1/config/mydomain/applications/DefaultWebAp
Oh, I haven’t talk about how to stop nfsd and mountd, these watch processes. Here I make up:
With root authority: #/etc/init.d/nfs.server stop NFS
To use #/etc/init.d/nfs.server start NFS is to restart process
|