umount 명령어 (AIX 5.3·6.1)

핵심 정리

  • 마운트한 장치, 디렉터리, 파일, 파일 시스템을 내립니다. umount와 unmount는 같은 명령입니다.
  • umount /data(마운트 지점), umount all(모두), umount allr(원격 마운트 모두), umount -n node(그 노드의 원격 마운트), umount -t type.
  • 파일이 열려 있거나 누군가의 현재 디렉터리면 내릴 수 없습니다(Device busy). fuser -cu /data로 쓰는 프로세스를 찾아 정리한 뒤 내립니다.
  • -f는 강제로 내립니다. NFS는 서버가 죽었을 때, 6.1의 로컬 JFS2는 사용 중일 때 씁니다. 원격에서는 아직 서버로 보내지 않은 데이터를 잃습니다.
  • 스냅숏이 마운트된 JFS2는 스냅숏부터 내려야 합니다. 스냅숏을 내려도 스냅숏 자체는 남으며, 지우려면 snapshot -d를 씁니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 -f를 로컬 JFS2에도 쓸 수 있게 되고, 5.3은 원격 마운트에만 썼음)
원문 IBM Commands Reference — 5.3 Volume 5, 6.1 Volume 5
파일 /usr/sbin/umount, /etc/filesystems
관련 명령어 mount, fuser, cdumount, snapshot

목적

마운트한 파일 시스템, 디렉터리, 파일을 내립니다.

영어 원문

Unmounts a previously mounted file system, directory, or file.

구문

text
{ unmount | umount } [ -f ] [ -a ] | [ all | allr | Device | Directory | File | FileSystem | -n Node | -t Type ]

설명

umount 명령은 unmount라고도 하며 어느 이름이든 쓸 수 있습니다. SMIT(smit umount)로도 실행할 수 있습니다.

umount는 마운트한 장치, 디렉터리, 파일, 파일 시스템을 내립니다. 그 위의 처리가 끝나면 내립니다. system 그룹 구성원과 root는 어떤 umount든 할 수 있고, 디렉터리나 파일을 내리는 것은 root나 system 그룹 구성원만 할 수 있습니다.

참고: SMIT는 SMIT 도움말이 있는 /usr/lpp/info/$LANG 디렉터리(보통 CD-ROM)는 내리지 않습니다.

로컬 마운트는 마운트한 장치, 디렉터리, 파일, 파일 시스템 가운데 하나를 주어 내립니다.

내리는 것이 JFS2 스냅숏이면 스냅숏을 내리지만 스냅숏은 여전히 활성 상태입니다. 지우려면 snapshot 명령을 씁니다.

내리는 것이 스냅숏이 마운트된 원본(snapped) 파일 시스템이면, 마운트된 스냅숏이 있다는 경고를 보여 주고 내리지 않고 끝납니다. 스냅숏부터 내려야 합니다.

참고: cdromd 자동 마운트 데몬이 켜져 있으면 CD·DVD는 /etc/cdromd.conf대로 자동 마운트됩니다. 내리려면 cdumount나 cdeject를, 데몬을 끄려면 stopsrc -s cdromd를 씁니다.

영어 원문

Another name for the umount command is the unmount command. Either name can be used. You can use the System Management Interface Tool (SMIT) to run this command. To use SMIT, enter: smit umount

The umount command unmounts a previously mounted device, directory, file, or file system. Processing on the file system, directory, or file completes and it is unmounted. Members of the system group and users operating with root user authority can issue any umount command. Only users with root authority or are members of the system group can unmount a directory or file.

Note: SMIT will not unmount the /usr/lpp/info/$LANG directory, the directory on which SMIT helps are located. Typically, this is the CD-ROM.

To unmount local mounts you can specify the device, directory, file, or file system on which it is mounted.

If the file system being unmounted is a JFS2 snapshot, the umount command will unmount the snapshot, though the snapshot will still be active. The snapshot command must be used to delete the snapshot.

If the file system being unmounted is a snapped file system with mounted snapshots, the umount command displays a warning that there are mounted snapshots and exits without unmounting the file system. The snapshots must be unmounted first.

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

플래그

플래그 설명
-a, all 마운트한 파일 시스템을 모두 내립니다.
allr 원격으로 마운트한 파일 시스템을 모두 내립니다. 원격 마운트는 장치, 디렉터리, 파일, 파일 시스템 매개변수로도 내릴 수 있습니다.
-f 강제로 내립니다. 원격 마운트에서는 서버가 죽어 서버 경로를 풀 수 없거나 사용 중인데도 내려야 할 때 클라이언트를 풀어 줍니다. 이때 close(), unmap()을 뺀 모든 파일 작업이 실패하고, 응용 프로그램이 썼지만 서버로 아직 보내지 않은 데이터는 잃습니다. NFS v4를 강제로 내리면 같은 서버에서 마운트한 다른 파일 시스템의 열린 파일 상태도 잃을 수 있습니다. (6.1) 로컬 JFS2에서는 사용 중이어도 내려야 할 때 씁니다(다른 저널 파일 시스템에는 쓸 수 없음). 다만 하위 디렉터리나 파일 위에 다른 것이 마운트되어 있거나, 외부 스냅숏이 마운트되어 있거나 열려 있으면 강제로도 내릴 수 없습니다.
-n Node 마운트한 디렉터리를 가진 노드. umount -n Node는 그 노드에서 마운트한 원격 마운트를 모두 내립니다.
-t Type /etc/filesystems에서 type=Type인 스탠자 가운데 마운트된 것을 모두 내립니다. Type은 remote처럼 그룹 이름을 나타내는 문자열입니다.

참고: 사용 중인 장치는 내릴 수 없습니다. 어떤 이유로든 파일이 열려 있거나 사용자의 현재 디렉터리가 그 장치에 있으면 사용 중입니다.

영어 원문
  • -a — Unmounts all mounted file systems.
  • all — Unmounts all mounted file systems.
  • allr — Unmounts all remotely mounted file systems. Note: For remote mounts, specify the device, directory, file, or file system parameters. If you specify the allr flag, the umount command unmounts all remote mounts.
  • -f — For remote mounted file systems, the –f flag forces an unmount to free a client when the server is down and server path names cannot be resolved, or when a file system must be unmounted while it is still in use. Note: For remote file systems, using this flag causes all file operations on the file system except close() and unmap() to fail. Any file data that has been written by an application but has not yet transferred to the server will be lost. A forced unmount of an NFS version 4 file system can cause open file state for other file systems mounted from the same server to be lost as well. For local JFS2 file systems, the –f flag forces an unmount when a file system must be unmounted while it is still in use. Note: You can use the -f flag only in JFS2 file systems, not in other journaled file systems. The following restrictions are applied on a forced unmount of a JFS2 file system: • The –f flag cannot force an unmount of a file system if a subdirectory or a file is overmounted on the file system. • The–f flag cannot force an unmount of a file system with mounted or open external snapshots until those snapshots are forced unmounted.
  • -n Node — Specifies the node holding the mounted directory you want to unmount. The umount -n Node command unmounts all remote mounts made from the Node parameter.
  • -t Type — Unmounts all stanzas in the /etc/filesystems file that contain the type=Type flag and are mounted. The Type parameter is a string value, such as the remote value that specifies the name of the group.
  • Note: You cannot use the umount command on a device in use. A device is in use if any file is open

for any reason or if a user's current directory is on that device.

보안

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.

예제

명령 하는 일
umount -n nodeA 원격 노드 nodeA에서 마운트한 것을 모두 내림
umount -t test /etc/filesystems에서 type=test인 파일과 디렉터리를 모두 내림

자주 쓰는 형태:

bash
umount /data
fuser -cu /data              # Device busy일 때 쓰는 프로세스와 사용자
fuser -kxuc /data            # 그 프로세스를 끝냄(주의)
umount -f /mnt/nfs           # 응답 없는 NFS 강제 해제
영어 원문
  1. To unmount all mounts from remote node Node A, enter:

umount -n nodeA

  1. To unmount files and directories of a specific type, enter:

umount -t test

This unmounts all files or directories that have a stanza in the /etc/filesystems file that contains the type=test attribute.

파일

파일 설명
/etc/filesystems 알려진 파일 시스템과 그 특성
영어 원문
  • /etc/filesystems — Lists the known file systems and defines their characteristics.

Related information:

  • cdcheck command
  • System Management Interface Tool (SMIT)
  • Mounting command

리눅스(GNU)와 다른 점

리눅스 umount도 umount /data, umount -a, umount -t nfs, umount -f(주로 NFS)를 씁니다. 사용 중일 때는 umount -l(lazy, 나중에 풂)이 있고, 쓰는 프로세스는 fuser -vm /data나 lsof +f -- /data로 찾습니다. 리눅스에는 unmount라는 이름이 없습니다.