Beruflich Dokumente
Kultur Dokumente
The NFS server, which contains file resources that are shared with other systems The NFS client, which mounts file resources that are shared over the network and presents the resources as if they were on a local system
/etc/dfs/dfstab lists the resources to share at boot time. /etc/nfs/nfslogd.conf defines the location of the configuration
NFS server logging. /etc/dfs/sharetab lists local resources that are currently being shared by the NFS server. /etc/rmtab lists the file systems remotely mounted by NFS clients. Do not edit this file. /etc/nfs/nfslog.conf lists information defining the location of the configuration logs used for NFS server logging.
For example, here we have a home directory called /nfsserver that's shared in readonly mode:
share -o ro /nfsserver
Description of daemons:
y
y y
y y
handles file system mount requests from remote systems and provides access control. Not used in NFSv4. nfsmapid is the NFS user and group ID mapping daemon, which is used with NFSv4. nfsd handles client file system requests and is used with NFSv4. statd works with the lockd daemon to provide crash recovery and functions for the lock manager. lockd supports record locking operations on NFS files. nfslogd provides operational logging for NFSv2 and v3.
mountd
With the Solaris 10 OS and NFSv4, you need only two daemons to support NFS: nfsmapid and nfsd. The mountd and lockd daemons are integrated together, and nfsmapid and nfsd are supported in NFSv4 with port 2049, which improves support for NFS through a firewall. If you want to use NFSv2 or v3 with the Solaris 10 OS, all daemons are supported.
Starting and Stopping the NFS Server Service
The svc:/network/nfs/server service starts the NFS server daemons when the system enters run level 3. To start the NFS server daemon manually, run this command:
# svcadm enable svc:/network/nfs/server
reads and executes statements from /etc/dfs/dfstab. shares makes a local directory on the NFS server available for mounting.
shareall
dfshares,
shared.
y y
displays a list of NFS server directories that are currently mounted. unshare makes file resources unavailable for mounting.
dfmount
Syntax:
# share [-F <FSType>] [-o <option>] [<pathname>]
where:
y y
specifies the file system type. -o <option> specifies the options that control access to the shared resource, for example read-only access. <pathname> specifies the absolute path name of the resource for sharing.
-F <FSType>
For example, if you want to share the /nfsserver directory, make an entry like the following in the /etc/dfs/dfstab file:
#share -F nfs -o ro /nfsserver
In this example, -F specifies an NFS file system, -o ro specifies that access to the share is read-only, and /nfsserver is the absolute path of the share. Similarly, by using the -o rw option, you can specify that <pathname> is shared as read/write to all clients, and you can use -o root=<dir_name> to enable root privileges for the <dir_name> directory.
Making File Resources Unavailable for Mounting
Syntax:
# unshare [-F <FSType>] [<pathname>]
For example:
#unshare -F nfs /nfsserver
Syntax:
For example:
# mount -F nfs -o ro radical1:/nfsserver /mymountpoint
where:
y y y
Radical1 is the name of the remote server. /nfsserver is the remote file resource. /mymountpoint is the mount point where /nfsserver is shared.
Another example:
# mount -o ro Radical1,Sun,Moon :/Central_data /mymountpoint
In the second example, if the Radical1 system is unavailable, then the request will flow to the second system, which is called Sun, and so on.
Unmounting Remote File Systems From a Client
Syntax:
umount [<mount_point>]
For example:
# umount /mymountpoint
To mount a remote file system at boot time, make an entry in /etc/vfstab. For example, add the following entry in the /etc/dfstab file:
Radical1:/nfsserver - /mymountpoint nfs - yes bg
where:
y y y y y
is Radical1:/nfsserver
y y