Managing NFS Server for solaris10
Managing NFS Server for solaris10
1.NFS Server 所需要的几个相关文件:
File Description
/etc/dfs/dfstab Lists the local resources to share at boot time.
/etc/dfs/sharetab Lists the local resources currently being shared by the NFS server. Do not edit this file.
/etc/dfs/fstypes Lists the default file system types for remote file systems.
/etc/rmtab Lists file systems remotely mounted by NFS clients. Do not edit this file.
/etc/nfs/nfslog.conf Lists information defining the location of configuration logs used for NFS server logging.
/etc/default/nfslogd Lists configuration information describing the behavior of the nfslogd daemon for NFSv2/3.
/etc/default/nfs Contains parameter values for NFS protocols and NFS daemons.
2.查看依赖于nfs/server的服务:
# svcs | grep nfs
# svcs -l nfs/server
3.启动nfs服务进程:
# svcadm enable svc:/network/nfs/server
4.停止nfs服务进程:
# svcadm disable svc:/network/nfs/server
5.nfs server所使用的命令:
Commands
Description
share
Makes a local directory on an NFS server available for mounting. It also displays the contents of the /etc/dfs/sharetab file.
unshare
Makes a previously available directory unavailable for client side mount operations.
shareall
Reads and executes share statements in the /etc/dfs/dfstab file.
unshareall
Makes previously shared resources unavailable.
dfshares
Lists available shared resources from a remote or local NFS server.
dfmounts
Displays a list of NFS server directories that are currently mounted
6.配置nfs server
share [ -F nfs ] [ -o options ] [ -d description ] [ pathname ]
Option
Description
-F nfs
Specifies the file system type. This option is not typically required, because NFS is the default remote file system type.
-o options
Controls a client's access to an NFS shared resource.
-d description
Describes the shared file resource.
pathname
Specifies the absolute path name of the resource for sharing
The share Command Options
Options
Definitions
ro
Informs clients that the server accepts only read requests
rw
Allows the server to accept read and write requests from the client
root=client
Informs clients that the root user on the specified client system or systems can perform superuser-privileged requests on the shared resource
ro=access-list
Allows read requests from the specified access list
rw=access-list
Allows read and write requests from the specified access list, as shown in the table
Access List Options
Option
Description
access-list=client:client
Allows access based on a colon-separated list of one or more clients.
access-list=@network
Allows access based on a network number (for example, @192.168.100) or a network name (for example, @mynet.com). The network name must be defined in the /etc/networks file.
access-list=.domain
Allows access based on a Domain Name System (DNS) domain; the dot (.) identifies the value as a DNS domain.
access-list=netgroup_name
Allows access based on a configured net group (Network Information Service or Network Information Service Plus only).
anon=n
Sets n to be the effective user ID (EUID) of anonymous users. By default, anonymous users are given the EUID 60001 (UID_NOBODY). If n is set to -1, access is denied.
unshare [ -F nfs ] pathname
unshare Command Options
Option
Description
-F nfs
Specifies NFS as the file system type. Because NFS is the default remote file system type, you do not have to specify this option.
pathname
Specifies the path name of the file resource to unshare.
7.查看当前共享的资源:
dfshares [ -F nfs ] [ host ]
查看当前挂载的资源:
dfmounts [ -F nfs ] [ server ]
8.管理nfs客户端:
NFS Client Files
File
Description
/etc/vfstab
Defines file systems to be mounted locally.
/etc/mnttab
Lists currently mounted file systems, including automounted directories. The contents of this file are maintained by the kernel and cannot be edited.
/etc/dfs/fstypes
Lists the default file system types for remote file systems.
/etc/default/nfs
Contains parameters used by NFS protocols and daemons
NFS Client Daemons
Daemon
Description
statd
Works with the lockd daemon to provide crash recovery functions for the lock manager
lockd
Supports record-locking operations on NFS files
nfs4cbd
NFSv4 callback daemon
9. 管理nfs客户端进程:
The lockd daemon is started by the SMF service nfs/nlockmgr.
# svcadm -v enable nfs/nlockmgr
The statd daemon is started by the SMF service nfs/status.
# svcadm -v enable nfs/status
Restarting the NFS Client Daemons:
# svcadm -v restart nfs/status
# svcadm -v restart nfs/nlockmgr
NFS Client Commands
Command
Description
dfshares
Lists available shared resources from a remote or local NFS server
mount
Attaches a file resource (local or remote) to a specified local mount point
umount
Unmounts a currently mounted file resource
mountall
Mounts all file resources or a specific group of file resources listed in the /etc/vfstab file with a mount at boot value of yes
umountall
Unmounts all non-critical local and remote file resources
Accessing the Remote File Resource
mount [ -F nfs ] [ -o options ] server:pathname mount_point
mount Command Options
Option
Description
-F nfs
Specifies NFS as the file system type. The -F nfs option is not necessary, because NFS is the default remote file system type specified in the /etc/dfs/fstypes file.
-o options
Specifies a comma-separated list of file-system specific options, such as rw. The rw option mounts the file resource as read, write. The ro option mounts the file resource as read-only. (The default is rw.)
server:pathname
Specifies the name of the server and the path name of the remote file resource. The names of the server and the path name are separated by a colon (:).
mount_point
Specifies the path name of the mount point on the local system (which must already exist).
10.从客户端卸载远程挂载的资源:
umount server:pathname | mount_point
Mounting All File Resources
mountall -r [ -F nfs ]
Unmounting All Currently Mounted File Resources
umountall -r [ -F nfs ]
11.启用nfs server日志:
The nfslogd daemon provides operational logging.
Each tag in the /etc/nfs/nfslog.conf file corresponds to one mapping table
本文来自ChinaUnix博客,如果查看原文请点:http://blog.chinaunix.net/u1/36549/showart_304837.html
页:
[1]