mount 명령어 (AIX 5.3·6.1)

핵심 정리

  • 파일 시스템을 지정한 위치(마운트 지점)에서 쓸 수 있게 합니다. 인수 없이 mount는 지금 마운트된 목록을 보여 줍니다.
  • /etc/filesystems에 있는 것은 mount /data처럼 마운트 지점(또는 장치)만 주면 됩니다. mount all(-a)은 mount = true인 것을 모두, mount -t nfs는 type = nfs인 것을 모두 마운트합니다.
  • NFS: mount nfsserver:/export /mnt 또는 mount -n nfsserver /export /mnt. 옵션 예: -o vers=3,hard,intr,rsize=65536,wsize=65536.
  • JFS2 옵션 예: -o cio(동시 I/O, DB용), -o dio, -o noatime, -o rbrw(순차 I/O의 메모리 해제), -o ro. 6.1에서는 mount -o remount,rw /fs처럼 마운트한 채로 옵션을 바꿀 수 있습니다.
  • JFS2 스냅숏은 mount -o snapshot /dev/스냅숏LV /mnt로 읽기 전용으로 마운트합니다. 일반 사용자는 system 그룹이고 마운트 지점 쓰기 권한이 있을 때만 마운트할 수 있습니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 -F(다른 filesystems 파일), remount, atime·noatime, log=NULL, noguard, NFS cior, CacheFS mfsid가 더해지고, 5.3의 cmtype(그룹·비동기 커밋)은 빠짐)
원문 IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3
파일 /usr/sbin/mount, /etc/filesystems, /etc/vfs
관련 명령어 umount, lsfs, crfs, chfs, df, showmount, nfso

목적

파일 시스템을 쓸 수 있게 합니다.

영어 원문

Makes a file system available for use.

구문

text
mount [ -f ] [ -n node ] [ -o options ] [ -p ] [ -r ] [ -v vfsname ] [ -F AltFSfile ]
      [ -t type | [ device | node:directory ] directory | all | -a ] [ -V [ generic_options ] special_mount_points ]

-F는 6.1 구문에만 있습니다.

설명

mount 명령은 운영 체제가 지정한 위치(마운트 지점)에서 파일 시스템을 쓸 수 있게 합니다. 디렉터리와 파일 마운트로 다른 파일 트리를 만들 수도 있습니다. device나 node:directory로 나타낸 파일 시스템을 directory 매개변수의 디렉터리에 마운트하며, 끝나면 그 디렉터리가 새로 마운트한 파일 시스템의 루트가 됩니다.

파일이나 디렉터리 마운트는 root이거나 system 그룹 구성원이면서 마운트 지점에 쓰기 권한이 있는 사용자만 할 수 있습니다. 파일이나 디렉터리는 심볼릭 링크여도 됩니다. 권한은 실효 사용자 ID가 아닌 실제 사용자 ID로 판단합니다. system 그룹 구성원은 마운트 지점 쓰기 권한이 있으면 /etc/filesystems에 있는 장치 마운트를 할 수 있고, root는 어떤 마운트든 할 수 있습니다. 장치를 마운트할 때 device는 블록 장치 이름, directory는 마운트할 디렉터리입니다.

플래그 없이 실행하면 마운트한 파일 시스템마다 노드(원격이면), 마운트한 객체, 마운트 지점, VFS 유형, 마운트한 시각, 마운트 옵션을 보여 줍니다.

directory나 node:directory만 주면 /etc/filesystems에서 그 디렉터리에 보통 마운트하는 것을 찾아 마운트합니다. 무엇을 마운트하는지 기억하지 않아도 되어 가장 편한 방법입니다. 장치만 줘도 마운트 지점을 /etc/filesystems에서 얻습니다.

/etc/filesystems에는 마운트할 수 있는 파일 시스템, 디렉터리, 파일마다 스탠자가 있어야 하며, 적어도 이름과 장치(또는 디렉터리 이름)가 있어야 합니다. 스탠자에 mount 속성이 있으면 그 값을 쓰며, 값은 automatic, true, false, removable, readonly 다섯 가지입니다.

mount all은 mount=true인 파일 시스템을 모두 제자리에 마운트합니다. 보통 시스템 초기화 때 쓰며, 이를 자동 마운트라고 합니다.

기본으로 mount는 파일 시스템을 마운트한 뒤 wlmcntrl을 실행해 커널의 현재 할당 규칙을 새로 고칩니다. 한꺼번에 많이 마운트하거나 WLM 구성에 닿을 수 없는 원격 마운트 규칙이 있으면 이것이 바람직하지 않을 수 있습니다. 환경 변수 MOUNT_WLMCNTRL_SELFMANAGE를 아무 값으로 정하면 부르지 않으며, 그때는 wlmcntrl -u -d ""를 직접 실행해 규칙을 새로 고칩니다.

참고:

  1. cdromd 자동 마운트 데몬을 켜면 CD·DVD는 /etc/cdromd.conf대로 자동으로 마운트됩니다. 내리려면 cdumount나 cdeject를, 데몬을 끄려면 stopsrc -s cdromd를 씁니다.
  2. CacheFS로 로컬에 캐시할 원격 파일 시스템은 로컬 시스템의 root ID가 원격에서 nobody(익명 사용자)로 바뀌지 않게 내보내야 합니다. 예를 들어 호스트 A의 /F를 호스트 B가 CacheFS로 마운트하려면 A의 /etc/exports에 /F -rw,root=B(또는 /F -ro,root=B) 같은 항목이 필요합니다.
  3. 읽기 전용 논리 볼륨에 JFS 파일 시스템을 마운트하는 것은 지원하지 않습니다.
  4. (6.1) Trusted AIX에서 EAv1인 JFS2 파일 시스템을 마운트하면 EAv2로 바뀝니다.

JFS2 파일 시스템에서 쓰기

mount로 JFS2 파일 시스템의 스냅숏을 디렉터리 트리로 볼 수 있습니다. 장치의 스냅숏을 디렉터리에 읽기 전용으로 마운트하며, 스냅숏은 한 번만 마운트할 수 있습니다. 스냅숏이 있는 JFS2 파일 시스템을 마운트하면 스냅숏도 활성화됩니다.

Web-based System Manager(wsm)의 File Systems 응용 프로그램이나 SMIT 빠른 경로 smit mount로도 실행할 수 있습니다.

참고: 재부팅 전에 마운트를 풀지 않은 JFS·JFS2를 만나면 로그 레코드를 재생해 봅니다. 호환되는 JFS 파일 시스템을 더 이른 릴리스의 시스템으로 옮기려면 꼭 깨끗하게 마운트를 푼 뒤 옮겨야 합니다. 그러지 않으면 JFS 로그 장치가 호환되지 않을 수 있으며, 알 수 없는 로그 장치가 되면 원래 시스템으로 돌려 fsck를 실행해야 합니다.

영어 원문

The mount command instructs the operating system to make a file system available for use at a specified location (the mount point). In addition, you can use the mount command to build other file trees made up of directory and file mounts. The mount command mounts a file system expressed as a device using the device or node:directory parameter on the directory specified by the directory parameter. After the mount command has finished, the directory specified becomes the root directory of the newly mounted file system.

Only users with root authority or are members of the system group and have write access to the mount point can issue file or directory mounts. The file or directory may be a symbolic link. The mount command uses the real user ID, not the effective user ID, to determine if the user has appropriate access. System group members can issue device mounts, provided they have write access to the mount point and those mounts specified in the /etc/file systems file. Users with root user authority can issue any mount command.

Users can mount a device provided they belong to the system group and have appropriate access. When mounting a device, the mount command uses the device parameter as the name of the block device and the directory parameter as the directory on which to mount the file system.

If you enter the mount command without flags, the command displays the following information for the mounted file systems:

  • the node (if the mount is remote)

  • the object mounted

  • the mount point

  • the virtual-file-system type

  • the time mounted

  • any mount options

If you specify only the directory or node:directory parameter, the mount command takes it to be the name of the directory or file on which a file system, directory, or file is usually mounted (as defined in the /etc/file systems file). The mount command looks up the associated device, directory, or file and mounts it. This is the most convenient way of using the mount command, because it does not require you to remember what is normally mounted on a directory or file. You can also specify only the device. In this case, the command obtains the mount point from the /etc/file systems file.

The /etc/file systems file should include a stanza for each mountable file system, directory, or file. This stanza should specify at least the name of the file system and either the device on which it resides or the directory name. If the stanza includes a mount attribute, the mount command uses the associated values. It recognizes five values for the mount attributes: automatic, true, false, removable, and readonly.

The mount all command causes all file systems with the mount=true attribute to be mounted in their normal places. This command is typically used during system initialization, and the corresponding mount operations are referred to as automatic mount operations.

By default, the mount command runs the wlmcntrl command to refresh the current assignment rules in the kernel after mounting the file system. In some situations (such as when many file systems are mounted at once, or when a rule for an inaccessible remote mount is present in the workload manager configuration), calling wlmcntrl automatically after mount might be undesirable.

If you wish to override this behavior, set the environment variable MOUNT_WLMCNTRL_SELFMANAGE to any value. This will avoid calling the wlmcntrl command during the mount operation. You must manually run wlmcntrl -u -d "" to refresh the current assignment rules in the kernel. For more information, see wlmcntrl command.

Note:

  1. If the cdromd CD and DVD automount daemon is enabled, those devices will be automatically mounted as specified in the /etc/cdromd.conf file. Use the cdumount or cdeject command to unmount an automatically mounted CD or DVD. Use stopsrc -s cdromd to disable the CD/DVD automount daemon.

  2. For CacheFS, the remote file system that is to be cached locally must be exported such that the root ID of the local system is not remapped on the remote host to nobody (or the ID that the remote host uses as the anonymous user). For example, if host A were to export a file system /F, which would be mounted with CacheFS on host B, then the /etc/exports on host A would need to have an entry similar to:

/F -rw,root=B
or
/F -ro,root=B

depending on the mount options used for the local CacheFS mount.

  1. Mounting a JFS file system on a read-only logical volume is not supported.

  2. Mounting a JFS2 file system with EAv1 on Trusted AIX system converts the file system to EAv2.

Using mount on a JFS2 File System

The mount command can also be used to access a snapshot of a JFS2 file system as a directory tree. The snapshot on device is mounted read-only at directory. A snapshot can only be mounted once. When mounting a JFS2 file system with snapshots, the snapshots are activated.

You can use the File Systems application in Web-based System Manager (wsm) to run this command. You could also use the System Management Interface Tool (SMIT) smit mount fast path to run this command.

Note: If the mount command encounters a Journaled File System (JFS) or Enhanced Journaled File System (JFS2) which was not unmounted before reboot, a replay of any JFS or JFS2 log records is

attempted. In order to move a compatible JFS file system to a system running an earlier release of the operating system, the file system must always be unmounted cleanly prior to its movement. Failure to unmount first may result in an incompatible JFS log device. If the movement results in an unknown log device, the file system should be returned to the system running the latter operating system release, and fsck should be run on the file system.

플래그

플래그 설명
-a, all /etc/filesystems에서 mount 속성이 true인 스탠자의 파일 시스템을 모두 마운트합니다.
-f 시스템 초기화 때 루트 파일 시스템 위에 마운트하도록 강제 마운트를 요청합니다.
-F AltFSfile /etc/filesystems 대신 다른 파일 시스템 정의 파일을 씁니다. 6.1부터
-n node 마운트할 디렉터리를 가진 원격 노드. 콜론으로 나눈 IPv6 주소도 되며, node:directory 형식이면 IPv6 주소를 대괄호로 감쌉니다.
-p 이동식 파일 시스템으로 마운트합니다. 열린 파일이 있는 동안은 보통처럼 동작하지만, 열린 파일도 현재 디렉터리로 쓰는 프로세스도 없으면 디스크 버퍼를 모두 매체에 쓰고 파일 시스템 구조를 잊습니다.
-r /etc/filesystems나 앞의 옵션과 상관없이 읽기 전용으로 마운트합니다.
-t type /etc/filesystems에서 type=type 속성이 있고 마운트되지 않은 스탠자를 모두 마운트합니다. type은 그룹 이름입니다.
-v vfsname 파일 시스템이 /etc/vfs의 vfsname으로 정의되어 있음을 나타냅니다.
-o options 옵션. 쉼표로만 나눕니다(아래 표).
-V CacheFS 파일 시스템을 마운트합니다.

파일 시스템 옵션(-o)

모든 VFS 유형에 적용되지는 않습니다.

옵션 설명
atime, noatime (6.1) 접근 시각 갱신을 켜고 끕니다. 기본 atime. 많이 읽고 거의 바꾸지 않는 파일 시스템은 noatime으로 성능이 좋아지지만 마지막 접근 시각을 알 수 없습니다.
bsy 마운트할 디렉터리가 어떤 프로세스의 현재 작업 디렉터리면 마운트하지 않습니다.
cio 동시 읽기·쓰기(Concurrent I/O)용으로 마운트합니다. 모든 파일을 O_CIO로 연 것처럼 동작하며, 캐시 I/O를 쓸 수 없어 mmap(), shmat()이 EINVAL로 실패하고 이 파일 시스템의 실행 파일도 돌릴 수 없습니다. 응용 프로그램이 직렬화를 맡아야 하며 쿼터를 지원하지 않습니다.
dev, nodev 이 마운트에서 장치를 열 수 있는지. 기본 dev. nodev면 장치를 열 때 ENXIO.
dio 모든 파일을 O_DIRECT로 연 것처럼 동작합니다. dio·cio는 일부 작업 부하에서 성능이 좋아지지만 파일 캐시와 미리 읽기가 없어 큰 순차 읽기는 느려질 수 있습니다.
fmode=octal 파일과 디렉터리 모드. 기본 755.
gid=gid 마운트의 파일에 줄 GID. 기본 bin.
log=lvname 파일 시스템 로그 논리 볼륨의 전체 경로.
log=NULL (6.1) JFS2 로깅을 끕니다. 메타데이터 작업 중 시스템이 비정상으로 멈추면 일관된 상태로 되살릴 수 없어 다시 만들어야 하므로 조심해서 씁니다.
maxpout=value, minpout=value 이 파일 시스템 파일의 페이지아웃이 이 수준이면 스레드를 재우고(maxpout), 다시 깨웁니다(minpout). 둘을 함께 주며 maxpout이 더 커야 합니다. 기본은 커널 값입니다.
nocase 대소문자 대응을 끕니다. ISO 9660:1998/HSG CD-ROM에 씁니다.
noguard (6.1) mountguard 설정과 상관없이 마운트합니다. chfs·crfs로 mountguard를 켜면 PowerHA 같은 클러스터에서 다른 노드에 마운트된 것처럼 보이는 파일 시스템은 마운트할 수 없는데, 이를 잠시 무시합니다.
rbr, rbw, rbrw 순차 읽기(rbr), 쓰기(rbw), 둘 다(rbrw)를 감지하면 버퍼로 복사하거나 디스크에 쓴 뒤 파일이 쓴 실제 메모리 페이지를 풉니다(release-behind).
norbr, norbw, norbrw release-behind를 끕니다. 아무것도 주지 않으면 norbrw가 기본입니다.
nosuid, suid 이 마운트에서 setuid·setgid 프로그램 실행을 막거나(실패하면 EPERM) 허락합니다. 기본 suid.
remount (6.1) 마운트한 파일 시스템의 옵션을 바꿉니다. JFS2는 atime·noatime, dev·nodev, maxpout·minpout, rbr·norbr, rbw·norbw, rbrw·norbrw, rw·ro·rox, suid·nosuid를 바꿀 수 있으며, 주지 않은 옵션은 그대로 둡니다. 외부 스냅숏으로 마운트한 것은 읽기·쓰기로 바꿀 수 없고, DMAPI가 관리하는 파일 시스템에는 rw·ro를 쓸 수 없습니다.
ro, rw /etc/filesystems나 앞의 옵션과 상관없이 읽기 전용, 읽기·쓰기로 마운트합니다. 기본 rw.
snapshot 마운트할 장치가 스냅숏입니다. 스냅숏의 원본 파일 시스템이 이미 마운트되어 있어야 합니다.
snapto=snapshot JFS2 파일 시스템을 마운트하며 그 위치에 스냅숏을 시작합니다. /가 없는 이름이면 내부 스냅숏 이름입니다.
upcase 대소문자 대응을 기본 소문자에서 대문자로 바꿉니다.

(6.1) NFS 마운트 요청은 세 종류입니다. 노드, 객체, 마운트 지점, 옵션이 기존 마운트와 같으면 새로 만들지 않고 성공으로 알립니다(중복 마운트). remount가 없으면 새 마운트를 만들며, 노드·객체·마운트 지점이나 고정 옵션이 다른데 remount를 주면 실패합니다. 노드·객체·마운트 지점이 맨 위 마운트와 같고 옵션만 다르면 remount로 옵션을 바꿉니다. NFS에서 바꿀 수 있는 옵션은 acdirmax, acdirmin, acregmax, acregmin, actimeo, fastattr, grpid, hard, intr, noac, nocto, nodev, nointr, nosuid, posix, retrans, ro, rsize, rw, secure, sec, soft, timeo, wsize, biods, extraattr, nodircache, prefer, otwattr, maxgroups, proto이며, 나머지는 고정 옵션입니다.

NFS 옵션(-o)

옵션 설명
acdirmax=n, acdirmin=n 디렉터리를 바꾼 뒤 캐시한 속성을 최대 n초(기본 60), 최소 n초(기본 30) 둡니다.
acregmax=n, acregmin=n 파일을 바꾼 뒤 캐시한 속성을 최대 n초(기본 60), 최소 n초(기본 30) 둡니다.
actimeo=n 위 네 값을 모두 n초로 합니다.
acl, noacl ACL RPC 프로그램을 쓸지. 서버가 제공할 때만 씁니다. 기본 noacl.
bg, fg 첫 시도가 실패하면 백그라운드(bg)나 포그라운드(fg, 기본)로 다시 시도합니다.
biods=n 이 마운트에서 비동기 I/O RPC를 하는 biod 스레드 최대 수(최대 128). 기본 최댓값은 NFS v2가 7, v3·v4가 32이며 활동에 따라 동적으로 관리합니다.
cio, dio 위 파일 시스템 옵션과 같습니다.
cior (6.1) cio와 함께 써서 읽기 전용 파일을 O_CIO|O_CIOR로 열 수 있게 합니다. O_CIO만으로 열면 실패합니다.
fastattr 쓰고 있는 파일의 속성을 읽기 전에 데이터를 서버에 보내야 하는 요건을 건너뜁니다. 쓰기 오류가 나면 클라이언트와 서버의 파일 크기가 달라질 수 있고 다른 클라이언트의 속성 변경을 모르므로, 두 클라이언트가 같은 파일에 쓰는 환경에서는 쓰지 않습니다.
grpid 만든 파일이나 디렉터리가 부모 디렉터리의 그룹 ID를 물려받습니다.
hard, soft 서버가 응답할 때까지 다시 시도(hard, 기본)하거나 응답이 없으면 오류(soft)를 돌려줍니다.
intr, nointr hard 마운트에서 키보드 인터럽트를 허락하거나 막습니다.
llock 파일 잠금을 클라이언트에서만 하고 서버로 보내지 않습니다.
maxgroups=n AUTH_UNIX RPC에 넣을 그룹 수(16~64). 16을 넘기면 16개 넘게 지원하는 서버에서만 동작합니다(AIX 서버는 5200-01부터 64개).
noac 속성과 디렉터리를 캐시하지 않습니다. 없으면 NFSPROC_GETATTR RPC를 줄이려고 속성을 캐시합니다.
port=n 서버 IP 포트. 기본 2049.
posix NFS v2 마운트에서 pathconf 정보를 주고받습니다. 서버에 v2 rpc.mountd가 있어야 합니다.
proto=[udp|tcp] 전송 프로토콜. 기본 tcp. vers=4면 udp를 쓸 수 없습니다.
retrans=n NFS 재전송 횟수(UDP). 기본 5. rpc.mountd와의 통신에는 쓰지 않습니다.
retry=n 마운트 시도 횟수. 기본 1000, 0이면 10,000번.
rsize=n, wsize=n 읽기·쓰기 버퍼 크기(바이트). 6.1부터 NFS v3·v4의 기본은 64KB, 최대 512KB.
secure NFS에 DES를 씁니다. NFS v4는 DES를 지원하지 않으니 krb5를 씁니다. 폐기 예정이며 sec=dh를 씁니다.
sec=flavor[:flavor...] 쓸 수 있는 보안 방법 목록. sys(기본), dh, krb5, krb5i, krb5p(목록에 des, unix도 있음). AIX 5.3 이후.
shortdev 32비트 장치 특수 파일을 지원하지 않는 호스트의 파일 시스템을 마운트합니다.
timeo=n 타임아웃(0.1초 단위). TCP 기본 100(10초), UDP 기본 11(1.1초)이며 UDP는 실패할 때마다 최대 20초까지 늘어납니다. rpc.mountd와의 통신은 30초입니다.
vers=[2|3|4] NFS 버전. 기본은 양쪽이 지원하는 가장 높은 버전이지만 명시하지 않으면 v4는 쓰지 않습니다. vers=4는 AIX 5.3 이후.

CacheFS 옵션

CacheFS판 mount는 캐시 파일 시스템을 마운트하며 필요하면 뒤(back) 파일 시스템을 NFS로 마운트합니다. -V를 주고 -o에 쉼표로만 나눠 옵션을 줍니다. backfstype은 꼭 줘야 합니다.

옵션 설명
acdirmax=n, acdirmin=n, acregmax=n, acregmin=n, actimeo=n 캐시한 속성을 두는 시간. 지나면 뒤 파일 시스템의 수정 시각을 확인해 바뀌었으면 캐시를 비우고 새로 가져옵니다(기본 60, 30, 30, 30초).
backfstype=type 뒤 파일 시스템 유형(예: nfs).
backpath=path 뒤 파일 시스템이 이미 마운트된 곳. 없으면 CacheFS가 정합니다.
cachedir=directory 캐시 디렉터리 이름.
cacheid=ID 캐시 인스턴스를 가리키는 문자열. 없으면 CacheFS가 만듭니다.
demandconst, noconst 읽기·쓰기마다 일관성을 검사하거나(demandconst), 검사하지 않습니다(noconst, 뒤 파일 시스템이 바뀌지 않을 때만). 기본은 주기적 검사이며, 둘은 함께 쓸 수 없습니다.
local_access 접근 검사를 뒤 파일 시스템이 아니라 앞(front) 파일 시스템이 모드 비트로 합니다. 보안 NFS에는 쓰지 않습니다.
purge 그 파일 시스템의 캐시 정보를 모두 비웁니다.
rw, ro 읽기·쓰기(기본), 읽기 전용.
suid, nosuid setuid 실행을 허락(기본)하거나 막습니다.
write-around, non-shared 쓰기 방식. write-around(기본)는 NFS처럼 뒤 파일 시스템에 쓰고 캐시에서 비웁니다. non-shared는 다른 누구도 쓰지 않을 때만 씁니다.
mfsid (6.1) 전역 보기를 켭니다. 뒤 파일 시스템이 NFS v4일 때 서버의 내보낸 이름 공간을 따라 파일 시스템을 넘나듭니다.

demandconst, noconst, purge, non-shared는 그 CacheFS를 처음 마운트할 때 썼다면 다음 마운트에도 꼭 줘야 합니다(캐시 제어 파일에 상태가 남음).

영어 원문
  • -a — Mounts all file systems in the /etc/file systems file with stanzas that contain the true mount attribute.
  • all — Same as the -a flag.
  • -f — Requests a forced mount during system initialization to enable mounting over the root file system.
  • -F AltFSfile — Mounts on a file of an alternate file system, other than the /etc/file systems file.
  • -n node — Specifies the remote node that holds the directory to be mounted. The node can be specified as a colon-separated IPv6 address. If this is done with the node:directory format, the colon-separated IPv6 address must be enclosed in square brackets.
  • -p — Mounts a file system as a removable file system. While open files are on it, a removable mounted file system behaves the same as a normally mounted file system. However, when no files are open (and no process has a current directory on the file system), all of the file system disk buffers in the file system are written to the medium, and the operating system forgets the structure of the file system.
  • -r — Mounts a file system as a read-only file system, regardless of its previous specification in the /etc/file systems file or any previous command-line options.
  • -t type — Mounts all stanzas in the /etc/file systems file that contain the type=type attribute and are not mounted. The type parameter specifies the name of the group.
  • -v vfsname — Specifies that the file system is defined by the vfsname parameter in the /etc/vfs file.
  • File System Specific Options
  • -o options — Specifies options. Options entered on the command line should be separated only by a comma. The following file system-specific options do not apply to all virtual file system types: atime Turns on access-time updates. If neither atime nor noatime is specified, atime is the default value. bsy Prevents the mount operation if the directory to be mounted over is the current working directory of a process. cio Specifies the file system to be mounted for concurrent readers and writers. I/O on files in this file system will behave as if they had been opened with O_CIO specified in the open() system call. Using this option will prevent access in any manner other than CIO. It is impossible to use cached I/O on a file system mounted with the cio option. This means that mapping commands such as mmap() and shmat() will fail with EINVAL when used on any file in a file system mounted with the cio option. One side-effect of this is that it is impossible to run binaries out of a cio mounted file system, since the loader may use mmap(). Note: When you mount the file system by using the cio option, all applications must manage the serialization of files. Quotas are not supported by the cio option because quotas have their own serialization code. dev Specifies that you can open devices from this mount. If neither dev nor nodev is specified, dev is the default value. dio Specifies that I/O on the file system will behave as if all the files had been opened with O_DIRECT specified in the open() system call. Note: Using the -odio or -ocio flags can help performance on certain workloads, but users should be aware that using these flags will prevent file caching for these file systems. Because readahead is disabled for these file systems, this may decrease performance for large sequential reads. fmode=octal Specifies the mode for a file and directory. The default is 755. gid=gid Specifies the GID that is assigned to files in the mount. The default is bin. log=lvname Specifies the full path name of the file system logging logical volume name where the following file-system operations are logged. log=NULL Turns off logging for JFS2 file systems. JFS2 depends on the log for metadata consistency, so if the system abnormally stops during JFS2 metadata operations, the file system cannot be recovered to a consistent state upon reboot. In these cases, the file system must be recreated. Attention: Because of the risk of data loss, use this flag with caution. maxpout=value Specifies the pageout level for files on this file system at which threads should be slept. If maxpout is specified, minpout must also be specified. Value must be non-negative and greater than minpout. The default is the kernel maxpout level. minpout=value Specifies the pageout level for files on this file system at which threads should be readied. If minpout is specified, maxpout must also be specified. Value must be non-negative. The default is the kernel minpout level. noatime Turns off access-time updates. Using this option can improve performance on file systems where a large number of files are read frequently and seldom updated. If you use the option, the last access time for a file cannot be determined. If neither atime nor noatime is specified, atime is the default value. nocase Turns-off case mapping. This is useful for CDROMs using the ISO 9660:1998/HSG standard. nodev Specifies that you cannot open devices from this mount. This option returns a value of ENXIO if a failure occurs. If neither dev nor nodev is specified, dev is the default value. noguard Mount the filesystem regardless of the current mountguard setting which would otherwise guard the filesystem against unsupported concurrent mounts in a PowerHA or other clustering environment. If mountguard is enabled by the chfs or crfs command, the filesystem cannot be mounted if it appears to be mounted on another node or system. Specifying the noguard option temporarily overrides the mountguard setting. norbr Mounts the file system without the release-behind-when-reading capability. If none of the release-behind options are specified, norbrw is the default value. norbrw Mounts the file system without both the release-behind-when-reading and release-behind-when- writing capabilities. If none of the release-behind options are specified, norbrw is the default value. norbw Mounts the file system without the release-behind-when-writing capability. If none of the release-behind options are specified, norbrw is the default value. nosuid Specifies that execution of setuid and setgid programs by way of this mount is not allowed. This option returns a value of EPERM if a failure occurs. If neither suid nor nosuid is specified, suid is the default value. rbr Mount file system with the release-behind-when-reading capability. When sequential reading of a file in this file system is detected, the real memory pages used by the file will be released once the pages are copied to internal buffers. If none of the release-behind options are specified, norbrw is the default. Note: When rbr is specified, the D_RB_READ flag is ultimately set in the _devflags field in the pdtentry structure. rbw Mount file system with the release-behind-when-writing capability. When sequential writing of a file in this file system is detected, the real memory pages used by the file will be released once the pages written to disk. If none of the release-behind options are specified, norbrw is the default. Note: When rbw is specified, the D_RB_WRITE flag is set. rbrw Mount file system with both release-behind-when-reading and release-behind-when-writing capabilities. If none of the release-behind options are specified, norbrw is the default. Note: If rbrw is specified, both the D_RB_READ and the D_RB_WRITE flags are set. remount Changes the mount options of a mounted file system. For JFS2 file systems, you can specify the following mount options with the remount option to change the settings of a mounted file system. For any mount options not specified, no change is made to the current corresponding settings of the file system. atime, noatime; dev, nodev; maxpout, minpout; rbr, norbr; rbw, norbw; rbrw, norbrw, rw, ro, rox; suid, nosuid. Note: 1. External-snapshot mounted file systems cannot be remounted to read-write file systems. 2. You cannot use the rw and ro remount options on a file system that is managed by data management application programming interface (DMAPI). For NFS, there are three types of mount requests. duplicate mount If the node, object, mount point, and the options that are specified in the mount command are the same as those for an existing mount, the mount command returns information about a successful mount, but a new mount is not created. new mount If the remount option is not specified, the mount command creates a new mount. If the node, object, mount point, or the constant options that are specified in the mount command are different than those for the existing mounts, the mount command fails if the remount option is specified. remount If the node, object, and mount point are the same as those for a top-most mount, but the remount options are different, the remount operation modifies the mount options of an existing mount. In this case, NFS performs the remount operation. A top-most mount does not have another mount on top of it. For remount requests, the following options can be modified: acdirmax, acdirmin, acregmax, acregmin, actimeo, fastattr, grpid, hard, intr, noac, nocto, nodev, nointr, nosuid, posix, retrans, ro, rsize, rw, secure, sec, soft, timeo, wsize, biods, extraattr, nodircache, prefer, otwattr, maxgroups, and proto. Other options are classified as constant options. ro Specifies that the mounted file is read-only, regardless of its previous option specification in the /etc/file systems file or any previous command-line options. The default value is rw. rw Specifies that the mounted file is read/write accessible, regardless of its previous option specification in the /etc/file systems file or any previous command-line options. The default value is rw. snapshot Specifies the device to be mounted is a snapshot. The snapped file system for the specified snapshot must already be mounted or an error message will display. snapto=snapshot Specifies the location to start a snapshot with the value of snapshot when mounting the specified JFS2 file system. The snapshot parameter specifies the name of an internal snapshot if the snapshot parameter does not included a forward slash (/), that is, no path information. suid Specifies that execution of setuid and setgid programs by way of this mount is allowed. If neither suid nor nosuid is specified, suid is the default value. upcase Changes case mapping from default lowercase to uppercase. This is useful for CDROMs using the ISO 9660:1998/HSG standard. uid=uid Specifies the UID that is assigned to files in the mount, the default is bin. wrkgrp=workgroup Specifies the workgroup that the SMB server belongs.
  • NFS Specific Options
  • -o options — Specifies options. Options you enter on the command line should be separated only by a comma, not a comma and a space. The following NFS-specific options do not apply to all virtual file system types: acdirmax=n Holds cached attributes for no more than n seconds after directory update. The default is 60 seconds. acdirmin=n Holds cached attributes for at least n seconds after directory update. The default is 30 seconds. acl Requests using the Access Control List RPC program for this NFS mount. If the acl option is used, the ACL RPC program is used only if the NFS server provides it. The default is noacl. acregmax=n Holds cached attributes for no longer that n seconds after file modification. The default is 60 seconds. acregmin=n Holds cached attributes for at least n seconds after file modification. The default is 30 seconds. actimeo=n Sets minimum and maximum times for regular files and directories to n seconds. If this option is set, it overrides any settings for the acregmin, acregmax, acdirmin, and acdirmax options. bg Attempts mount in background if first attempt is unsuccessful. The default value is fg. biods=n Sets the maximum number of biod threads that perform asynchronous I/O RPC requests for an NFS mount. The maximum value that can be set is 128. Values greater than 128 are limited to 128 within the NFS client. The NFS client dynamically manages the number of running biod threads up to the maximum based on activity. The default maximums for the different NFS protocols are 7 for NFS version 2 and 32 for NFS version 3 and NFS version 4. These defaults are subject to change in future releases. cio Specifies the file system to be mounted for concurrent readers and writers. I/O on files in this file system will behave as if they had been opened with O_CIO specified in the open() system call. Using this option will prevent access in any manner other than CIO. It is impossible to use cached I/O on a file system mounted with the cio option. This means that mapping commands such as mmap() and shmat() will fail with EINVAL when used on any file in a file system mounted with the cio option. One side-effect of this is that it is impossible to run binaries out of a cio mounted file system, since the loader may use mmap(). Note: When you mount the file system by using the cio option, all applications must manage the serialization of files. Quotas are not supported by the cio option because quotas have their own serialization code. cior Specifies to allow read-only files to open in the file system. I/O on files in this file system will behave as if they had been opened with O_CIO | O_CIOR specified in the open() system call. Using this option will prevent access in any manner other than O_CIO | O_CIOR and read-only. An attempt to open with O_CIO only will also fail. This option can only be used in conjunction with cio. dio Specifies that I/O on the file system will behave as if all the files had been opened with O_DIRECT specified in the open() system call. Note: Using the -odio or -ocio flags can help performance on certain workloads, but users should be aware that using these flags will prevent file caching for these file systems. Because readahead is disabled for these file systems, this may decrease performance for large sequential reads. fastattr Bypasses the requirement that files currently being written will be sent to the server before the attributes of the file is read. This option is to be used with caution, since it will cause the client to assume that the file data that has not yet reached the server will be written without problem. In case of write errors, the client and server will have different opinions on what the size of the file really is. Likewise, a client will not be aware of attribute changes to the file being made by another client, so this option must not be used in environments where two clients are writing to the same files. fg Attempts mount in foreground if first attempt is unsuccessful. fg is the default value. grpid Directs any file or directory created on the file system to inherit the group ID of the parent directory. hard Retries a request until server responds. The option is the default value. intr Allows keyboard interrupts on hard mounts. llock Requests that files lock locally at the NFS client. NFS network file locking requests are not sent to the NFS server if the llock option is used. maxgroups=n Indicates that NFS RPC calls using AUTH_UNIX may include up to n member groups of information. Using this option to increase the number of member groups beyond the RPC protocol standard of 16 will only work against servers that support more than 16 member groups. Otherwise, the client will experience errors. Values below 16 or greater than 64 will be ignored. By default, the protocol standard maximum of 16 is adhered to. AIX NFS servers will accept and process AUTH_UNIX credentials with up to 64 groups starting with AIX 5L Version 5.2 with the 5200-01 Recommended Maintenance package. The actual number of member groups sent by the NFS client is dependent on the number of groups the involved user is a member of, and may be limited by the length of the NFS client's hostname (which is included in the AUTH_UNIX information). noac Specifies that the mount command performs no attribute or directory caching. If you do not specify this option, the attributes (including permissions, size, and timestamps) for files and directories are cached to reduce the need to perform over-the-wire NFSPROC_GETATTR Remote Procedure Calls (RPCs). The NFSPROC_GETATTR RPC enables a client to prompt the server for file and directory attributes. The acregmin, acregmax, acdirmin, and acdirmax options control the length of time for which the cached values are retained. noacl Specifies not to use the Access Control List RPC program for this NFS mount request. The default is noacl. nointr Specifies no keyboard interrupts allowed on hard mounts. port=n Sets server Internet Protocol (IP) port number to n. The default value is the 2049. posix Requests that pathconf information be exchanged and made available on an NFS Version 2 mount. Requires a mount Version 2 rpc.mountd at the NFS server. proto=[udp|tcp] Specifies the transport protocol. The default is tcp. Use the proto=[udp|tcp] option to override the default. proto=udp cannot be specified if vers=4. retrans=n Sets the number of NFS transmissions to n. The default value is 5. The retrans setting determines how many times the NFS client retransmits a given UDP RPC request to an NFS server for file system operations. The retrans setting is not used during communication with the NFS server rpc.mountd service when processing NFS version 2 and 3 mounts. Retries to rpc.mountd are controlled with the retry mount option. retry=n Sets the number of times the mount is attempted to n; the default value is 1000. When the retry value is 0, the system makes 10,000 attempts. rsize=n Sets the read buffer size to n bytes. Beginning with AIX Version 6.1, the default value is 64 KB and the maximum value is 512 KB when using Version 3 and Version 4 of the NFS protocol. secure Specifies that the mount command uses Data Encryption Standard (DES) for NFS transactions. Data Encryption Standard (DES) is not supported in NFS Version 4, use krb5 instead. sec=flavor[:flavor...] Specifies a list of security methods that may be used to access files under the mount point. Allowable flavor values are: sys UNIX authentication. This is the default method. dh DES authentication. Data Encryption Standard (DES) is not supported in NFS Version 4, use krb5 instead. krb5 Kerberos. Authentication only. krb5i Kerberos. Authentication and integrity. krb5p Kerberos. Authentication, integrity, and privacy. The secure option may be specified, but not in conjunction with a sec option. The secure option is deprecated and may be eliminated in a future release. Use sec=dh instead. sec=[flavor1:...:flavorn] The sec option specifies the security flavor list for the NFS mount. The available flavors are des, unix, sys, krb5, krb5i, and krb5p. This option only applies to AIX 5.3 or later. shortdev Specifies that you are mounting a file system from a host that does not support 32-bit device special files. soft Returns an error if the server does not respond. The default value is hard. timeo=n Sets the Network File System (NFS) time out period to n tenths of a second. For TCP mounts, the default timeout is 100, which equals 10 seconds. For UDP mounts, the default timeout is 11, which equals 1.1 seconds, but varies depending on the NFS operation taking place. For UDP mounts, the timeout will increase for each failed transmission, with a maximum value of 20 seconds. Each transmission will be attempted twice, after which the timeout value is updated. The timeo option does not apply to communication from the NFS client to the rpc.mountd service on NFS servers. A timeout of 30 seconds is used when making calls to rpc.mountd. vers=[2|3|4] Specifies NFS version. The default is the version of NFS protocol used between the client and server and is the highest one available on both systems. If the NFS server does not support NFS Version 3, the NFS mount will use NFS Version 2. Use the vers=[2|3|4] option to select the NFS version. By default, the NFS mount will never use NFS Version 4 unless specified. The vers=4 only applies to AIX 5.3 or later. wsize=n Sets the write buffer size to n bytes. Beginning with AIX Version 6.1, the default value is 64 KB and the maximum value is 512 KB when using Version 3 and Version 4 of the NFS protocol.
  • CacheFS Specific Options

The CacheFS-specific version of the mount command mounts a cached file system; if necessary, it NFS-mounts its back file system. It also provides a number of CacheFS-specific options for controlling the caching process.

To mount a CacheFS file system, use the mount command with the -V flag followed by the argument. The following mount flags are available.

The following arguments to the -o flag are specifically for CacheFS mounts. Options you enter on the command line should be separated only by a comma, not a comma and a space.

Note: The backfstype argument must be specified.

  • -o — Specifies options. acdirmax=n Specifies that cached attributes are held for no more than n seconds after directory update. Before n seconds, CacheFS checks to see if the directory modification time on the back file system has changed. If it has, all information about the directory is purged from the cache and new data is retrieved from the back file system. The default value is 60 seconds. acdirmin=n Specifies that cached attributes are held for at least n seconds after directory update. After n seconds, CacheFS checks to see if the directory modification time on the back file system has changed. If it has, all information about the directory is purged from the cache and new data is retrieved from the back file system. The default value is 30 seconds. acregmax=n Specifies that cached attributes are held for no more than n seconds after file modification. After n seconds, all file information is purged from the cache. The default value is 30 seconds. acregmin=n Specifies that cached attributes are held for at least n seconds after file modification. After n seconds, CacheFS checks to see if the file modification time on the back file system has changed. If it has, all information about the file is purged from the cache and new data is retrieved from the back file system. The default value is 30 seconds. actimeo=n Sets acregmin, acregmax, acdirmin, and acdirmax to n. backfstype=file_system_type The file system type of the back file system (for example, nfs). backpath=path Specifies where the back file system is already mounted. If this argument is not supplied, CacheFS determines a mount point for the back file system. cachedir=directory The name of the cache directory. cacheid=ID ID is a string specifying a particular instance of a cache. If you do not specify a cache ID, CacheFS will construct one. demandconst Enables maximum cache consistency checking. By default, periodic consistency checking is enabled. When you enable demandconst, it checks on every read and write. Note: If this option is used the first time a specific CacheFS is mounted, then the option must also be specified for subsequent mounts. There is state information stored in the cache control files that enforces consistent use of this option. local_access Causes the front file system to interpret the mode bits used for access checking instead or having the back file system verify access permissions. Do not use this argument with secure NFS. noconst Disables cache consistency checking. By default, periodic consistency checking is enabled. Specify noconst only when you know that the back file system will not be modified. Trying to perform cache consistency check using cfsadmin-s will result in error. demandconst and noconst are mutually exclusive. Note: If this option is used the first time a specific CacheFS is mounted, then the option must also be specified for subsequent mounts. There is state information stored in the cache control files that enforces consistent use of this option. purge Purges any cached information for the specified file system. Note: If this option is used the first time a specific CacheFS is mounted, then the option must also be specified for subsequent mounts. There is state information stored in the cache control files that enforces consistent use of this option. rw | ro Read-write (default) or read-only. suid | nosuid Allows (default) or disallows set-uid execution write-around | non-shared Writes modes for CacheFS. The write-around mode (the default) handles writes the same as NFS does; that is, writes are made to the back file system, and the affected file is purged from the cache. You can use the non-shared mode when you are sure that no one else will be writing to the cached file system. Note: If this option is used the first time a specific CacheFS is mounted, then the option must also be specified for subsequent mounts. There is state information stored in the cache control files that enforces consistent use of this option. mfsid Turns on global view. In NFS v4 system, you can traverse through the exported namespace on the server side. You need to specify this option to go over the file system. Restriction: mfsid is an option if the backend file system for CacheFS is NFS v4.
  • -V — Mounts a CacheFS file system.

보안

RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다(6.1 문서에만 있음).

영어 원문

Attention RBAC users and Trusted AIX users: This command can perform privileged operations. Only privileged users can run privileged operations. For more information about authorizations and privileges, see Privileged Command Database in Security. For a list of privileges and the authorizations associated with this command, see the lssecattr command or the getcmdattr subcommand.

예제

  1. 마운트된 파일 시스템을 봅니다. 파일 시스템마다 노드 이름, 장치 이름, 마운트 위치, VFS 유형, 마운트 시각, 옵션이 나옵니다.
text
$ mount
  node       mounted          mounted over  vfs  date          options
-------- ---------------- ------------ ---- ------------ ---------------
         /dev/hd0         /            jfs  Dec 17 08:04 rw,log=/dev/hd8
         /dev/hd3         /tmp         jfs  Dec 17 08:04 rw,log=/dev/hd8
sue      /home/local/src  /usr/code    nfs  Dec 17 08:06 ro,log=/dev/hd8
  1. 그 밖의 예:
명령 하는 일
mount all /etc/filesystems에서 mount=true인 표준 파일 시스템을 모두 마운트
mount -n nodeA /home/tom.remote /home/tom.local nodeA의 /home/tom.remote를 로컬 /home/tom.local에 마운트. 기본 VfsName remote가 /etc/vfs에 있어야 함
mount -t remote /etc/filesystems에서 type=remote인 것을 모두 마운트
mount -o snapshot /dev/snapsb /home/janet/snapsb /dev/snapsb의 스냅숏을 마운트
mount -o snapto=/dev/snapsb /dev/sb /home/janet/sb /dev/sb를 마운트하며 /dev/snapsb에 스냅숏을 만듦
mount -v cifs -n pezman/user1/pass1 -o uid=201,fmode=750 /home /mnt SMB 서버의 파일을 로컬 파일 시스템처럼 마운트
mount -o remount,rw fsname (6.1) 읽기 전용으로 마운트한 JFS2를 읽기·쓰기로 다시 마운트
mount -F /tmp/fs1 all (6.1) 다른 파일 시스템 정의 파일 /tmp/fs1의 것을 모두 마운트

이미 /usr/abc에 NFS로 마운트한 파일 시스템을 CacheFS로 마운트합니다. 실행하면 /etc/mnttab에 server1:/user2 /usr/abc nfs, /usr/abc /cache1/xyz cachefs backfstype=nfs 같은 줄이 생깁니다.

bash
mount -V cachefs -o backfstype=nfs,backpath=/usr/abc,cachedir=/cache1 server1:/user2 /xyz

자주 쓰는 형태:

bash
mount | grep -w jfs2                                  # 마운트된 JFS2
mount /data                                           # /etc/filesystems 기준
mount -o vers=3,hard,intr,proto=tcp nfssrv:/export /mnt
mount -o cio /dev/oradatalv /oradata                  # DB 데이터 파일용 동시 I/O
lsfs -q /data                                         # 마운트 옵션·크기 정의 확인
영어 원문
  1. To list the mounted file systems, enter the following command:
mount

This command produces output similar to the following:

node mounted mounted over vfs date options
---- ------- ------------ --- ------------ -------------------
      /dev/hd0 / jfs Dec 17 08:04 rw, log =/dev/hd8
      /dev/hd3 /tmp jfs Dec 17 08:04 rw, log =/dev/hd8
      /dev/hd1 /home jfs Dec 17 08:06 rw, log =/dev/hd8
      /dev/hd2 /usr jfs Dec 17 08:06 rw, log =/dev/hd8
sue /home/local/src /usr/code nfs Dec 17 08:06 ro, log =/dev/hd8

For each file system, the mount command lists the node name, the device name, the name under which it is mounted, the virtual-file-system type, the date and time it was mounted, and its options.

  1. To mount all default file systems, enter the following command:
mount all

This command sequence mounts all standard file systems in the /etc/file systems file marked by the mount=true attribute.

  1. To mount a remote directory, enter the following command:
mount -n nodeA /home/tom.remote /home/tom.local

This command sequence mounts the /home/tom.remote directory located on nodeA onto the local /home/tom.local directory. It assumes the default VfsName parameter=remote, which must be defined in the /etc/vfs file.

  1. To mount a file or directory from the /etc/file systems file with a specific type, enter the following command:
mount -t remote

This command sequence mounts all files or directories in the /etc/file systems file that have a stanza that contains the type=remote attribute.

  1. To CacheFS-mount the file system which is already NFS-mounted on /usr/abc, enter the following command:
mount -V cachefs -o backfstype=nfs,backpath=/usr/abc,
cachedir=/cache1 server1:/user2 /xyz

The lines similar to the following appear in the /etc/mnttab file after the mount command is executed:

server1:/user2 /usr/abc nfs
/usr/abc /cache1/xyz cachefs backfstype=nfs
  1. To mount a snapshot, enter the following command:
mount -o snapshot /dev/snapsb /home/janet/snapsb

This command mounts the snapshot contained on the /dev/snapsb device onto the /home/janet/snapsb directory.

  1. To mount a file system and create a snapshot, enter the following command:
mount -o snapto=/dev/snapsb /dev/sb /home/janet/sb

This command mounts the file system contained on the /dev/sbdevice onto the /home/janet/sb directory and creates a snapshot for the file system on the /dev/snapsbdevice.

  1. To access files on an SMB server as a local file system, enter the following command:
mount -v cifs -n pezman/user1/pass1 -o uid=201,fmode=750 /home /mnt
  1. To remount the mounted read-only JFS2 file system to a read-write file system, enter the following command:
mount -o remount,rw fsname
  1. To mount all on a file /tmp/fs1 of an alternate file system, enter the following command:
mount -F /tmp/fs1 all

파일

파일 설명
/etc/filesystems 알려진 파일 시스템과 그 특성
/etc/vfs 가상 파일 시스템 유형 설명
영어 원문
  • /etc/file systems — Lists the known file systems and defines their characteristics.
  • /etc/vfs — Contains descriptions of virtual-file-system types.

Related information:

  • cdumount command
  • umount command
  • mount subroutine
  • /etc/filesystems file

리눅스(GNU)와 다른 점

리눅스 mount도 인수 없이 마운트 목록을, mount /data로 /etc/fstab 기준 마운트를, mount -a로 모두 마운트를 합니다. 유형은 -t xfs|ext4|nfs|cifs, 옵션은 -o ro,noatime,remount 등 비슷합니다. AIX의 cio·dio·rbrw처럼 파일 시스템 전체에 직접 I/O를 거는 옵션은 리눅스에 없고 응용 프로그램이 O_DIRECT로 엽니다. NFS 옵션(vers, hard, rsize, wsize, timeo, proto)은 거의 같습니다.