[转]aix hp nfs使用手册-凯发app官方网站

凯发app官方网站-凯发k8官网下载客户端中心 | | 凯发app官方网站-凯发k8官网下载客户端中心
  • 博客访问: 3976818
  • 博文数量: 536
  • 博客积分: 10470
  • 博客等级: 上将
  • 技术积分: 4825
  • 用 户 组: 普通用户
  • 注册时间: 2006-05-26 14:08
文章分类

全部博文(536)

文章存档

2024年(3)

2021年(1)

2019年(1)

2017年(1)

2016年(2)

2013年(2)

2012年(10)

2011年(43)

2010年(10)

2009年(17)

2008年(121)

2007年(252)

2006年(73)

相关博文
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·
  • ·

分类: linux

2007-06-27 16:45:41

aix

you can stop and start most nfs daemons either by using commands or by using smit, which ultimately calls src commands. the exceptions are rpc.rexd, rpc.ruserd, rpc.rwalld, and rpc.rsprayd, which are started by inetd. the following subsystems are part of the nfs group: nfsd, biod, rpc.lockd, rpc.statd, and rpc.mountd.

to start the nfs group, type:

# -g nfs

this starts all of the daemons of the nfs group as well as the appropriate number of each. for nfsd and biod the default number of daemons is eight. to change these defaults, you must do one of the following:

  1. run the command.
  2. run the chnfs command, for example:

    # -n4 -b4

  3. run the chssys command, for example:

    # -s biod -a6

the chnfs command stops currently running nfsds and biods, updates the database to reflect the new defaults (in this case four daemons each), and then restarts the daemons using commands. the chssys command changes the cmdargs descriptor in a subsystem definition, in this case the biod subsystem. therefore anytime you run the following command:

# startsrc -s biod

the value of the -a parameter is used to determine the number of biods to start, in this case six. you can start any subsystem with the startsrc -s command or stop one with the -s command. for example:

# startsrc -s rpc.lockd
# stopsrc -s rpc.mountd

the file that controls the nfs (and nis for that matter) daemons on startup is . to disable nfs upon bootup, either remove the line containing that file name from the file or run the smit rmnfs command and select restart in the stop nfs now, system restart or both field. to enable nfs upon bootup it is best to use the command because it is easy to make a syntax error trying to edit /etc/inittab by hand.

note that /etc/rc.nfs controls the startup of both nfs and nis. if you want to disable nis but not nfs you can comment out the appropriate lines in /etc/rc.nfs or run smit rm or . do not remove the rcnfs line in /etc/inittab if you want only to disable nis.

to configure an nfs server in aix, all you do is create an file and then run smit mknfs. you can use a text editor to create /etc/exports or you can do the following:

  1. run smit:

    #

  2. you will see the following:

    add a directory to exports list

    type or select values in entry fields.
    press enter after making all desired changes.

    [entry fields]
    * pathname of directory to export [] /
    * mode to export directory read-write
    hostname list. if exported read-mostly []
    anonymous uid [-2]
    hosts allowed root access []
    hosts & netgroups allowed client access []
    use secure option? no
    * export directory now, system restart or both both
    pathname of exports file if using ha-nfs []

the required entries are pathname of directory to export, mode to export directory, and export directory now, system restart or both. fill in these parameters and press enter. smit will create or update the file and then run the -a command. the other parameters are optional and can be determined by consulting the exports man page. run the smit chnfs command.

to start the nfs daemons,

  1. run smit:

    #

  2. you will see the following:

    start nfs

    type or select values in entry fields.
    press enter after making all desired changes.
    [entry fields]
    * start nfs now, on system restart or both both

pressing enter at this point starts all the daemons of the nfs group and puts an entry in the file to make the changes permanent.

you can use the same procedure as above, run smit mknfs to start the nfs daemons-and in the case of an nfs client the biods are the only ones you might want-or you can simply start making nfs mounts from a server by doing the following:

  1. start smit:

    #

  2. you will see the following:

    add a file system for mounting

    type or select values in entry fields.
    press enter after making all desired changes.

    [entry fields]
    * pathname of mount point [] /
    * pathname of remote directory []
    * host where remote directory resides []
    mount type name []
    * use secure mount option? no
    * mount now, add entry to or both? now
    * /etc/filesystems entry will mount the directory no
    on system restart.
    * mode for this nfs file system read-write
    * attempt mount in foreground or background background
    number of times to attempt mount [] #
    buffer size for read [] #
    buffer size for writes [] #
    nfs timeout. in tenths of a second [] #
    internet port number for server [] #
    * mount file system soft or hard hard
    allow keyboard interrupts on hard mounts? yes
    minimum time, in seconds, for holding [3] #
    attribute cache after file modification
    maximum time, in seconds, for holding [60] #
    attribute cache after file modification
    minimum time, in seconds, for holding [30] #
    attribute cache after directory modification
    maximum time, in seconds, for holding [60] #
    attribute cache after directory modification
    minimum & maximum time, in seconds, for [] #
    holding attribute cache after any modification
    the maximum number of biod daemons allowed [6] #
    to work on this file system
    * allow execution of suid and sgid programs yes
    in this file system?
    * allow device access via this mount? yes
    * server supports long device numbers? yes

the required entries are denoted by the asterisk (*), are fairly obvious, and have default values which you will in most cases prefer. however, a couple entries need some additional explanation. for mount now, add entry to or both? the default value is now. if you accept the default, smit will make the mount, but the mount will be in effect only until system restart or until you explicitly unmount the file system with the command. selecting the value of both will not only result in the mount but also an entry in the /etc/filesystems file.

as explained in the chapter on disks and file systems, /etc/filesystems is aix's equivalent to hp-ux's file, which determines which file systems are mounted on bootup. both files will mount networked file systems as well as local ones; the only difference is their format. if, for example, you mounted the file system /doc from the machine elmo and had an entry for that mount in /etc/filesystems, that entry would look something like:

/doc:
dev = "/doc"
vfs = nfs
nodename = elmo
mount = false
options = bg,hard,intr
account = false

this example also illustrates the other entry in the mknfsmnt screen which needs a little explanation: /etc/filesystems entry will mount the directory on system restart. the default value is no, which results in a mount=false line in /etc/filesystems, like in the one above. this means that the remote file system will not be mounted by default upon system restart. if the line reads mount=true, then the system will attempt to make the nfs mount upon system restart. if it cannot because the server is unavailable, then additional mount requests will occur in the background (options=bg denotes this). in some cases it is better to have the mount parameter be false. if, for example, you have several mounts from the same server and it is down, the boot process will not be bogged down by attempting to make remote mounts for each networked file system, in which case it might be better to have an /etc/rc.local file to complete the mounts once everything else is up and running.

for additional information on the options available in making nfs s, see the mount, mknfsmnt, and filesystems man pages.

remove an entry from the file:

#

change an exported file system:

#

remove an nfs mount:

# smit rmnfsmnt

the basic configuration steps are listed below and detailed in the sections that follow.

  1. configure the nodes for nfs if they are not already configured.
  2. create the master map file.
  3. create the map files.
  4. if you will be using nis to administer the maps, integrate the maps with nis.
  5. start automounter.

configure for nfs

configure the systems for nfs if you have not already done so.

create the master map

the master map is usually created as /etc/auto.master and then made into the nis map auto.master. by default, automount tries to get master map information from the nis map auto.master. if a local master map file is specified on the command line, automount reads it before reading the nis auto.master map.

the format of the auto.master file is:

directorypath automountmapname

where:

  • directorypath is the full pathname of the directory that triggers automount.
  • automountmapname is the file that contains the map information.

create maps

automount maps are usually named auto.xxx, where xxx is the name of the map. the name does not have to correspond to any mount points, but it is recommended that the map name correspond to the directory contents (for example, auto.man for man pages).

as with all nis maps, names must be 10 characters or less if you have file systems that do not allow file names longer than 14 characters. this is because nis adds four-character suffixes (.dir and .pag) to the map name.

the format of the map entries is:

key [-mount options] server:directory

where:

  • key is the name of the subdirectory under the mount directory.
  • mount options can be any valid nfs mount options. this field is optional. mount options specified here override any mount options specified in the master map.
  • server:directory specifies the remote server name and the path of the remote file hierarchy (file system or directory) to mount.

automount recognizes special characters in direct and indirect maps to be used for substitutions and to escape other characters. they are:

&can substitute key values into the directory path names
*is recognized as a catch all entry (a wildcard). it is the last or only entry in a map. it matches all keys and provides a value for the & substitutions that may exist in the right-hand side of a map. for example: * -ro,intr server:/users/&
mapnamethe contents of another map can be included within the current map. if mapname is a directory with no slashes, automount interprets it as an nis map. if the directory has slashes then automount looks for a local map with that name.

integrate with nis

automount maps can be local files or administered as nis maps. by default, automount tries to read master map information from the nis map auto.master. automount also reads master map information from a local file if you specify one on the command line.

the master map can contain nis map names for the indirect and direct maps instead of file names. to specify an nis map, preface the map name with a plus ( ).

to create an nis map, edit the /var/yp/makefile:

  1. add auto.master to the all: listing.
  2. add an entry for $(dir)/auto.master.
  3. add the following stanza to makefile:
    auto.master.time: $(dir)/auto.master
    -@if [ -f $(dir)/auto.master ]; then \
    $(makedbm) $(dir)/auto.master $(ypdbdir)/$(dom)/auto.master; \
    touch auto.master.time; \
    if [ ! $(nopush) ]; then \
    $(yppush) auto.master; \
    echo "pushed auto.master"; \
    else \
    : ; \
    fi \
    else \
    echo "couldn't find $(dir)/auto.master"; \
    fi
  4. build the map:

    # cd /var/yp
    # auto.master

start automounter

the full pathname in aix is /usr/sbin/automount. the options found in the automount man page are the same as those for the hp-ux version. you can also start automount by typing the t command. if you want to start automount on bootup, the best place to put it is at the end of the file, something you will have to do manually since smit doesn't do it for you.

shutting down automount

automount is normally started and stopped only when the machine is rebooted. to shut down automount gracefully during system operation, take the following steps:

  1. make sure no processes have their current working directory set to any automount directories or subdirectories.
  2. then, send automount the sigterm (-15) signal (sigterm is the default signal sent by the command).

caution: no other automount daemon should be started until the first has successfully cleaned up and exited. if a second automount daemon is started when the first is in its shutdown process, the second daemon will start its shutdown process. this means that there will now be four automount daemons: the first, the second, and their children. these daemons will not exit until all the mount directories they are serving have been unmounted.

do not send the sigkill signal (kill -9, kill -kill) to the automount daemon. this will cause any processes accessing mount directories served by automount to hang. the file hierarchies mounted by automount under /tmp_mnt will still be accessible.

hp-ux

at the sam main window, highlight networking/communications and activate the open button.

  1. at the networking/communications window, highlight networked file systems (nfs) and activate the open button.
  2. highlight remote file systems mounted and activate the open button. this edits your file.
  3. to add remote directories to be mounted, choose add from the actions menu and then enter the information about the remote directory you want to mount to.
    • enter the remote system name. this is the system name where the directory or file you wish to access resides.
    • enter the remote directory name. this is the name of the directory you wish to access.
    • enter the local directory name. this is the local directory where you want the remote directory to be mounted.
    • choose when to mount. you have two mount options to choose from: now and on boot. if now is chosen, the directory will be available when the information in this window has been accepted. if on boot is chosen, the directory will be available when this system is booted.
    • choose access permissions. write protection provides the type of access the user will have on the remote directory. there are two options to choose from: read-only, meaning the user can only read the information in the directory and read/write, meaning the user can read and write to the directory.
    • set user id execution. this indicates whether the user must have a user id when trying to access the remote directory. choosing yes means a user id is not required.
    • change default mount options. this takes you into the nfs mount options window. you can change the following mount options:
      • choose one of the mount options. there are two choices: hard mounted directories or files cause nfs to retry a request until the server responds. soft mounted directories or files abort requests after one attempt.
      • read buffer size (rsize). this specifies the maximum read request size used in communicating with the server.
      • write buffer size (wsize). this specifies the maximum write request size used in communicating with the server.
  4. when you are finished entering mount information, activate the ok button to perform the task and return to the add remote directory window.
  5. when you are finished entering the remote directory information, activate the ok button to add this remote directory information to your file.
  6. in the remote file systems mounted window, you can enable the nfs client by choosing enable nfs client from the actions menu. you should see the remote directory information displayed in the window.
  1. at the networking/communications window, highlight networked file systems (nfs) and activate the open button.
  2. highlight local file systems exported and activate the open button. this edits your file.
  3. to add local directories that can be exported to remote systems, choose add from the actions menu and then enter the information about the directory you want to export to the remote systems. this will take you into the add file system to export window.
    • enter the local directory name. this the directory that will be exported to remote systems.
    • enter an unknown userid. you can map anonymous, or unknown, user requests to uid. by setting the anonymous user id in /etc/exports, the unknown user in an anonymous request is mapped to a well-known local user. if the anonymous user is mapped to nobody (the default), anonymous requests are accepted but have very few permissions to access files on the server. the information you need to complete this task is the remote system names to which you are allowing or denying access. if you specify uid for unknown user, you will be prompted for a login name.
    • select asynchronous writes. yes means that asynchronous write will be done. no means no asynchronous writes will be done.
    • specify permission for file access. selecting read only will cause the read only access window to be displayed. the window enables you to add, modify or remove remote systems to have read-only access to your local directory. selecting read/write will cause the read/write access window to be displayed. this window enables you to add, modify or remove remote systems to have read/write access to your local directory.
  4. in the local file systems exported window, you can enable the nfs server by choosing enable nfs server from the actions menu. you should see the local directories and the directories access information displayed in the window.

using sam to allow or deny access to specific rpc services

this task lets you allow or deny access to specific rpc services (servers). when you perform this task, you are editing the file. the information you need to complete this task is the remote system names to which you are allowing or denying access.

to perform this task:

  1. at the networking/communications window, highlight security and activate the open button.
  2. highlight internet service and activate the open button.
  3. to modify rpc services, highlight the rpc services you want to modify, or you can choose to modify all internet services from the actions menu. this will take you into the modify internet security window. select the system permissions you would like your rpc services to have.
  4. when you have completed your task, activate the ok button.

you must be superuser to create an nfs server. to create an nfs server, complete the following steps. these steps are described in detail in the sections that follow.

  1. edit .
  2. edit (optional).
  3. edit /usr/adm/inetd.sec (optional).
  4. edit (optional).
  5. create and edit .
  6. reboot the system (if necessary) or run /etc/netnfsrc.

edit

the /etc/netnfsrc file activates the nfs daemons and servers. to define the node as an nfs server, set the nfs_server variable to any digit other than zero. set start_mountd to any digit other than 0. mountd can be started from netnfsrc on inetd. if mountd has an entry in inetd.conf the start_mountd should be 0. if the node is also a client, you may want to set the nfs_client variable to any digit other than zero now. if the node is also a server for pc-nfs requests, set the pcnfs_server variable to any digit other than zero.

client only nfs_client=1 nfs_server=0
server only nfs_client=0 nfs_server=1 start_mountd=1
both client and server nfs_client=1 nfs_server=1 start_mountd=1
neither client nor server nfs_client=0 nfs_server=0
pc-nfs server pcnfs_server=1 start_mountd=1

you can refer directly to the comments for editing instructions and for descriptions of each activity executed by :

#!/bin/sh
## configured using sam by root on tue jul 18 14:41:23 1995
## @(#)netnfsrc: $revision: 1.51.109.9 $ $date: 92/08/18 13:48:27 $
# netnfsrc -- nfs startup file
##
# depending on the configuration parameters you set within,
# this script sets up some or all of the following:
# nis specific:
# domainname -- the nis domain name
#
# and starts up some or all of the following programs:
# portmap -- rpc (program_#,version) -> port_# mapper
# nfsd -- nfs daemons
# biod -- async bio daemons
# pcnfsd -- pc-nfs daemon
# nis specific:
# ypbind -- nis client process (all nis nodes)
# ypserv -- nis server process (nis server only)
# yppasswdd -- nis password daemon (nis master server only)
##
# nfs_client -- 1 if this node is an nfs client, 0 if not
# nfs_server -- 1 if this node is an nfs server, 0 if not
# note: it is possible for one host to be a client, a server, both
# nfs_server -- 1 if this node is an nfs server, 0 if not
# note: it is possible for one host to be a client, a server, both
# or neither! this system is an nfs client if you will be
# nfs mounting remote file systems; this system is a server
# if you will be exporting file systems to remote hosts.
# see also: nfsd(1m), mount(1m).
##
nfs_client=1
nfs_server=1
##
# start_mountd -- 1 if this script should start rpc.mountd.
# 0 if /etc/inetd.conf has an entry for mountd.
# note: rpc.mountd should be started from netnfsrc. however, it
# can be started from either netnfsrc or inetd, and
# must only be configured in one place.
##
start_mountd=1
##
. . .

##
#pcnfs_server -- 1 if this node is a server for pc-nfs requests.
# this variable controls the startup of the
# pcnfsd(1m) server. see also: pcnfsd(1m).
##
pcnfs_server=0

edit (optional)

to activate the rpc services, remove all # comment marks from /etc/inetd.conf lines beginning with #rpc. after editing /etc/inetd.conf, you must reconfigure inetd by entering:

-c

rpc services security

the inetd security facility works only when the inetd executes a server. for the rpc services that do not exit after each service request, inetd provides a security check only for the first request. successive requests bypass the inetd and are subject only to the security checking performed by the individual rpc services. however, you can make the inetd perform a security check for every rpc request by doing both of the following steps:

  1. add the -e option to the entry for the rpc service.
  2. specify the rpc service in the first field of .

note: adding the -e option makes the rpc server respond slower since it has to restart for each request.

example

suppose contains the following:

rpc dgram udp wait root /usr/etc/rpc.mountd 100005 1 rpc.mountd -e

the rpc.mountd program is the server for the command and reads to see what the available directories or files are and to whom they are exported. it also keeps a list of all mounted directories or files. the -e option forces inetd to perform a security check for rpc.mountd on every request.

edit (optional)

nfs operates under the assumption you have a friendly network; meaning, you can trust all users attached to your network. since this assumption may not apply to everyone, refer to the following sections to improve your file security.

the configuration file is provided in the arpa services product. it is not solely for nfs access. this file allows you to determine:

  • how many remote services can run simultaneously on the local host.
  • which hosts are allowed to remotely use the local host.
set maximum number of remote connections

on the first line in , enter the maximum number of simultaneous remote services to be started by inetd as shown in the following example:

maxnum number

if you do not specify a maxnum value, the default is 1000.

specify accesses to services

each entry in has the following format (enter either allow or deny):

service_name allow/deny host_specifier(s)

where:

service_name name of a valid service (include rpc services) with an entry in /etc/inetd.conf/etc/inetd.conf

for rpc services, service_name is the name of the service that matches its program number in /etc/rpc. this entry must have a corresponding entry in /etc/inetd.conf/etc/inetd.conf which contains the -e option.

specify only one service per entry.

if an entry in /usr/adm/inetd.conf specifies the service name and nothing else, inetd allows all hosts to attempt access.

allow/denythe allow entry instructs inetd to approve the host or network for access to the specified service.

the deny entry instructs inetd to disapprove the host or network for access to the specified service.

host_specifier(s) name of a host or a network listed in /etc/hosts/etc/hosts or /etc/networks, or an internet address in the standard internet notation.

you can specify more than one host or network by separating each host_specifier with a blank or tab.

you can use the asterisk (*) or dash (-) in any field of a network or host address.

you cannot use aliases.

edit (optional)

the /etc/netgroup file enables you to define a specific network-wide group of nodes as a netgroup. you can then limit directory access by exporting directories or files (via and exportfs) to the netgroups defined. the system uses /etc/netgroup to verify host names whenever clients perform remote mounts.

create and edit

you make the directories or files and their access restrictions, if any, available by your entries in the server's /etc/exports file. when you boot up the nfs server, the file will automatically run the exportfs daemon, which looks up /etc/exports and makes the directories or files available for nfs clients to access. you can export and unexport directories or files after the server is up or change access permissions of the exported directory by using the exportfs command. the exportfs command can be run at any time by the superuser to alter the list or characteristics of exported directories and filenames. for details on constructing the /etc/exports file, see the man page on exports(4). also refer to exportfs(1m).

reboot

after you finish the configuration procedure, execute or reboot the system to activate the daemons and servers. the rebooting process does not unmount any of the server's directories or files that were remotely mounted by other network nodes. however, these nodes will not be able to access any of the server's files until the server is operating again.

the basic configuration steps are listed below and detailed in the sections that follow.

  1. configure the nodes for nfs if they are not already configured.
  2. create the master map file.
  3. create the map files.
  4. if you will be using nis to administer the maps, integrate the maps with nis.
  5. start automounter.

configure for nfs

configure the systems for nfs if you have not already done so. this task includes adding nfs to the kernel and editing . on the servers, edit .

create the master map

the master map contains the names of the indirect and direct maps. it also contains the names of common mount directories for indirect maps. you do not need a master map if you pass all the map information to automount in the command line.

the master map is usually created as /etc/auto.master and then made into the nis map auto.master. by default, automount tries to get master map information from the nis map auto.master. if a local master map file is specified on the command line, automount reads it before reading the nis auto.master map.

the format for indirect map entries in the master maps is:

mount directory indirect map [-mount options]

the format for direct map entries in the master map is:

/- direct map [-mount options]

where:

  • mount directory is the absolute path of the mount directory for the indirect map. automount manages this directory. the directory should not be an existing directory, if a local directory by the same name already exists, automount will cover it.
  • /- indicates that the entry is for a direct map.
  • indirect map or direct map is the file name or nis map name of the indirect map or direct map. if the map name is prefaced with a plus ( ), automount searches for an nis map. this field can also be one of the following special maps:
-hostsindicates the hosts map. the name of the remote host is used as the subdirectory name under the mount directory.
-passwordindicates the password map
-nullcancels a previous map for the indicated mount directory. for example, if you use this in a local master map, it cancels the entry in the nis auto.master map.
  • mount options can be any nfs mount options. mount options in the master map are overridden by mount options in the indirect/direct maps.

create map files

automount maps are usually named auto.xxx, where xxx is the name of the map. the name does not have to correspond to any mount points, but it is recommended that the map name correspond to the directory contents (for example, auto.man for man pages).

as with all nis maps, names must be 10 characters or less if you have file systems that do not allow file names longer than 14 characters. this is because nis adds four-character suffixes (.dir and .pag) to the map name.

by convention, maps are usually created under or /etc. if you use nis to administer the maps, you should create the source files under the (1m) source directory; the default ypmake source directory is /etc.

indirect maps

each indirect map has a mount directory associated with it that is controlled by automount. the mount directory contains symbolic links to the actual mount points under /tmp_mnt. the mount directory is specified on the automount command line or in the master map.

the format of the indirect map entries is:

key [-mount options] server:directory

where:

  • key is the name of the subdirectory under the mount directory.
  • mount options can be any valid nfs mount options. this field is optional. mount options specified here override any mount options specified in the master map.
  • server:directory specifies the remote server name and the path of the remote file hierarchy (file system or directory) to mount.

automount recognizes special characters in direct and indirect maps to be used for substitutions and to escape other characters. they are:

&can substitute key values into the directory path names
*is recognized as a catch-all entry (a wildcard). it is the last or only entry in a map. it matches all keys and provides a value for the & substitutions that may exist in the right-hand side of a map. for example: * -ro,intr server:/users/&
mapnamethe contents of another map can be included within the current map. if mapname is a directory with no slashes, automount interprets it as an nis map. if the directory has slashes then automount looks for a local map with that name.
direct maps

direct maps can contain any number of unrelated mount points. no common mount directory is maintained.

the format of the direct map entries is:

key [-mount options] server:directory

where:

  • key is the absolute path of the mount point.
  • mount options can be any valid nfs mount options. this field is optional. mount options specified here override any mount options specified in the master map.
  • server:directory specifies the remote server name and the path of the remote file hierarchy (file system or directory) to mount.

the special characters listed above are also valid for direct maps.

integrate with nis

automount maps can be local files or administered as nis maps. by default, automount tries to read master map information from the nis map auto.master. automount also reads master map information from a local file if you specify one on the command line.

the master map can contain nis map names for the indirect and direct maps instead of file names. to specify an nis map, preface the map name with a plus ( ).

to create nis maps, edit the /usr/etc/yp/ shell script as shown below. in the following text, assume that you want to create nis maps for auto.master and a direct map called auto.xxxx. within the scripts, auto_master and auto_direct are used for local variable names to avoid regular expression evaluation, but the map and file names are auto.master and auto.direct.

under the function section, add the following blocks for auto.master and auto.xxxx:

     auto_master() {
grep -v "^[ ]*#" $1 | grep -v "^[ ]*$" | \
awk 'begin { ofs="\t"; } { print $1, $2, $3 }' | \
$makedbm - $mapdir/auto.master
}

auto_xxxx() {
grep -v "^[ ]*#" $1 | grep -v "^[ ]*$" | \
awk 'begin { ofs="\t"; } { print $1, $2, $3 }' | \}
$makedbm - $mapdir/auto.xxxx
}

in the block

         for arg in $*; do
case "$arg" in

add an entry for auto.master and auto.xxxx before the "*)" in the case statement as follows:

         auto_master )
if [ `expr "$maps" : ".* auto.master.*"` -eq 0 ]; then
maps="$maps auto.master"
fi;;
auto_xxxx )
if [ `expr "$maps" : ".* auto.xxxx.*"` -eq 0 ]; then
maps="$maps auto.xxxx"
fi;;

in the definition for

      maps=${maps:-'passwd groups hosts ...

add an entry for auto_master and auto_xxxx.

in the block

     for map in $maps; do
case $map in

add an entry for auto.master and auto.xxxx as follows:

     auto_master)   build $dir/auto.master auto.master ;;
auto_xxxx) build $dir/auto.xxxx auto.xxxx;;

you should also modify /usr/etc/yp/ on the master server. add auto.master and auto.xxxx to the list of master_maps.

start automounter

automount is started by executing /usr/etc/automount at boot time. it is executed by default from the 2 file. you can specify map information on the command line. any map information you specify is read before information in the nis map auto.master and takes precedence over the nis map. see automount(1m) for specific command line options.

shutting down automount

automount is normally started and stopped only when the machine is rebooted. to shut down automount gracefully during system operation, take the following steps:

  1. make sure no processes have their current working directory set to any automount directories or subdirectories.
  2. then, send automount the sigterm (-15) signal (sigterm is the default signal sent by the command).

warning: no other automount daemon should be started until the first has successfully cleaned up and exited. if a second automount daemon is started when the first is in its shutdown process, the second daemon will start its shutdown process. this means that there will now be four automount daemons: the first, the second, and their children. these daemons will not exit until all the mount directories they are serving have been unmounted

do not send the sigkill signal (kill -9, kill -kill) to the automount daemon. this will cause any processes accessing mount directories served by automount to hang. the file hierarchies mounted by automount under /tmp_mnt will still be accessible.

summary

nfs, originally a sun product, works mostly the same in both aix and hp-ux. however, some of the details differ, as always. aix controls nfs daemons through the system resource controller () while hp-ux allows for direct commands. both operating systems' system management tools (smit and sam) support nfs configuration, which in most cases is the preferred way to go. automatic nfs mounts on bootup are controlled by (aix) and (hp-ux). though the format of each file differs, the principle in each is the same.

both systems support automount, though you have to configure it manually on each. the biggest difference in the automount area is its integration with nis. otherwise, nfs has the same "look and feel" across aix and hp-ux platforms. both platforms export file systems listed in via the exportfs command. both systems have nfsds, biods, rpc.mountd, rpc.lockd, and rpc.statd. since nfs uses the external data representation (xdr) protocol, there is no problem in data representation across the two systems.

阅读(4823) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~
")); function link(t){ var href= $(t).attr('href'); href ="?url=" encodeuricomponent(location.href); $(t).attr('href',href); //setcookie("returnouturl", location.href, 60, "/"); }
网站地图