[AIX 네트워크 관리 32] NFS (1) NFS 개요, 서비스, ACL, CacheFS, 프록시, 내보내기와 마운트, 구성 파일
https://archive.horanglab.com/posts/aix-net-nfs-1
핵심 정리
- AIX 5.3 이후 NFS 버전 2, 3, 4를 지원하며 클라이언트 기본은 버전 3입니다. v2·v3 서버는 상태가 없고(stateless), v4 서버는 open·잠금 때문에 상태가 있습니다(stateful).
- 주요 데몬: 서버 rpc.mountd(v2·v3 마운트), nfsd, 클라이언트 biod, Kerberos용 gssd(krb5 파일 세트 필요), v4 ID 변환 nfsrgyd. v4 전용으로 내보내도 접근 권한 조회에 rpc.mountd가 필요합니다.
- ACL: NFS4 ACL(플랫폼 독립, EA 버전 2 JFS2)과 AIXC ACL(AIX 전용, 클라이언트 마운트 옵션으로 켬). 한 파일에 두 ACL을 동시에 둘 수 없으며
aclgettypes로 확인합니다. - 마운트 종류: 미리 정의(
/etc/filesystems), 명시(mount), 자동(automount, AutoFS). 내보내기 속성을 바꾸거나 netgroup·클라이언트 IP가 바뀌면 다시 내보내야 합니다(서버가 접근 권한 캐시를 둠). v4는 서버의 pseudo 파일 시스템을 한 번에 마운트할 수 있고, 파일 대 파일 마운트는 안 됩니다. /etc/exports: 한 디렉터리를 v2·v3용과 v4용으로 두 번 적을 수 있고(같으면-vers=3:4), ro, access=, root=, sec=krb5 같은 옵션을 씁니다./etc/xtab은 지금 내보낸 목록으로 직접 고치지 않습니다. CacheFS(cfsadmin)는 / 와 /usr에 쓸 수 없고, 6.1로 올린 뒤에는 옛 캐시를 다시 만들어야 합니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 NFS RBAC와 프록시 서빙 설명이 바뀌거나 더해짐) |
| 원문 | Networks and communication management — 5.3판 386394쪽, 6.1판 491500쪽 |
| 파일 | /etc/exports, /etc/xtab, /etc/filesystems, /etc/rc.nfs, /etc/netgroup, /etc/nfs/hostkey, /etc/nfs/local_domain, /etc/nfs/realm.map, /etc/nfs/princmap, /etc/nfs/security_default |
| 관련 명령어 | exportfs, mount, umount, automount, cfsadmin, fsck_cachefs, mknfsproxy, aclget, aclput, aclgettypes, chnfsdom, chnfsrtd, nfshostkey, nfshostmap, chnfssec |
NFS(Network File System)는 네트워크에 파일을 저장하는 메커니즘입니다. 사용자가 원격 컴퓨터에 있는 파일과 디렉터리에 접근해 로컬에 있는 것처럼 다룰 수 있게 하는 분산 파일 시스템입니다.
예를 들어 사용자는 운영 체제 명령으로 원격 파일과 디렉터리를 만들고, 지우고, 읽고, 쓰고, 파일 속성을 설정할 수 있습니다.
NFS 소프트웨어 패키지에는 NFS, NIS(Network Information Service)와 그 밖의 서비스를 위한 명령과 데몬이 들어 있습니다. NFS와 NIS는 한 패키지로 함께 설치되지만 서로 독립적이며 각각 따로 구성하고 관리합니다. NIS와 NIS+에 관한 자세한 내용은 Network Information Services (NIS and NIS+) Guide를 봅니다.
AIX 5.3 이후는 NFS 버전 2, 3, 4 프로토콜을 지원합니다. NFS 버전 4는 가장 최근에 정의된 NFS 버전이며 RFC 3530에 설명되어 있습니다. AIX의 NFS 버전 4 지원에 관한 자세한 내용은 이 절 뒤에서 다룹니다. NFS 클라이언트는 기본으로 NFS 버전 3 프로토콜을 씁니다.
영어 원문
Network File System
The Network File System (NFS) is a mechanism for storing files on a network. It is a distributed file system that allows users to access files and directories located on remote computers and treat those files and directories as if they were local.
For example, users can use operating system commands to create, remove, read, write, and set file attributes for remote files and directories.
The NFS software package includes commands and daemons for NFS, Network Information Service (NIS), and other services. Although NFS and NIS are installed together as one package, each is independent and each is configured and administered individually. See Network Information Services (NIS and NIS+) Guide for details on NIS and NIS+.
AIX 5.3 and later supports the NFS version 2, 3, and 4 protocols. NFS version 4 is the most recently-defined version of NFS, and it is described by RFC 3530. Additional details on AIX support of NFS version 4 will be discussed later in this section. NFS clients use the NFS version 3 protocol by default.
NFS 서비스
NFS는 클라이언트-서버 관계로 서비스를 제공합니다.
자기 파일 시스템이나 디렉터리와 그 밖의 자원을 원격 접근에 쓸 수 있게 하는 컴퓨터를 서버라고 합니다. 파일 시스템을 쓸 수 있게 하는 일을 내보내기(exporting)라고 합니다. 서버 자원을 쓰는 컴퓨터와 그 프로세스를 클라이언트라고 봅니다. 클라이언트가 서버가 내보낸 파일 시스템을 마운트하면 클라이언트는 서버의 개별 파일에 접근할 수 있습니다(내보낸 디렉터리에 대한 접근을 특정 클라이언트로 제한할 수 있습니다).
NFS가 제공하는 주요 서비스는 다음과 같습니다.
표 90. NFS 서비스
| 서비스 | 설명 |
|---|---|
| 마운트 서비스 | 서버의 /usr/sbin/rpc.mountd 데몬과 클라이언트의 /usr/sbin/mount 명령으로 마운트합니다. NFS 버전 2와 3에서만 씁니다. |
| 원격 파일 접근 | 서버의 /usr/sbin/nfsd 데몬과 클라이언트의 /usr/sbin/biod 데몬으로 접근합니다. |
| 원격 실행 서비스 | 서버의 /usr/sbin/rpc.rexd 데몬과 클라이언트의 /usr/bin/on 명령으로 실행합니다. |
| 원격 시스템 통계 서비스 | 서버의 /usr/sbin/rpc.rstatd 데몬과 클라이언트의 /usr/bin/rup 명령으로 모읍니다. |
| 원격 사용자 목록 서비스 | 서버의 /usr/lib/netsvc/rusers/rpc.rusersd 데몬과 클라이언트의 /usr/bin/rusers 명령으로 나열합니다. |
| 부트 매개변수 서비스 | 서버의 /usr/sbin/rpc.bootparamd 데몬으로 Sun Operating System 디스크 없는 클라이언트에 시작 매개변수를 제공합니다. |
| 원격 Wall 서비스 | 서버의 /usr/lib/netsvc/rwall/rpc.rwalld 데몬과 클라이언트의 /usr/sbin/rwall 명령으로 제공합니다. |
| Spray 서비스 | 서버의 /usr/lib/netsvc/spray/rpc.sprayd 데몬과 클라이언트의 /usr/sbin/spray 명령으로 RPC(Remote Procedure Call) 패킷의 단방향 흐름을 보냅니다. |
| PC 인증 서비스 | 서버의 /usr/sbin/rpc.pcnfsd 데몬으로 PC-NFS용 사용자 인증 서비스를 제공합니다. |
| 강화 보안 서비스 | 클라이언트와 서버 양쪽에서 Kerberos 5 같은 더 발전된 보안 서비스에 접근하게 합니다. /usr/sbin/gssd 데몬이 NFS에 Network Authentication Service가 제공하는 보안 서비스 접근을 줍니다. Network Authentication Service와 Cryptographic Library 파일 세트(krb5.client.rte, krb5.server.rte, modcrypt.base)가 설치되어 있어야 합니다. 이 파일 세트는 AIX Expansion Pack에서 설치할 수 있습니다. |
| ID 변환 서비스 | 보안 주체, NFS 버전 4 ID 문자열, 해당하는 숫자 시스템 ID 사이를 변환합니다. 또 외부 NFS 버전 4 도메인의 ID 정보 매핑을 제공합니다. 이 서비스는 /usr/sbin/nfsrgyd 데몬이 제공합니다. |
참고: 한 컴퓨터가 NFS 서버이자 NFS 클라이언트일 수 있습니다.
NFS 버전 2와 3 서버는 상태가 없습니다(stateless). 곧 서버가 클라이언트에 관한 트랜잭션 정보를 유지하지 않습니다. NFS 트랜잭션 하나는 완전한 파일 작업 하나에 해당합니다. NFS는 나중에 NFS를 쓰는 데 필요한 정보를 클라이언트가 기억해야 합니다.
NFS 버전 4 서버는 NFS 버전 4 프로토콜에 정의된 파일 open과 파일 잠금 작업 때문에 상태가 있습니다(stateful).
영어 원문
NFS services
NFS provides its services through a client-server relationship.
The computers that make their file systems, or directories, and other resources available for remote access are called servers. The act of making file systems available is called exporting. The computers and their processes that use server resources are considered clients. After a client mounts a file system that a server exports, the client can access the individual server files (access to exported directories can be restricted to specific clients).
The major services provided by NFS are:
Table 90. NFS services
- Mount service — Mounts from the /usr/sbin/rpc.mountd daemon on the server and the /usr/sbin/mount command on the client. This service is only available on NFS version 2 and version 3.
- Remote File access — Accesses from the /usr/sbin/nfsd daemon on the server and the /usr/sbin/biod daemon on the client.
- Remote execution service — Executes from the /usr/sbin/rpc.rexd daemon on the server and the /usr/bin/on command on the client.
- Remote System Statistics service — Compiles from the /usr/sbin/rpc.rstatd daemon on the server and the /usr/bin/rup command on the client.
- Remote User Listing service — Lists from the /usr/lib/netsvc/rusers/rpc.rusersd daemon on the server and the /usr/bin/rusers command on the client.
- Boot Parameters service — Provides startup parameters to Sun Operating System diskless clients from the /usr/sbin/rpc.bootparamd daemon on the server.
- Remote Wall service — Protects from the /usr/lib/netsvc/rwall/rpc.rwalld daemon on the server and the /usr/sbin/rwall command on the client.
- Spray service — Sends a one-way stream of Remote Procedure Call (RPC) packets from the /usr/lib/netsvc/spray/ rpc.sprayd daemon on the server and the /usr/sbin/spray command on the client.
- PC authentication service — Provides a user authentication service for PC-NFS from the /usr/sbin/rpc.pcnfsd daemon on the server.
- Enhanced security service — Provides access on both the client and server to more advanced security services, such as Kerberos 5. The /usr/sbin/gssd daemon provides NFS with access to security services provided by the Network Authentication Service. The Network Authentication Service and the Cryptographic Library filesets (
krb5.client.rte, krb5.server.rte, and modcrypt.base) must be installed. These filesets can be installed from the AIX Expansion Pack. - Identity translation service — Performs translation between security principals, NFS version 4 identity strings, and their corresponding numeric system IDs. In addition, mapping of identity information from foreign NFS version 4 domains is provided. These services are provided by the /usr/sbin/nfsrgyd daemon.
- Note: A computer can be both an NFS server and an NFS client simultaneously.
NFS version 2 and 3 servers are stateless, meaning that the server does not retain any transaction information about its clients. A single NFS transaction corresponds to a single, complete file operation. NFS requires that the client remember any information needed for later NFS use.
An NFS version 4 server is stateful because of the file open and file locking operations defined in the NFS version 4 protocol.
NFS ACL(접근 제어 목록) 지원
AIX NFS 버전 4 구현은 NFS4와 AIXC 두 ACL 종류를 지원합니다.
접근 검사의 권위 있는 출처는 NFS 서버가 내보낸 밑의 파일 시스템에 있습니다. 파일 시스템은 파일의 접근 제어(ACL이나 권한 비트), 호출자의 자격 증명, 적용될 수 있는 그 밖의 로컬 시스템 제한을 고려합니다. 응용 프로그램과 사용자는 UNIX 모드 비트나 ACL만 살펴서 접근을 확실히 예측할 수 있다고 가정하면 안 됩니다.
클라이언트에서 aclget, aclput, acledit 명령으로 NFS나 AIX ACL을 다룰 수 있습니다. 자세한 정보는 Security의 Access Control Lists를 봅니다.
영어 원문
NFS Access Control Lists support
The AIX NFS version 4 implementation supports two ACL types: NFS4 and AIXC.
The authoritative source for access checking lies in the underlying file system exported by the NFS server. The file system takes into consideration the file's access controls (ACLs or permission bits), the caller's credentials, and other local system restrictions that might apply. Applications and users should not assume that examination of UNIX mode bits or ACLs alone can be used to conclusively predict access.
The aclget, aclput, and acledit commands can be used on the client to manipulate either NFS or AIX ACLs. For more information, see Access Control Lists in Security.
NFS RBAC(6.1)
NFS는 RBAC(Role Based Access Control)를 지원합니다. NFS 클라이언트와 서버 명령은 RBAC를 지원합니다.
관리자가 명령의 RBAC 역할을 사용자에게 할당하면 root가 아닌 사용자도 NFS 명령을 실행할 수 있습니다. NFS 명령에 연결된 권한 문자열과 특권 목록은 시스템의 /etc/security/privcmds 파일을 봅니다.
영어 원문
NFS RBAC
NFS provides support to Role Based Access Control (RBAC). The NFS client and server commands are RBAC enabled.
This allows non-root users to execute NFS commands once the administrator assigns the RBAC role of the command to the user. To see the list of authorization strings and privileges associated with NFS commands, refer /etc/security/privcmds file on the system.
NFS4 ACL
NFS4 ACL은 NFS 버전 4 프로토콜이 정의한 ACL입니다.
NFS4 ACL은 플랫폼에 독립적이므로 다른 벤더의 클라이언트나 서버도 지원할 수 있습니다. NFS 버전 4 클라이언트와 서버가 NFS4 ACL을 반드시 지원해야 하는 것은 아닙니다.
AIX 서버에서 밑의 물리 파일 시스템 인스턴스가 NFS4 ACL을 지원하면 AIX NFS4 서버는 그 파일 시스템 인스턴스에 NFS4 ACL을 지원합니다. AIX의 물리 파일 시스템 종류 대부분은 NFS4 ACL을 지원하지 않습니다. 이런 파일 시스템 종류에는 CFS, UDF, JFS, 확장 속성 버전 1의 JFS2 등이 있습니다. 확장 속성 버전 2의 JFS2 인스턴스는 모두 NFS4 ACL을 지원합니다.
서버에서 내보낸 NFS 버전 4 파일 시스템 인스턴스가 NFS4 ACL을 지원하면 NFS 버전 4 클라이언트 파일 시스템은 NFS4 ACL을 읽고 쓸 수 있습니다.
영어 원문
NFS4 ACL
NFS4 ACL is the ACL defined by the NFS version 4 protocol.
NFS4 ACL is platform-independent, so it can be supported by other vendors' clients or servers. NFS version 4 clients and servers are not required to support NFS4 ACL.
In an AIX server, if an underlying physical file system instance supports NFS4 ACL, then the AIX NFS4 server supports NFS4 ACL for that file system instance. Most physical file systems types on AIX do not support NFS4 ACL. These file system types include but are not limited to CFS, UDF, JFS, and JFS2 with extended attribute version 1. All instances of JFS2 with extended attribute version 2 support NFS4 ACL.
NFS version 4 client file systems are able to read and write the NFS4 ACL if the exported NFS version 4 file system instance on the server supports NFS4 ACL.
AIX ACL
AIXC ACL은 AIX 서버 고유의 접근 제어 목록입니다.
NFS 버전 4 프로토콜에 정의되어 있지 않으며 AIX 서버와 클라이언트만 이해합니다.
NFS 버전 4 서버에서 밑의 파일 시스템 인스턴스가 AIXC ACL을 지원하면 AIXC ACL을 지원합니다. JFS와 JFS2 인스턴스는 모두 AIXC ACL을 지원합니다.
NFS 버전 4 클라이언트에는 AIX ACL 지원을 켜고 끄는 마운트 옵션이 있습니다. 기본은 AIXC ACL을 지원하지 않는 것입니다. NFS 버전 4 클라이언트 파일 시스템의 사용자가 AIXC ACL을 읽고 쓰려면 클라이언트와 서버가 모두 AIX를 실행하고, 서버의 밑의 물리 파일 시스템 인스턴스가 AIXC ACL을 지원하고, AIX 클라이언트가 AIXC ACL을 켜고 파일 시스템 인스턴스를 마운트해야 합니다. NFS 버전 4의 AIXC ACL 지원은 AIX NFS 버전 2와 버전 3 구현의 AIXC ACL 지원과 비슷합니다.
확장 속성 버전 2의 JFS2 파일 시스템 인스턴스는 모두 AIXC ACL과 NFS4 ACL을 모두 지원합니다. 이런 파일 시스템의 파일은 모드 비트만(ACL 없음), NFS4 ACL, AIXC ACL 가운데 하나를 가질 수 있습니다. 그러나 NFS4 ACL과 AIXC ACL을 동시에 가질 수는 없습니다.
aclgettypes 명령으로 파일 시스템 인스턴스에서 읽고 쓸 수 있는 ACL 종류를 알 수 있습니다. 이 명령은 NFS 버전 4 서버의 물리 파일 시스템에 로컬로 실행할 때와 NFS 버전 4 클라이언트에서 같은 파일 시스템에 실행할 때 출력이 다를 수 있습니다. 예를 들어 NFS 버전 4 서버의 NFS 버전 4 파일 시스템 인스턴스는 NFS4 ACL과 AIXC ACL을 지원하지만, 클라이언트는 NFS4 ACL만 주고받도록 구성되어 있을 수 있습니다. 이 경우 NFS 버전 4 클라이언트 파일 시스템에서 aclgettypes 명령을 실행하면 NFS4만 돌아옵니다. 또 클라이언트의 사용자가 AIXC ACL을 요청하면 오류가 돌아옵니다.
영어 원문
AIX ACL
The AIXC ACL is an access control list that is a proprietary of AIX servers.
It is not defined by the NFS version 4 protocol, and it is understood only by AIX servers and clients.
On an NFS version 4 server, AIXC ACL is supported when the underlying file system instance support AIXC ACL. All instances of JFS and JFS2 support the AIXC ACL.
An NFS version 4 client has a mount option that enables or disables support for AIX ACL. The default is to not support AIXC ACL. A user on an NFS version 4 client file system is able to read and write AIXC ACL when both the client and the server are running AIX, the underlying physical file system instance on the server supports AIXC ACL, and the AIX client mounts the file system instance with AIXC ACL enabled. AIXC ACL support in NFS version 4 is similar to the AIXC ACL support in AIX NFS version 2 and NFS version 3 implementations.
All instances of a JFS2 file system with extended attribute version 2 support both AIXC ACL and NFS4 ACL. A file in this type of file system may have mode bits only (no ACL), an NFS4 ACL, or an AIXC ACL. But, it cannot have NFS4 ACL and AIXC ACL at the same time.
The aclgettypes command can be used to determine the ACL types the can be read and written on a file system instance. This command may return different output when it runs against a physical file system on an NFS version 4 server locally than when it runs against the same file system on a NFS version 4 client. For example, a NFS version 4 file system instance on and NFS version 4 server may support NFS4
ACL and AIXC ACL, but the client is only configured to send and receive NFS4 ACL. In this case, when the aclgettypes command is executed from an NFS version 4 client file system, only NFS4 is returned. Also, if a user on the client requests an AIXC ACL, an error is returned.
CacheFS(Cache File System) 지원
CacheFS(Cache File System)는 서버와 네트워크 부하를 줄여 NFS 서버 성능과 확장성을 높이는 범용 파일 시스템 캐시 메커니즘입니다.
계층 파일 시스템으로 설계된 CacheFS는 한 파일 시스템을 다른 파일 시스템에 캐시할 수 있게 합니다. NFS 환경에서 CacheFS는 서버당 클라이언트 비율을 높이고, 서버와 네트워크 부하를 줄이며, PPP(Point-to-Point Protocol) 같은 느린 링크의 클라이언트 성능을 높입니다.
클라이언트 기계에 캐시를 만들어, 캐시에 마운트하도록 지정한 파일 시스템을 네트워크 너머 대신 로컬에서 접근할 수 있게 합니다. 파일은 사용자가 처음 접근을 요청할 때 캐시에 들어갑니다. 사용자가 파일 접근을 요청할 때까지 캐시는 채워지지 않습니다. 처음 파일 요청은 느려 보일 수 있지만 같은 파일을 다시 쓰면 빨라질 수 있습니다.
주:
/(root)나/usr파일 시스템은 캐시할 수 없습니다.- 공유된 파일 시스템만 마운트할 수 있습니다. (Commands Reference, Volume 2의 exportfs 명령을 봅니다.)
- 로컬 JFS(Journaled File System) 디스크 파일 시스템을 캐시해도 성능 이득이 없습니다.
- 다음 표의 작업을 하려면 root나 system 권한이 있어야 합니다.
표 91. CacheFS 작업
| 작업 | SMIT 빠른 경로 | 명령이나 파일 | Web-based System Manager |
|---|---|---|---|
| 캐시 설정 | cachefs_admin_create |
cfsadmin -c MountDirectoryName(주 1) |
Software → File Systems → Cached File Systems → New Cached File System |
| 마운트할 파일 지정 | cachefs_mount |
mount -F cachefs -o backfstype=FileSysType,cachedir=CacheDirectory[,options] BackFileSystem MountDirectoryName(주 2)이나 /etc/filesystems 편집 |
Software → File Systems → Overview and Tasks → Mount a File System |
| 캐시 수정 | cachefs_admin_change |
캐시를 지운 뒤 알맞은 mount 명령 옵션으로 다시 만듭니다. | Software → File Systems → Cached File Systems → Selected → Delete. 그런 다음 이 표 첫 행처럼 캐시를 설정합니다. |
| 캐시 정보 표시 | cachefs_admin_change |
cfsadmin -l MountDirectoryName |
Software → File Systems → Cached File Systems → Selected → Properties |
| 캐시 제거 | cachefs_admin_remove |
1. 파일 시스템 마운트 해제: umount MountDirectoryName 2. 캐시 ID 확인: cfsadmin -l MountDirectoryName 3. 파일 시스템 삭제: cfsadmin -d CacheID CacheDirectory |
Software → File Systems → Cached File Systems → Selected → Delete |
| 파일 시스템 무결성 검사 | cachefs_admin_check |
fsck_cachefs CacheDirectory(주 3) |
Software → File Systems → Cached File Systems → Selected → Check integrity of Cache |
주:
- 캐시를 만든 뒤에는 캐시 디렉터리(
cachedir) 자체 안에서 아무 작업도 하지 않습니다. CacheFS 소프트웨어 안에 충돌이 생깁니다. - mount 명령 옵션으로 마운트할 파일을 지정하면 시스템을 다시 시작할 때마다 명령을 다시 실행해야 합니다.
- 수리하지 않고 파일 시스템을 검사하려면
fsck_cachefs명령의-m이나-o옵션을 씁니다. - (6.1) 이전 AIX 버전에서 AIX Version 6.1 이후로 시스템을 이전한 뒤에는 이전 버전 AIX에서 만든 옛 캐시 파일 시스템을 지우고 다시 만들어야 합니다.
영어 원문
Cache File System support
The Cache File System (CacheFS) is a general-purpose file system caching mechanism that improves NFS server performance and scalability by reducing server and network load.
Designed as a layered file system, CacheFS provides the ability to cache one file system on another. In an NFS environment, CacheFS increases the client-per-server ratio, reduces server and network loads and improves performance for clients on slow links, such as Point-to-Point Protocol (PPP).
A cache is created on the client machine so file systems specified to be mounted in the cache can be accessed locally instead of across the network. Files are placed in the cache when a user first requests access to them. The cache does not get filled until the user requests access to a file or files. Initial file requests may seem slow, but subsequent uses of the same files may be faster.
Note
You cannot cache the
/(root) or/usrfile systems.You can mount only file systems that are shared. (See the exportfs command in Commands Reference, Volume 2.)
There is no performance gain in caching a local Journaled File System (JFS) disk file system.
You must have root or system authority to do the tasks in the following table.
Table 91. CacheFS tasks
| Task | SMIT fast path | Command or file |
|---|---|---|
| Web-based System Manager Management Environment | ||
| Set up a cache | cachefs_admin_create |
cfsadmin -c MountDirectoryName1. Software —> File Systems —> Cached File Systems —> New Cached File System |
| Specifying Files for | ||
| Mounting | cachefs_mount |
mount -F cachefs -o backfstype=FileSysType, cachedir=CacheDirectory[,options] BackFileSystem MountDirectoryName2 or edit /etc/filesystems. Software —> File Systems —> Overview and Tasks —> Mount a File System. |
| Modify the Cache | cachefs_admin_change |
remove the cache, then recreate it using appropriate mount command options. Software —> File Systems —> Cached File Systems —> Selected —> Delete. Proceed by setting up a cache as previously shown in the first row of this table. |
| Display Cache | ||
| Information | cachefs_admin_change |
cfsadmin -l MountDirectoryName. Software —> File Systems —> Cached File Systems —> Selected —> Properties. |
| Remove a Cache | cachefs_admin_remove |
1. Unmount the file system: umount MountDirectoryName 2. Determine the cache ID: cfsadmin -l MountDirectoryName 3. Delete the file system: cfsadmin -d CacheID CacheDirectory Software —> File Systems —> Cached File Systems —> Selected —> Delete. |
Check File System Integrity cachefs_admin_check fsck_cachefsCacheDirectory3. Software —> File Systems —> Cached File Systems —> Selected —> Check integrity of Cache.
Notes
After you have created the cache, do not perform any operations within the cache directory (
cachedir) itself. This causes conflicts within the CacheFS software.If you use the mount command option to specify files for mounting, the command must be reissued each time the system is restarted.
Use the
-mor-ooptions of thefsck_cachefscommand to check the file systems without making any repairs.After migrating the system to AIX Version 6.1 or later from previous versions of AIX, old cache file systems that are created in the older version of AIX must be removed and recreated.
NFS 매핑 파일 지원
NFS 매핑 파일 지원은 클라이언트의 프로그램이 파일을 메모리에 있는 것처럼 접근하게 합니다.
shmat 서브루틴으로 사용자는 파일 영역을 자기 주소 공간에 매핑할 수 있습니다. 프로그램이 이 메모리 영역을 읽고 쓰면 필요에 따라 서버에서 파일을 메모리로 읽어 오거나 서버의 파일을 갱신합니다.
NFS로 파일을 매핑하는 데는 세 가지 제한이 있습니다.
- 파일이 클라이언트 사이에 정보를 잘 나누지 못합니다.
- 한 클라이언트에서 매핑 파일로 바꾼 내용이 다른 클라이언트에 보이지 않습니다.
- 파일 영역을 잠그고 푸는 것은 클라이언트 사이에 데이터를 조율하는 효과적인 방법이 아닙니다.
서로 다른 클라이언트의 프로그램 사이에 데이터를 나누는 데 NFS 파일을 쓰려면 레코드 잠금과 보통의 read·write 서브루틴을 씁니다.
같은 클라이언트의 여러 프로그램은 매핑 파일로 데이터를 효과적으로 나눌 수 있습니다. 파일 전체를 잠근다면 권고(advisory) 레코드 잠금으로 클라이언트에서 파일 갱신을 조율할 수 있습니다. 여러 클라이언트는 정적 데이터베이스처럼 데이터가 결코 바뀌지 않을 때만 매핑 파일로 데이터를 나눌 수 있습니다.
영어 원문
NFS mapped file support
NFS mapped file support allows programs on a client to access a file as though it were in memory.
By using the shmat subroutine, users can map areas of a file into their address space. As a program reads and writes into this region of memory, the file is read into memory from the server or updated as needed on the server.
Mapping files over NFS is limited in three ways:
Files do not share information well between clients.
Changes to a file on one client using a mapped file are not seen on another client.
Locking and unlocking regions of a file is not an effective way to coordinate data between clients.
If an NFS file is to be used for data sharing between programs on different clients, use record locking and the regular read and write subroutines.
Multiple programs on the same client can share data effectively using a mapped file. Advisory record locking can coordinate updates to the file on the client, provided that the entire file is locked. Multiple clients can share data-using mapped files only if the data never changes, as in a static database.
NFS 프록시 서빙
AIX는 NFS 프록시 서빙을 지원합니다. AIX 서버는 로컬에서 접근할 수 있는 파일 시스템과 프록시 내보내기를 동시에 내보낼 수 있습니다. 내보낸 프록시 뷰는 NFS 클라이언트가 마운트할 수 있습니다.
AIX NFS 프록시 서빙은 접근한 데이터를 디스크에 캐시해, 비슷한 다음 요청을 로컬에서 처리하고 백엔드 서버로 가는 네트워크 트래픽을 줄입니다. 프록시 서빙은 더 느리거나 덜 안정적인 네트워크 너머로 NFS 데이터 접근을 넓히면서 성능을 높이고, 데이터가 있는 주 서버로 가는 네트워크 트래픽을 줄일 수 있습니다. 가용성과 콘텐츠 관리 요구에 따라 프록시 서빙은 데이터를 복사하지 않고 네트워크 끝까지 NFS 접근을 넓히는 방법이 될 수 있습니다. AIX NFS 프록시 서빙은 mknfsproxy 명령으로 구성합니다.
프록시 캐시는 NFS v3와 NFS v4 프로토콜 모두에 쓸 수 있습니다. (6.1) 프록시와 백엔드 서버 사이에 NFS v4 프로토콜을 쓰면 프록시와 연결된 클라이언트 사이의 프로토콜은 NFS v3나 NFS v4일 수 있습니다. 그러나 NFS v3 프로토콜을 쓰면 프록시와 연결된 클라이언트 사이의 프로토콜도 NFS v3여야 합니다. 데이터 읽기와 쓰기, 바이트 범위 권고 잠금을 지원합니다. (5.3판은 "프록시와 클라이언트 사이의 프로토콜은 내보낸 인스턴스마다 프록시와 백엔드 서버 사이의 프로토콜과 같아야 한다"고 적었습니다.)
krb5, krb5i, krb5p 보안 방식은 프록시 서버와 연결된 클라이언트 사이에 쓸 수 있습니다. (6.1) 이 방식은 프록시 서버와 주 서버 사이에도 쓸 수 있습니다. 프록시를 거치는 티켓 전달 기술로 클라이언트에서 인증하고 주 서버에 인증될 수 있습니다. 이 기술을 쓰려면 Kerberos 인증을 할 때 kinit 명령에 -f 옵션을 씁니다. 프록시와 백엔드 서버 사이에 auth_sys 보안을 쓰면, 백엔드 서버에 접근할 때 프록시 서버가 Kerberos 클라이언트 접근을 auth_sys 속성으로 매핑합니다. 가장 좋은 결과를 얻으려면 프록시 서버와 백엔드 서버가 같은 사용자와 그룹 ID 정의를 나눠 써야 합니다.
NFS 프록시 서빙에는 다음 제한이 있습니다.
- 프록시 서빙에는 TCP를 쓰는 연결된 클라이언트가 필요합니다.
- (6.1) 프록시 서빙은 NFS v3 클라이언트가 mount와 unmount 명령 없이 NFS v4 내보내기 이름 공간을 둘러볼 수 있게 하므로, 프록시 파일 시스템을 만들 때 mfsid 옵션과 함께 mknfsproxy 명령을 써야 합니다.
- 프록시 서빙에 쓰는 캐시 파일 시스템은 Enhanced JFS 파일 시스템(JFS2)이어야 합니다.
- 프록시 서빙은 백엔드 NFS 서버에 마운트된 AIX 클라이언트 위에서 CacheFS를 실행합니다. AIX NFS 클라이언트에서 쓸 수 있는 동시 I/O(CIO) 기능이 CacheFS 성능을 높입니다. 밑의 NFS 클라이언트 마운트에 직접 접근하려 하면 CIO의 open 시도와 충돌해 실패할 수 있습니다.
(5.3판은 제한에 "AIX 64비트 커널 환경이 필요하다"를 넣었습니다.)
영어 원문
NFS proxy serving
AIX supports Network File System (NFS) proxy serving. An AIX server can concurrently export locally accessible file systems and proxy exports. The exported proxy view can be mounted by NFS clients.
AIX NFS proxy serving uses disk caching of accessed data to serve similar subsequent requests locally with reduced network traffic to the back-end server. Proxy serving can potentially extend NFS data access over slower or less reliable networks with improved performance and reduced network traffic to the primary server where the data resides. Depending on availability and content management requirements, proxy serving can provide a solution for extending NFS access to network edges without the need for copying data. You can configure AIX NFS proxy serving using the mknfsproxy command.
Proxy caching can be used with both the NFS v3 and the NFS v4 protocols. The protocol between the proxy and the connected clients can be either NFS v3 or NFS v4 when the NFS v4 protocol is used between the proxy and the back-end server. However, when the NFS v3 protocol is used, the protocol between the proxy and the connected clients must be the NFS v3 protocol. Both reads and writes of data are supported in addition to byte range advisory locks.
The krb5, krb5i, and krb5p security methods can be used between the proxy server and its connected clients. These methods can also be used between the proxy server and the main server. Using ticket forwarding technology through proxy, you can authenticate on the client and be authenticated to the main server. To take advantage of this technology, use the kinit command with the -f option when you are performing Kerberos authentication. If auth_sys security is used between the proxy and the back-end server, when you access the back-end server, the proxy server maps Kerberos client accesses into auth_sys attributes. For best results, the proxy server and the back-end server should share the same user and group identity definitions.
The following restrictions apply to NFS proxy serving:
Proxy serving requires connected clients using TCP.
Because proxy serving provides a way for NFS v3 clients to browse through the NFS v4 exported namespace without using the mount and unmount commands, you must use the mknfsproxy command with the mfsid option when you are constructing the proxy file system.
The cache file system used with proxy serving must be an Enhanced JFS file system (JFS2).
Proxy serving runs CacheFS on top of an AIX client mounted to the back-end NFS server. The concurrent I/O (CIO) feature, available with the AIX NFS client, enhances CacheFS performance. Attempts to directly access the underlying NFS client mount might fail because of conflicts with open attempts of CIO.
NFS 마운트 종류
NFS 마운트에는 미리 정의한 마운트, 명시 마운트, 자동 마운트 세 종류가 있습니다.
미리 정의한 마운트는 /etc/filesystems 파일에 지정합니다. 이 파일의 각 스탠자(항목)가 마운트의 특성을 정의합니다. 호스트 이름, 원격 경로, 로컬 경로, 마운트 옵션 같은 데이터가 이 스탠자에 나열됩니다. 미리 정의한 마운트는 클라이언트가 제대로 동작하려면 늘 필요한 마운트에 씁니다.
명시 마운트는 root 사용자의 필요를 채웁니다. 가끔 계획에 없는 마운트가 필요할 때 보통 짧은 기간 동안 합니다. 특수 작업에 마운트가 필요하고 그 마운트를 NFS 클라이언트에서 일반적으로 쓸 수 없을 때도 쓸 수 있습니다. 이 마운트는 보통 명령행에서 필요한 정보를 모두 넣어 mount 명령으로 합니다. 명시 마운트는 /etc/filesystems 파일을 갱신할 필요가 없습니다. 명시적으로 마운트한 파일 시스템은 umount 명령으로 명시적으로 마운트 해제하거나 시스템을 다시 시작할 때까지 마운트된 채로 있습니다.
자동 마운트는 automount 명령으로 제어하며, 이 명령은 AutoFS 커널 확장이 지정한 디렉터리의 활동을 감시하게 합니다. 프로그램이나 사용자가 지금 마운트되지 않은 디렉터리에 접근하려 하면 AutoFS가 요청을 가로채 파일 시스템의 마운트를 준비한 뒤 요청을 처리합니다.
영어 원문
Types of NFS mounts
There are three types of NFS mounts: predefined, explicit, and automatic.
Predefined mounts are specified in the /etc/filesystems file. Each stanza (or entry) in this file defines the characteristics of a mount. Data such as the host name, remote path, local path, and any mount options are listed in this stanza. Predefined mounts are used when certain mounts are always required for proper operation of a client.
Explicit mounts serve the needs of the root user. Explicit mounts are usually done for short periods of time when there is a requirement for occasional unplanned mounts. Explicit mounts can also be used if a mount is required for special tasks and that mount is not generally available on the NFS client. These mounts are usually fully qualified on the command line by using the mount command with all needed information. Explicit mounts do not require updating the /etc/filesystems file. File systems mounted explicitly remain mounted unless explicitly unmounted with the umount command or until the system is restarted.
Automatic mounts are controlled by the automount command, which causes the AutoFS kernel extension to monitor specified directories for activity. If a program or user attempts to access a directory that is not currently mounted, then AutoFS intercepts the request, arranges for the mount of the file system, then services the request.
NFS 내보내기와 마운트
NFS를 관리하려면 디렉터리를 내보내고 마운트하는 것을 이해해야 합니다.
NFS 서버가 파일이나 디렉터리를 내보내야, 그 뒤 NFS 클라이언트가 그 파일이나 디렉터리를 마운트할 수 있습니다. 이 개념에 관한 자세한 내용은 이 절에 있습니다.
영어 원문
NFS exporting and mounting
Exporting and mounting directories must be understood in order to administer NFS.
An NFS server must export a file or directory, after which an NFS client may mount that file or directory. More details about these concepts are included in this section.
NFS 디렉터리 내보내기
디렉터리 내보내기는 NFS 서버에서 합니다. 디렉터리를 내보낸다는 것은 서버 이름 공간의 디렉터리를 클라이언트 기계가 쓸 수 있다고 선언하는 것입니다.
내보낸 디렉터리를 export라고 하며, 내보낸 디렉터리의 파일 시스템에 있는, 그 디렉터리 아래의 모든 파일을 포함합니다.
각 export는 접근 제한도 정의합니다. 예를 들어 다음 제한을 정의할 수 있습니다.
- 어떤 클라이언트가 내보낸 디렉터리에 접근할 수 있는지
- 클라이언트가 디렉터리에 접근하려면 어떤 NFS 버전을 써야 하는지
- 클라이언트가 export에 파일을 쓸 수 있는지
- 클라이언트가 export의 디렉터리와 파일에 접근하려면 어떤 보안 방식을 써야 하는지
허용되는 export 제한과 export 의미의 전체 설명은 Commands Reference, Volume 2의 exportfs 명령 설명과 Files Reference의 /etc/exports 파일 설명을 봅니다.
참고: export의 속성을 바꾸면 변경이 적용되도록 디렉터리를 다시 내보내야 합니다. 다른 파일이 바뀌거나 서버 밖의 변화 때문에 디렉터리를 다시 내보내야 할 수도 있습니다. 예를 들어 접근 목록에 지정한 클라이언트 이름이 /etc/netgroup 파일에 정의된 netgroup이고 그 클라이언트 그룹의 정의가 바뀌면, 접근 목록에 그 netgroup을 쓰는 모든 export를 다시 내보내야 변경이 적용됩니다.
마찬가지로 클라이언트의 IP 주소가 바뀌면 접근 목록에 그 클라이언트를 지정한 모든 export를 다시 내보내야 합니다. NFS 서버가 각 export에 대해 클라이언트 접근 권한의 캐시를 유지하기 때문입니다. 캐시는 내보내기를 취소하거나 다시 내보낼 때마다 비워집니다. export의 접근 권한이 바뀌면, 특히 클라이언트의 IP 주소가 바뀌거나 클라이언트가 접근 목록에서 빠지면, 클라이언트의 접근이 캐시에 올바르게 반영되도록 내보내기를 취소하거나 다시 내보내야 합니다. NFS 서버는 각 클라이언트의 접근 권한을 얻으려고 rpc.mountd 데몬을 부르므로, 서버가 NFS 버전 4 접근용으로만 파일 시스템을 내보내더라도 서버에서 rpc.mountd 데몬이 실행 중이어야 합니다.
영어 원문
NFS directory exports
Exporting a directory is done on the NFS server. Exporting a directory declares that a directory in the server's namespace is available to client machines.
The exported directory is referred to as an export, and it includes all files under the directory that reside on the exported directory's file system.
Each export also defines access restrictions. For example, the following restrictions may be defined:
which clients may access the exported directory
which NFS versions the client must use to access the directory
whether the client can write files in the export
what security methods the client must use to access directories and files in the export
For a full description of allowable export restrictions and export semantics, see the exportfs command description in Commands Reference, Volume 2 and the /etc/exports file description in Files Reference.
Note: When an export's attributes are changed, the directory must be re-exported in order for the change to take effect. A directory might need to be re-exported because of changes to other files or changes external to the server. For instance, if a client name specified in an access list is a netgroup defined in the /etc/netgroup file, and the definition of the client group is changed, all exports that use that netgroup in an access list must be re-exported for the change to take effect.
Similarly, if a client's IP address is changed, all exports that specify that client in an access list must be re-exported. The reason for this is because the NFS server maintains a cache of client access rights on each export. The cache is flushed on each unexport or re-export. If the access rights of an export are modified, particularly if the IP address of a client changes or if a client is removed from the access list, an unexport or re-export must be done so the client's access is correctly reflected in the cache. The NFS server calls the rpc.mountd daemon to get the access rights of each client, so the rpc.mountd daemon must be running on the server even if the server only exports file systems for NFS version 4 access.
NFS 디렉터리 마운트
NFS 클라이언트는 NFS 서버가 내보낸 디렉터리를 마운트할 수 있습니다. 디렉터리를 마운트하면 NFS 서버에 있는 파일을 NFS 클라이언트가 쓸 수 있습니다.
서버가 파일을 내보냈고 export 제한이 클라이언트에 export의 파일 접근을 허용하면, 클라이언트는 서버의 파일에 접근할 수 있습니다. 클라이언트가 서버의 export를 자기 이름 공간의 마운트 지점에 성공적으로 마운트하면, 그 export의 서버 파일이 클라이언트의 이름 공간에 있게 되고 로컬 파일 시스템의 파일처럼 보입니다.
예를 들어 서버 diamond의 /tmp 디렉터리를 내보내 클라이언트 clip에 /mnt 디렉터리로 마운트하려 한다고 합니다. 서버에서 다음 명령을 입력합니다.
exportfs -i -o access=clip /tmp
이렇게 하면 클라이언트가 /tmp 디렉터리를 쓸 수 있습니다.
클라이언트에서 다음 명령을 입력합니다.
mount diamond:/tmp /mnt
이제 서버의 /tmp 디렉터리에 있는 디렉터리와 파일이 클라이언트의 /mnt 디렉터리에 보입니다.
주:
- 마운트 처리 방식은 NFS 버전 2·3과 NFS 버전 4 사이에 몇 가지 차이가 있습니다. NFS 버전 2와 3에서는 서버가 마운트에 쓸 수 있게 하려는 디렉터리를 내보냈습니다. 그러면 NFS 버전 2나 3 클라이언트는 접근하려는 각 export를 명시적으로 마운트해야 했습니다. NFS 버전 4에서도 서버는 NFS 접근용으로 내보낼 각 서버 디렉터리나 파일 시스템에 대해 export 제어를 지정합니다. 서버는 이 export 제어로부터, 내보낸 디렉터리 사이의 빈틈을 채워 내보낸 모든 데이터의 단일 디렉터리 트리를 만듭니다. 이 트리를 pseudo 파일 시스템이라고 하며 NFS 버전 4 서버의 pseudo root에서 시작합니다. NFS 버전 4 pseudo 파일 시스템 모델에서는 NFS 버전 4 클라이언트가 구현에 따라 서버의 pseudo root를 한 번 마운트해 서버가 내보낸 모든 데이터에 접근할 수 있습니다. AIX NFS 클라이언트는 이 기능을 지원합니다. 클라이언트에 실제로 보이는 내용은 서버의 export 제어에 따라 다릅니다.
- NFS 버전 4는 파일 대 파일 마운트를 허용하지 않습니다.
영어 원문
NFS directory mounts
An NFS client can mount a directory that has been exported by an NFS server. Mounting a directory makes the files that reside on the NFS server available to an NFS client.
A client can access files on a server if the files were exported by the server and the export restrictions allow the client to have access to the export's files. Once a client has successfully mounted a server's export onto a mount point in its namespace, the server's files for that export will exist in the client's namespace and appear as files on the local file system.
For example, assume you want to export the /tmp directory on server diamond and mount that directory on client clip as the /mnt directory. On the server, type the following command:
exportfs -i -o access=clip /tmp
This makes the /tmp directory available to the client.
On the client, type the following command:
mount diamond:/tmp /mnt
The directories and files in the server's /tmp directory will now appear in the client's /mnt directory.
Note
There are some differences between NFS versions 2 and 3 and NFS version 4 in how mounts are handled. In NFS versions 2 and 3, the server exported the directories it wanted to make available for mounting. The NFS version 2 or 3 client then had to explicitly mount each export to which it wanted access. With NFS version 4, the server still specifies export controls for each server directory or file system to be exported for NFS access. From these export controls, the server renders a single directory tree of all the exported data filling in gaps between the exported directories. This tree is known as a pseudo file system and it starts at the NFS version 4 server's pseudo root. The NFS version 4 pseudo file system model allows an NFS version 4 client, depending on its implementation, to perform a single mount of the server's pseudo root in order to access all the server's exported data. The AIX NFS client supports this feature. The actual content seen by the client is dependent on the server's export controls.
NFS version 4 does not allow file-to-file mounting.
NFS 마운트 과정
클라이언트는 먼저 서버가 내보낸 디렉터리를 마운트해 서버의 파일에 접근합니다. 클라이언트가 디렉터리를 마운트해도 그 디렉터리의 사본을 만들지 않습니다. 마운트 과정은 일련의 원격 프로시저 호출로 클라이언트가 서버의 디렉터리에 투명하게 접근하게 합니다.
마운트 과정은 다음과 같습니다.
- 서버가 시작할 때
/etc/rc.nfs스크립트가 exportfs 명령을 실행하며, 이 명령은 서버의/etc/exports파일을 읽고 어떤 디렉터리를 내보낼지와 어떤 접근 제한이 필요한지 커널에 알립니다. - 그다음
/etc/rc.nfs스크립트가 rpc.mountd 데몬과 여러 nfsd 데몬을 시작합니다. - 그런 다음
/etc/rc.nfs스크립트가 mount 명령을 실행하며, 이 명령은/etc/filesystems파일에 나열된 파일 시스템을 읽습니다. - mount 명령은 클라이언트가 원하는 정보를 내보내는 서버 하나 이상을 찾아 자기와 그 서버 사이에 통신을 설정합니다. 이 과정을 바인딩이라고 합니다.
- 그런 다음 mount 명령은 서버 하나 이상에 클라이언트가 클라이언트
/etc/filesystems파일에 있는 디렉터리에 접근하도록 허용해 달라고 요청합니다. - 서버 데몬은 클라이언트의 마운트 요청을 받아 허락하거나 거부합니다. 요청한 디렉터리를 그 클라이언트가 쓸 수 있으면 서버 데몬은 클라이언트 커널에 파일 핸들이라는 식별자를 보냅니다.
- 그러면 클라이언트 커널은 마운트 레코드에 특정 정보를 기록해 파일 핸들을 마운트 지점(디렉터리)에 묶습니다.
NFS 버전 4 마운트 처리에서는 클라이언트가 rpc.mountd 데몬과 통신하지 않습니다. 클라이언트 쪽 마운트 작업은 핵심 NFS 버전 4 프로토콜의 작업으로 처리합니다. NFS 버전 4 서버 구현은 NFS 버전 4 접근을 처리하는 일부로 rpc.mountd 데몬의 지원을 씁니다.
영어 원문
Mounting NFS
Clients access files on the server by first mounting server exported directories. When a client mounts a directory, it does not make a copy of that directory. Rather, the mounting process uses a series of remote procedure calls to enable a client to transparently access the directories on the server.
The following describes the mounting process:
When the server starts, the
/etc/rc.nfsscript runs the exportfs command, which reads the server/etc/exportsfile, and then tells the kernel which directories are to be exported and what access restrictions they require.The rpc.mountd daemon and several nfsd daemons are then started by the
/etc/rc.nfsscript.Then the
/etc/rc.nfsscript executes the mount command, which reads the file systems listed in the/etc/filesystemsfile.The mount command locates one or more servers that export the information the client wants and sets up communication between itself and that server. This process is called binding.
The mount command then requests that one or more servers allow the client to access the directories in the client
/etc/filesystemsfile.The server daemon receives the client mount requests and either grants or denies them. If the requested directory is available to that client, the server daemon sends the client kernel an identifier called a file handle.
The client kernel then ties the file handle to the mount point (a directory) by recording certain information in a mount record.
Client communication with the rpc.mountd daemon does not occur with NFS version 4 mount processing. Operations in the core NFS version 4 protocol are used to service client side mount operations. The NFS version 4 server implementation does utilize support in the rpc.mountd daemon as part of handling NFS version 4 access.
/etc/exports 파일
/etc/exports 파일은 서버가 클라이언트에 내보내는 모든 디렉터리를 나타냅니다.
파일의 각 줄은 디렉터리 하나를 지정합니다. 한 디렉터리를 /etc/exports 파일에 두 번, 곧 NFS 버전 2나 3용으로 한 번, NFS 버전 4용으로 한 번 지정할 수 있습니다. 서버는 NFS 서버가 시작할 때마다 나열된 디렉터리를 자동으로 내보냅니다. 그러면 클라이언트가 이 디렉터리를 마운트할 수 있습니다. /etc/exports 파일의 줄 구문은 다음과 같습니다.
directory - option [, option ]
directory는 디렉터리의 전체 경로 이름입니다. 옵션은 ro 같은 단순한 플래그나 호스트 이름 목록을 지정할 수 있습니다. 옵션과 그 설명의 전체 목록은 Files Reference의 /etc/exports 파일 문서와 Commands Reference, Volume 2의 exportfs 명령을 봅니다. /etc/exports 파일이 없으면 /etc/rc.nfs 스크립트는 nfsd 데몬이나 rpc.mountd 데몬을 시작하지 않습니다.
다음 예는 /etc/exports 파일의 항목입니다.
/usr/games -ro,access=ballet:jazz:tap
/home -root=ballet,access=ballet
/var/tmp
/usr/lib -access=clients
/accounts/database -vers=4,sec=krb5,access=accmachines,root=accmachine1
/tmp -vers=3,ro
/tmp -vers=4,sec=krb5,access=accmachines,root=accmachine1
이 예의 첫째 항목은 ballet, jazz, tap이라는 시스템이 /usr/games 디렉터리를 마운트할 수 있다고 지정합니다. 이 시스템들은 디렉터리에서 데이터를 읽고 프로그램을 실행할 수 있지만 디렉터리에 쓸 수는 없습니다.
둘째 항목은 시스템 ballet이 /home 디렉터리를 마운트할 수 있고 그 디렉터리에 root 접근이 허용된다고 지정합니다.
셋째 항목은 어떤 클라이언트든 /var/tmp 디렉터리를 마운트할 수 있다고 지정합니다. (접근 목록이 없다는 점에 주목합니다.)
넷째 항목은 netgroup clients로 지정한 접근 목록을 지정합니다. 곧 netgroup clients에 속하도록 지정된 기계들이 이 서버에서 /usr/lib 디렉터리를 마운트할 수 있습니다. (netgroup은 보안이나 조직상의 목적으로 특정 네트워크 자원에 접근이 허용된 네트워크 전체 그룹입니다. netgroup은 NIS나 NIS+로 제어합니다. 자세한 정보는 Network Information Services (NIS and NIS+) Guide를 봅니다.)
다섯째 항목은 NFS 버전 4 프로토콜을 쓰고 Kerberos 5 인증으로 디렉터리에 접근하는 accmachines netgroup의 클라이언트에만 /accounts/database 디렉터리 접근을 허용합니다. root 접근은 accmachine1에서만 허용합니다.
여섯째와 일곱째 항목은 /tmp 디렉터리를 서로 다른 버전과 옵션으로 내보냅니다. /etc/exports 파일에 같은 디렉터리의 NFS 버전이 다른 항목이 둘 있으면 exportfs 명령은 둘 다 내보냅니다. 디렉터리의 옵션이 NFS 버전 4와 NFS 버전 3에서 같으면 /etc/exports 파일에 -vers=3:4를 지정한 항목 하나만 둘 수 있습니다.
영어 원문
/etc/exports file
The /etc/exports file indicates all directories that a server exports to its clients.
Each line in the file specifies a single directory. A directory can be specified twice in the /etc/exports file: once for NFS version 2 or NFS version 3, and once for NFS version 4. The server automatically exports the listed directories each time the NFS server is started. These exported directories can then be mounted by clients. The syntax of a line in the /etc/exports file is:
directory - option [, option ]
The directory is the full path name of the directory. Options can designate a simple flag such as ro or a list of host names. See the specific documentation of the /etc/exports file in Files Reference and the exportfs command in Commands Reference, Volume 2 for a complete list of options and their descriptions. The /etc/rc.nfs script does not start the nfsd daemons or the rpc.mountd daemon if the /etc/exports file does not exist.
The following example illustrates entries from an /etc/exports file:
/usr/games -ro,access=ballet:jazz:tap
/home -root=ballet,access=ballet
/var/tmp
/usr/lib -access=clients
/accounts/database -vers=4,sec=krb5,access=accmachines,root=accmachine1
/tmp -vers=3,ro
/tmp -vers=4,sec=krb5,access=accmachines,root=accmachine1
The first entry in this example specifies that the /usr/games directory can be mounted by the systems named ballet, jazz, and tap. These systems can read data and run programs from the directory, but they cannot write in the directory.
The second entry in this example specifies that the /home directory can be mounted by the system ballet and that root access is allowed for the directory.
The third entry in this example specifies that any client can mount the /var/tmp directory. (Notice the absence of an access list.)
The fourth entry in this example specifies an access list designated by the netgroup clients. In other words, these machines designated as belonging to the netgroup clients can mount the /usr/lib directory from this server. (A netgroup is a network-wide group allowed access to certain network resources for security or organizational purposes. Netgroups are controlled by using NIS or NIS+. For more information, see Network Information Services (NIS and NIS+) Guide.)
The fifth entry allows access to the directory /accounts/database only to clients in the accmachines netgroup using NFS version 4 protocol and accessing the directory using Kerberos 5 authentication. Root access is allowed only from accmachine1.
The sixth and the seventh entries export the /tmp directory using different versions and options. If two entries for the same directory with different NFS versions exist in the /etc/exports file, the exportfs command will export both. If a directory has the same options for NFS version 4 and NFS version 3, you can have one entry in the /etc/exports file specifying -vers=3:4.
/etc/xtab 파일
/etc/xtab 파일은 /etc/exports 파일과 비슷한 형식이며 지금 내보낸 디렉터리를 나열합니다.
exportfs 명령을 실행할 때마다 /etc/xtab 파일이 바뀝니다. 그래서 /etc/exports 파일을 바꾸지 않고 디렉터리를 임시로 내보낼 수 있습니다. 임시로 내보낸 디렉터리의 내보내기를 취소하면 그 디렉터리는 /etc/xtab 파일에서 빠집니다.
참고: /etc/xtab 파일은 자동으로 갱신되며 편집하지 않습니다.
영어 원문
/etc/xtab file
The /etc/xtab file has a format similar to the /etc/exports file and lists the currently exported directories.
Whenever the exportfs command is run, the /etc/xtab file changes. This allows you to export a directory temporarily without having to change the /etc/exports file. If the temporarily exported directory is unexported, the directory is removed from the /etc/xtab file.
Note: The /etc/xtab file is updated automatically, and is not to be edited.
/etc/nfs/hostkey 파일
NFS 서버가 Kerberos 호스트 주체와 keytab 파일 위치를 지정하는 데 쓰는 파일입니다.
이 파일을 구성하고 관리하는 방법은 Commands Reference, Volume 4의 nfshostkey 명령 설명을 봅니다.
영어 원문
/etc/nfs/hostkey file
This file is used by the NFS server to specify the Kerberos host principal and the location of the keytab file.
For instructions on how to configure and administer this file, see the nfshostkey command description in Commands Reference, Volume 4.
/etc/nfs/local_domain 파일
시스템의 로컬 NFS 도메인이 들어 있는 파일입니다.
같은 NFS 로컬 도메인을 나눠 쓰는 시스템은 같은 사용자와 그룹 레지스트리도 나눠 쓴다고 봅니다. 이 파일을 구성하고 관리하는 방법은 Commands Reference, Volume 1의 chnfsdom 명령 설명을 봅니다.
영어 원문
/etc/nfs/local_domain file
This file contains the local NFS domain of the system.
It is implied that systems that share the same NFS local domain also share the same user and group registries. For instructions on how to configure and administer this file, see the chnfsdom command description in Commands Reference, Volume 1.
/etc/nfs/realm.map 파일
NFS 레지스트리 데몬이 name@kerberos-realm 형식으로 들어오는 Kerberos 주체를 name@nfs-domain 형식으로 매핑하는 데 쓰는 파일입니다.
그런 다음 name@nfs-domain을 로컬 UNIX 자격 증명으로 풀 수 있습니다. 이 파일은 Kerberos 주체를 서버의 사용자 레지스트리로 매핑하는 간단한 방법을 제공합니다. 서로 다른 Kerberos realm의 클라이언트가 서버에 접근하지만 사용자 이름 공간은 전역일 때 알맞습니다. 파일에는 서버가 지원하는 모든 Kerberos realm에 대해 다음 형식의 줄이 있어야 합니다.
realm1 nfs-domain
realm2 nfs-domain
Kerberos realm 이름이 언제나 서버의 NFS 도메인과 같으면 이 파일은 필요 없습니다. userA@kerberos-realm을 userB@nfs-domain으로 매핑하는 더 일반적인 기능이 필요하면 EIM(Enterprise Identity Mapping) 서비스를 씁니다. 추가 정보는 Identity mapping을 봅니다.
이 파일의 항목을 더하고, 고치고, 지우려면 chnfsrtd 명령을 씁니다. 자세한 내용은 Commands Reference, Volume 1의 chnfsrtd 명령 설명을 봅니다.
영어 원문
/etc/nfs/realm.map file
This file is used by the NFS registry daemon to map incoming Kerberos principals of the form name@kerberos-realm to the form name@nfs-domain.
It then can resolve the name@nfs-domain to a local UNIX credential. This file provides a simple way to map Kerberos principals into the server's user registry. It is appropriate when clients in different Kerberos realms will be accessing the server, but the user namespace is global. The file should contain lines in the following format:
realm1 nfs-domain
realm2 nfs-domain
for all Kerberos realms the server supports. If the Kerberos realm name is always the same as the server's NFS domain, this file is not needed. If you need the more general capability of mapping userA@kerberos-realm to userB@nfs-domain, use the Enterprise Identity Mapping (EIM) service. For additional information, see Identity mapping.
To add, edit, or remove entries in this file, use the chnfsrtd command. See the chnfsrtd command description in Commands Reference, Volume 1 for more details.
/etc/nfs/princmap 파일
주체가 서버의 완전한 도메인 이름이 아닐 때 호스트 이름을 Kerberos 주체에 매핑하는 파일입니다.
다음 형식의 줄이 몇 개든 들어 있습니다.
<host part of principal> alias1 alias2 ...
이 파일의 항목을 더하고, 고치고, 지우려면 nfshostmap 명령을 씁니다. 자세한 정보는 Commands Reference, Volume 4의 nfshostmap 명령 설명을 봅니다.
영어 원문
/etc/nfs/princmap file
This file maps host names to Kerberos principals when the principal is not the fully qualified domain name of the server.
It consists of any number of lines of the following format:
<host part of principal> alias1 alias2 ...
To add, edit, or remove entries from this file, use the nfshostmap command. See the nfshostmap command description in Commands Reference, Volume 4 for more information.
/etc/nfs/security_default 파일
/etc/nfs/security_default 파일에는 NFS 클라이언트가 쓸 수 있는 보안 방식(flavor) 목록이 쓸 순서대로 들어 있습니다.
이 파일은 chnfssec 명령으로 관리합니다. 자세한 정보는 Commands Reference, Volume 1의 chnfssec 명령 설명을 봅니다.
영어 원문
/etc/nfs/security_default file
The /etc/nfs/security_default file contains the list of security flavors that may be used by the NFS client, in the order in which they should be used.
Use the chnfssec command to manage this file. See the chnfssec command description in Commands Reference, Volume 1 for more information.