showmount 명령어 (AIX 5.3·6.1)

핵심 정리

  • NFS 서버의 mountd에 물어 그 서버에서 내보낸(export) 디렉터리와 그것을 마운트한 클라이언트를 보여 줍니다.
  • showmount -e 서버(내보낸 디렉터리 목록), showmount -a 서버(클라이언트:디렉터리), showmount -d 서버(마운트된 디렉터리만). 서버를 주지 않으면 자기 호스트입니다.
  • 클라이언트에서 showmount -e 서버가 되면 NFS 서버의 mountd와 포트맵퍼까지 통한다는 뜻이라 마운트 문제를 볼 때 먼저 씁니다.
  • 마운트 기록은 서버의 /etc/rmtab에 남습니다. 클라이언트가 비정상으로 끝나면 다시 부팅해 umount -a를 할 때까지 목록에 남습니다.
  • NFS 버전 4는 mountd를 쓰지 않으므로 v4 마운트는 보이지 않습니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (두 버전의 내용이 같음)
원문 IBM Commands Reference — 5.3 Volume 5, 6.1 Volume 5
파일 /usr/bin/showmount, /etc/rmtab, /etc/xtab
관련 명령어 exportfs, mount, umount, mountd, rpcinfo

목적

원격으로 파일 시스템을 마운트한 모든 클라이언트 목록을 보여 줍니다.

영어 원문

Displays a list of all clients that have remotely mounted file systems.

구문

text
/usr/bin/showmount [ -a ] [ -d ] [ -e ] [ Host ]

설명

showmount 명령은 Host 매개변수로 지정한 머신에서 파일 시스템을 원격으로 마운트한 모든 클라이언트 목록을 보여 줍니다. 이 정보는 그 호스트의 mountd 데몬이 관리하며, 서버가 비정상으로 끝날 때를 대비해 /etc/rmtab에 저장됩니다. Host의 기본값은 hostname 명령이 돌려주는 값입니다.

참고: 클라이언트가 비정상으로 끝나면 그 클라이언트가 다시 부팅해 umount -a를 실행할 때까지 항목이 목록에서 지워지지 않습니다.

참고: showmount는 mountd 데몬이 관리하는 정보를 돌려줍니다. NFS 버전 4는 mountd를 쓰지 않으므로 버전 4 마운트 정보는 보여 주지 않습니다.

영어 원문

The showmount command displays a list of all clients that have remotely mounted a file system from a specified machine in the Host parameter. This information is maintained by the mountd daemon on the Host parameter. This information is saved in the /etc/rmtab file in case the server crashes. The default value for the Host parameter is the value returned by the hostname command.

Note: If a client crashes, its entry will not be removed from the list until the client reboots and starts the umount -a command.

Note: The showmount command returns information maintained by the mountd daemon. Because NFS Version 4 does not use the mountd daemon, showmount will not return information about version 4 mounts.

플래그

플래그 설명
-a 모든 원격 마운트를 HostName:Directory 형식으로 출력합니다. HostName은 클라이언트 이름, Directory는 원격으로 마운트된 디렉터리 경로입니다.
-d 클라이언트가 원격으로 마운트한 디렉터리만 나열합니다.
-e 내보낸 디렉터리 목록을 출력합니다.
영어 원문
  • -a — Prints all remote mounts in the format HostName:Directory, in which HostName is the name of the client and Directory is a directory pathname that has been remotely mounted.
  • -d — Lists only directories that have been remotely mounted by clients.
  • -e — Prints the list of exported directories.

예제

명령 하는 일
/usr/bin/showmount -a zeus 호스트 zeus에서 클라이언트들이 마운트한 모든 원격 디렉터리 목록
/usr/bin/showmount -d athena 호스트 athena에서 클라이언트들이 마운트한 디렉터리만
/usr/bin/showmount -e zeus 호스트 zeus가 내보낸 모든 디렉터리(NFS 버전 4로만 내보낸 것은 빠짐)

자주 쓰는 형태:

bash
showmount -e nfsserver           # 클라이언트에서 서버의 공유 목록 확인
showmount -a                     # 서버에서 누가 무엇을 마운트했는지
rpcinfo -p nfsserver | grep mountd   # showmount가 안 되면 mountd가 등록됐는지 확인
영어 원문
  1. To display a list of all remote directories that are mounted by a host, enter the following command:

/usr/bin/showmount -a zeus

In this example, the showmount command produces a list of all of the remote directories mounted by the clients on the host machine named zeus.

  1. To display a list of only the directories that are mounted by a client on the host, enter the following command:

/usr/bin/showmount -d athena

In this example, the showmount command produces a list of all remote directories mounted by the client machines on the host named athena.

  1. To print a list of all directories that are exported from a machine, enter the following command:

/usr/bin/showmount -e zeus

In this example, the showmount command produces a list of all remote directories that are exported by the host machine named zeus except the ones that are exported only with NFS version 4.

파일

파일 설명
/etc/rmtab 내보낸 모든 디렉터리의 현재 마운트 상태
/etc/xtab 지금 내보낸 디렉터리 목록
영어 원문
  • /etc/rmtab — Contains information about the current state of all exported directories.
  • /etc/xtab — Lists currently exported directories.

Related reference:

  • umount or unmount Command

Related information:

  • hostname command
  • mountd command
  • xtab File for NFS
  • Network file system

리눅스(GNU)와 다른 점

리눅스에도 같은 showmount(nfs-utils)가 있으며 -e, -a, -d의 뜻이 같습니다. 서버 쪽에서는 exportfs -v로 내보낸 목록과 옵션을 봅니다. NFSv4만 쓰는 서버에서는 showmount -e가 실패할 수 있어, 그때는 mount -t nfs4 서버:/ /mnt로 의사 루트를 마운트해 봅니다.