[AIX 운영 체제와 장치 관리 39] 파일 시스템 (1) — 파일 트리 구성, 루트·/usr·/usr/share·/var·/export, JFS2 암호화(EFS), SMIT 빠른 경로, df와 파일 시스템 명령, 다른 기계의 파일 시스템 비교

핵심 정리

  • 파일 시스템은 논리 볼륨 하나에 있는 파일 트리이며 디렉터리 마운트 지점에 마운트해야 접근할 수 있습니다. /etc/filesystems에 정의하면 자동으로 마운트되며, AIX 기본 형은 JFS이고 JFS2도 지원합니다. LV당 논리 파티션 최대는 32,512입니다.
  • 기본 배치는 /dev/hd1=/home, hd2=/usr, hd3=/tmp, hd4=/, hd9var=/var, hd10opt=/opt, /proc입니다. /usr은 같은 아키텍처끼리 공유하는 읽기 전용, /usr/share는 아키텍처 독립, /var는 커지는 가변 파일, /export는 디스크 없는 클라이언트용 자원입니다.
  • /bin, /lib, /u는 각각 /usr/bin, /usr/lib, /home으로 가는 심볼릭 링크이고, /usr/adm·mail·spool·tmp 등은 /var 쪽 링크입니다. /var는 /var/adm/wtmp와 errlog를 주기적으로 살핍니다.
  • AIX 6.1부터 JFS2에서 암호화 파일 시스템(EFS)을 쓸 수 있으며 기본은 꺼져 있어 efsenable로 켭니다.
  • df는 슈퍼블록의 빈 공간 수를 쓰므로 활발히 바뀌는 중에는 정확하지 않을 수 있습니다. chfs·crfs·lsfs·rmfs·mount는 /etc/filesystems를, chvfs·crvfs·lsvfs·rmvfs는 /etc/vfs를 다룹니다.
항목 내용
버전 AIX 6.1 (5.3판과 거의 같음, EFS 절 추가)
원문 Operating system and device management — 5.3판 96107쪽, 6.1판 414424쪽
관련 명령어 mkfs, crfs, chfs, lsfs, rmfs, mount, umount, df, fsck, snapshot, efsenable, rdist
관련 파일 /etc/filesystems, /etc/vfs, .rhosts

파일 시스템은 파일과 디렉터리의 계층 구조(파일 트리)입니다.

이 구조는 뿌리가 위에, 가지가 아래에 있는 거꾸로 선 나무와 닮았습니다. 이 파일 트리는 디렉터리로 데이터와 프로그램을 묶어 여러 디렉터리와 파일을 한꺼번에 관리할 수 있게 합니다.

파일 시스템은 논리 볼륨 하나에 있습니다. 모든 파일과 디렉터리는 논리 볼륨 안의 파일 시스템에 속합니다. 이 구조 때문에 어떤 작업은 파일 시스템 안의 디렉터리마다 하는 것보다 파일 시스템 단위로 하는 것이 효율적입니다. 예를 들어 파일 시스템 전체를 백업하거나, 옮기거나, 보안을 걸 수 있습니다. JFS나 JFS2 파일 시스템의 시점 이미지인 스냅숏을 만들 수 있습니다.

참고: 논리 볼륨당 논리 파티션 최대 수는 32,512입니다. 파일 시스템 논리 볼륨 특성에 관한 자세한 내용은 chlv 명령을 봅니다.

mkfs(make file system) 명령이나 SMIT(smit 명령)가 논리 볼륨에 파일 시스템을 만듭니다.

파일 시스템에 접근하려면 디렉터리 마운트 지점에 마운트해야 합니다. 파일 시스템을 여럿 마운트하면 하나의 파일 시스템처럼 보이는 디렉터리 구조가 만들어집니다. 뿌리가 하나인 계층 구조입니다. 이 구조에는 기본 파일 시스템과 사용자가 만든 파일 시스템이 들어갑니다. mount 명령으로 로컬과 원격 파일 시스템 모두에 접근할 수 있습니다. 그러면 시스템에서 파일 시스템을 읽고 쓸 수 있습니다. 파일 시스템을 마운트하거나 해제하려면 보통 system 그룹 구성원이어야 합니다. /etc/filesystems 파일에 정의된 파일 시스템은 자동으로 마운트할 수 있습니다. 사용자나 프로세스가 접근하고 있지 않으면 umount 명령으로 로컬이나 원격 파일 시스템을 마운트 해제할 수 있습니다. 파일 시스템 마운트에 관한 자세한 내용은 마운트를 봅니다.

AIX가 쓰는 기본 파일 시스템 형은 저널 파일 시스템(JFS)입니다. 이 파일 시스템은 데이터베이스 저널링 기법으로 구조적 일관성을 유지합니다. 그래서 시스템이 비정상적으로 멈춰도 파일 시스템이 손상되지 않습니다.

AIX 운영 체제는 저널 파일 시스템(JFS)과 향상된 저널 파일 시스템(JFS2)을 포함한 여러 파일 시스템 형을 지원합니다. 파일 시스템 형과 각 형의 특성은 파일 시스템 형을 봅니다.

가장 중요한 시스템 관리 작업 가운데 일부는 파일 시스템과 관련됩니다.

  • 논리 볼륨에 파일 시스템 공간 할당
  • 파일 시스템 만들기
  • 시스템 사용자가 파일 시스템 공간을 쓸 수 있게 하기
  • 파일 시스템 공간 사용 감시
  • 시스템이 고장 날 때 데이터 손실에 대비한 파일 시스템 백업
  • 파일 시스템을 일관된 상태로 유지

이 작업은 시스템 관리자가 해야 합니다.

관련 개념

  • 파일 시스템(논리 볼륨 저장소 개념의 절)

관련 작업

  • JFS2 스냅숏 만들기와 백업, 외부 스냅숏, 내부 스냅숏 — 마운트된 JFS2의 시점 블록 수준 이미지를 만들 수 있습니다.
영어 원문

File systems

A file system is a hierarchical structure (file tree) of files and directories.

This type of structure resembles an inverted tree with the roots at the top and branches at the bottom. This file tree uses directories to organize data and programs into groups, allowing the management of several directories and files at one time.

A file system resides on a single logical volume. Every file and directory belongs to a file system within a logical volume. Because of its structure, some tasks are performed more efficiently on a file system than on each directory within the file system. For example, you can back up, move, or secure an entire file system. You can make an point-in-time image of a JFS file system or a JFS2 file system, called a snapshot.

Note: The maximum number of logical partitions per logical volume is 32,512. For more information on file system logical volume characteristics, see the chlv command.

The mkfs (make file system) command or the System Management Interface Tool (smit command) creates a file system on a logical volume.

To be accessible, a file system must be mounted onto a directory mount point. When multiple file systems are mounted, a directory structure is created that presents the image of a single file system. It is a hierarchical structure with a single root. This structure includes the base file systems and any file systems you create. You can access both local and remote file systems using the mount command. This makes the file system available for read and write access from your system. Mounting or unmounting a file system usually requires system group membership. File systems can be mounted automatically, if they are defined in the /etc/filesystems file. You can unmount a local or remote file system with the umount command, unless a user or process is accessing that file system. For more information on mounting a file system, see Mounting.

The basic type of file system used by AIX is called the journaled file system (JFS). This file system uses database journaling techniques to maintain its structural consistency. This prevents damage to the file system when the system is halted abnormally.

The AIX operating system supports multiple file system types including the journaled file system (JFS) and the enhanced journaled file system (JFS2). For more information on file system types and the characteristics of each type, see File system types.

Some of the most important system management tasks have to do with file systems, specifically:

  • Allocating space for file systems on logical volumes

  • Creating file systems

  • Making file system space available to system users

  • Monitoring file system space usage

  • Backing up file systems to guard against data loss if the system fails

  • Maintaining file systems in a consistent state

These tasks should be performed by your system administrator.

Related concepts

File systems The logical volume defines allocation of disk space down to the physical-partition level. Finer levels of data management are accomplished by higher-level software components such as the Virtual Memory Manager or the file system. Therefore, the final step in the evolution of a disk is the creation of file systems.

Related tasks

Making and backing up a snapshot of a JFS2 You can make a snapshot of a mounted JFS2 that establishes a consistent block-level image of the file system at a point in time. Making and backing up an external snapshot of a JFS2 You can make a snapshot of a mounted JFS2 that establishes a consistent block-level image of the file system at a point in time. Making and backing up an internal snapshot of a JFS2 You can make a snapshot of a mounted JFS2 that establishes a consistent block-level image of the file system at a point in time.

파일 시스템 개념

파일 시스템을 관리하고 구성하려면 먼저 파일 트리의 기본 구성과 내용을 알아야 합니다.

파일 트리의 구성과 내용

파일 트리는 파일을 비슷한 정보를 담은 디렉터리로 묶습니다. 이 구성 덕분에 디렉터리와 파일을 원격 마운트하기 쉽습니다.

시스템 관리자는 이 디렉터리를 구성 단위로 써서 서버 하나 이상에서 개별 디렉터리를 마운트하는 클라이언트마다 고유한 파일 트리를 만들 수 있습니다. 모든 정보를 로컬에 두지 않고 파일과 디렉터리를 원격 마운트하면 다음 이점이 있습니다.

  • 디스크 공간을 아낍니다.
  • 시스템 관리를 쉽게 중앙에서 할 수 있습니다.
  • 더 안전한 환경을 제공합니다.

파일 트리에는 다음 특징이 있습니다.

  • 같은 하드웨어 아키텍처 기계가 공유할 수 있는 파일은 /usr 파일 시스템에 있습니다.
  • 스풀과 메일 파일처럼 클라이언트마다 바뀌는 파일은 /var 파일 시스템에 있습니다.
  • 매뉴얼 페이지처럼 아키텍처와 무관하게 공유할 수 있는 텍스트 파일은 /usr/share 디렉터리에 있습니다.
  • /(루트) 파일 시스템에는 시스템 운영에 중요한 파일과 디렉터리가 있습니다. 예를 들어 장치 디렉터리, 시스템 시작에 쓰는 프로그램, 루트 파일 시스템에 파일 시스템을 마운트할 마운트 지점이 있습니다.
  • /home 파일 시스템은 사용자 홈 디렉터리의 마운트 지점입니다.

파일 시스템 구조

파일 시스템과 디렉터리의 차이를 아는 것이 중요합니다. 파일 시스템은 파일을 담으려고 할당한 하드 디스크 구역입니다. 이 구역은 디렉터리 위에 파일 시스템을 마운트해 접근합니다. 마운트하면 최종 사용자에게는 다른 디렉터리와 똑같이 보입니다.

그러나 파일 시스템과 디렉터리는 구조가 다르므로 그 안의 데이터를 따로 관리할 수 있습니다.

운영 체제를 처음 설치하면 원문 그림 7과 같은 디렉터리 구조에 적재됩니다.

오른쪽 디렉터리(/usr, /tmp, /var, /home)는 모두 파일 시스템이므로 하드 디스크의 별도 구역이 할당돼 있습니다. 이 파일 시스템은 시스템을 시작할 때 자동으로 마운트되므로 최종 사용자는 이 파일 시스템과 왼쪽 디렉터리(/bin, /dev, /etc, /lib)의 차이를 느끼지 못합니다.

독립 실행형 기계에서는 다음 파일 시스템이 기본으로 해당 장치에 있습니다.

장치 파일 시스템
/dev/hd1 /home
/dev/hd2 /usr
/dev/hd3 /tmp
/dev/hd4 /(루트)
/dev/hd9var /var
/proc /proc
/dev/hd10opt /opt

파일 트리에는 다음 특징이 있습니다.

  • 같은 하드웨어 아키텍처 기계가 공유할 수 있는 파일은 /usr 파일 시스템에 있습니다.
  • 스풀과 메일 파일처럼 클라이언트마다 바뀌는 파일은 /var 파일 시스템에 있습니다.
  • /(루트) 파일 시스템에는 시스템 운영에 중요한 파일과 디렉터리가 있습니다. 예를 들어 장치 디렉터리(/dev)와 루트 파일 시스템에 파일 시스템을 마운트할 마운트 지점(예: /mnt)이 있습니다.
  • /home 파일 시스템은 사용자 홈 디렉터리의 마운트 지점입니다.
  • 서버에서 /export 디렉터리에는 디스크 없는 클라이언트용 페이징 공간 파일, 클라이언트별(공유하지 않는) 루트 파일 시스템, dump, home, /usr/share 디렉터리와 내보낸 /usr 디렉터리가 있습니다.
  • /proc 파일 시스템에는 시스템의 프로세스와 스레드 상태 정보가 있습니다.
  • /opt 파일 시스템에는 응용 프로그램 같은 선택 소프트웨어가 있습니다.

다음은 /(루트) 파일 시스템의 일부 하위 디렉터리 내용입니다.

디렉터리 내용
/bin /usr/bin 디렉터리에 대한 심볼릭 링크
/dev 로컬 장치의 특수 파일용 장치 노드. 테이프 드라이브, 프린터, 디스크 파티션, 터미널의 특수 파일이 있습니다.
/etc 기계마다 다른 구성 파일. 예: /etc/hosts, /etc/passwd
/export 서버에서 원격 클라이언트용 디렉터리와 파일
/home 사용자 홈 디렉터리가 든 파일 시스템의 마운트 지점. 사용자별 파일과 디렉터리가 있습니다. 독립 실행형 기계에서는 별도 로컬 파일 시스템을 /home 디렉터리 위에 마운트합니다. 네트워크에서는 여러 기계에서 접근할 사용자 파일을 서버에 둘 수 있으며, 이때 서버의 /home 디렉터리를 로컬 /home 파일 시스템에 원격 마운트합니다.
/lib lib*.a 꼴 이름의 아키텍처 독립 라이브러리가 든 /usr/lib 디렉터리에 대한 심볼릭 링크
/sbin 기계를 부팅하고 /usr 파일 시스템을 마운트하는 데 필요한 파일. 부팅에 쓰는 명령은 대부분 부트 이미지의 RAM 디스크 파일 시스템에서 오므로 /sbin에는 명령이 아주 적습니다.
/tmp 시스템이 만든 임시 파일이 든 파일 시스템의 마운트 지점
/u /home 디렉터리에 대한 심볼릭 링크
/usr 바뀌지 않고 기계끼리 공유할 수 있는 파일(실행 프로그램, ASCII 문서 등)이 든 파일 시스템의 마운트 지점. 독립 실행형 기계는 별도 로컬 파일 시스템을, 디스크가 없거나 적은 기계는 원격 서버의 디렉터리를 /usr 위에 마운트합니다.
/var 기계마다 바뀌는 파일의 마운트 지점. 파일이 커지는 경향이 있어 파일 시스템으로 구성합니다. 예를 들어 임시 작업 파일이 든 /usr/tmp 디렉터리가 이곳으로 가는 심볼릭 링크입니다(원문은 반대로 적음).

루트 파일 시스템

루트 파일 시스템은 계층 파일 트리의 꼭대기입니다. 장치 디렉터리와 시스템 부팅 프로그램을 포함해 시스템 운영에 중요한 파일과 디렉터리가 있습니다. 루트 파일 시스템에는 루트 파일 시스템 계층에 연결하도록 파일 시스템을 마운트할 마운트 지점도 있습니다.

원문 그림 8이 루트 파일 시스템의 여러 하위 디렉터리를 보여 줍니다.

다음은 /(루트) 파일 시스템의 일부 하위 디렉터리 내용입니다.

  • /etc — 기계마다 다른 구성 파일입니다. 예: /etc/hosts, /etc/passwd. /etc 디렉터리에는 시스템 관리에 흔히 쓰는 파일이 있습니다. 예전에 /etc 디렉터리에 있던 명령은 대부분 이제 /usr/sbin 디렉터리에 있습니다. 그러나 호환성을 위해 /usr/sbin(원문 그대로, 실제로는 /etc)에 일부 실행 파일 위치로 가는 심볼릭 링크가 있습니다. 예: /etc/chown은 /usr/bin/chown에 대한, /etc/exportvg는 /usr/sbin/exportvg에 대한 심볼릭 링크입니다.
  • /bin — /usr/bin 디렉터리에 대한 심볼릭 링크입니다. 예전 UNIX 파일 시스템에서 /bin 디렉터리에 있던 사용자 명령은 이제 /usr/bin 디렉터리에 있습니다.
  • /sbin — 기계를 부팅하고 /usr 파일 시스템을 마운트하는 데 필요한 파일입니다. 부팅에 쓰는 명령은 대부분 부트 이미지의 RAM 디스크 파일 시스템에서 오므로 /sbin에는 명령이 아주 적습니다.
  • /dev — 로컬 장치의 특수 파일용 장치 노드입니다. 테이프 드라이브, 프린터, 디스크 파티션, 터미널의 특수 파일이 있습니다.
  • /tmp — 시스템이 만든 임시 파일이 든 파일 시스템의 마운트 지점입니다. /tmp 파일 시스템은 빈 디렉터리입니다.
  • /var — 기계마다 바뀌는 파일의 마운트 지점입니다. 파일이 커지는 경향이 있어 파일 시스템으로 구성합니다. 자세한 내용은 /var 파일 시스템을 봅니다.
  • /u — /home 디렉터리에 대한 심볼릭 링크입니다.
  • /usr — 실행 파일과 ASCII 문서처럼 바뀌지 않고 기계끼리 공유할 수 있는 파일입니다. 독립 실행형 기계는 별도 로컬 파일 시스템의 루트를 /usr 디렉터리 위에 마운트합니다. 디스크가 없거나 디스크 자원이 적은 기계는 원격 서버의 디렉터리를 /usr 파일 시스템 위에 마운트합니다. /usr 디렉터리 위에 마운트하는 파일 트리는 /usr 파일 시스템을 봅니다.
  • /home — 사용자 홈 디렉터리가 든 파일 시스템의 마운트 지점입니다. 독립 실행형 기계에서는 /home 디렉터리가 별도 파일 시스템에 있고 그 루트가 루트 파일 시스템의 /home 디렉터리 위에 마운트됩니다. 네트워크에서는 서버의 /home 디렉터리 사본을 로컬 /home 파일 시스템에 원격 마운트합니다.
  • /export — 서버에서 원격 클라이언트용 디렉터리와 파일입니다. /export 아래 파일 트리는 /export 디렉터리를 봅니다.
  • /lib — /usr/lib 디렉터리에 대한 심볼릭 링크입니다.
  • /tftpboot — 디스크 없는 클라이언트용 부트 이미지와 부트 정보입니다.

/usr 파일 시스템

/usr 파일 시스템에는 기계끼리 공유할 수 있는 실행 파일이 있습니다.

원문 그림 9가 /usr 디렉터리의 주요 하위 디렉터리(/bin, /ccs, /lib, /lpp, /adm과 그 /var/adm, /man과 그 /usr/share/man)를 보여 줍니다.

독립 실행형 기계에서 /usr 파일 시스템은 (/dev/hd2 논리 볼륨의) 별도 파일 시스템입니다. 디스크가 없거나 디스크 자원이 적은 기계에서는 원격 서버의 디렉터리를 로컬 /usr 파일 시스템 위에 읽기 전용으로 마운트합니다. /usr 파일 시스템에는 읽기 전용 명령, 라이브러리, 데이터가 있습니다.

/usr/share 디렉터리 내용을 빼면 /usr 파일 시스템의 파일과 디렉터리는 같은 하드웨어 아키텍처의 모든 기계가 공유할 수 있습니다.

/usr 파일 시스템에는 다음 디렉터리가 있습니다.

디렉터리 내용
/usr/bin 일반 명령과 셸 스크립트. 예를 들어 ls, cat, mkdir 명령이 있습니다.
/usr/ccs 별도 개발 패키지 바이너리
/usr/include 포함(헤더) 파일
/usr/lbin 명령의 백엔드인 실행 파일
/usr/lib lib*.a 꼴 이름의 아키텍처 독립 라이브러리. /(루트)의 /lib는 이곳에 대한 심볼릭 링크이므로 예전 /lib의 파일은 모두 이제 /usr/lib에 있습니다. 호환성을 위한 라이브러리 아닌 파일도 몇 개 있습니다.
/usr/lpp 선택 설치 제품
/usr/sbin SMIT 명령을 포함한 시스템 관리 유틸리티. 예전에 /etc에 있던 명령은 대부분 이제 이곳에 있습니다.
/usr/share 아키텍처가 다른 기계끼리 공유할 수 있는 파일. /usr/share 디렉터리를 봅니다.

다음은 /var 디렉터리로 가는 심볼릭 링크입니다.

링크 가리키는 곳
/usr/adm /var/adm
/usr/mail /var/spool/mail
/usr/news /var/news
/usr/preserve /var/preserve
/usr/spool /var/spool
/usr/tmp /var/tmp(/usr는 여러 노드가 공유할 수 있고 읽기 전용이기 때문)

다음은 /usr/share와 /usr/lib 디렉터리로 가는 심볼릭 링크입니다.

링크 가리키는 곳
/usr/dict /usr/share/dict
/usr/man /usr/share/man
/usr/lpd /usr/lib/lpd

/usr/share 디렉터리

/usr/share 디렉터리에는 아키텍처와 무관하게 공유할 수 있는 텍스트 파일이 있습니다. 하드웨어 아키텍처와 관계없이 모든 기계가 이 디렉터리 내용을 공유할 수 있습니다.

아키텍처가 섞인 환경에서 전형적인 디스크 없는 클라이언트는 서버 디렉터리 하나를 자기 /usr 디렉터리 위에 마운트하고, 다른 디렉터리를 /usr/share 디렉터리 위에 마운트합니다. /usr/share 아래 파일은 따로 설치할 수 있는 패키지 하나 이상에 들어 있습니다. 그래서 노드는 의존하는 /usr 디렉터리의 다른 부분은 로컬에 설치하고 /usr/share 디렉터리는 서버에서 받을 수 있습니다.

원문 그림 10이 /usr/share 아래 디렉터리(/lib, /lpp, /dict, /man)를 보여 줍니다.

/usr/share 디렉터리에는 다음이 있습니다.

디렉터리 내용
/usr/share/man 매뉴얼 페이지(적재했으면)
/usr/share/dict 철자 사전과 그 색인
/usr/share/lib terminfo, learn, tmac, me, macros를 포함한 아키텍처 독립 데이터 파일
/usr/share/lpp 시스템의 선택 설치 제품에 관한 데이터와 정보

/var 파일 시스템

/var 파일 시스템은 계정, 메일, 인쇄 스풀러 같은 바쁜 응용 프로그램이 쓰는 하위 디렉터리와 데이터 파일이 있어 커지는 경향이 있습니다.

주의: 시스템의 응용 프로그램이 /var 파일 시스템을 많이 쓰면 skulker 명령을 정기적으로 실행하거나 파일 시스템 크기를 /var 기본값 4MB보다 크게 늘립니다.

주기적으로 감시해야 하는 /var 파일은 /var/adm/wtmp와 /var/adm/ras/errlog입니다.

감시할 다른 /var 파일은 다음과 같습니다.

  • /var/adm/ras/trcfile — 추적 기능이 켜져 있으면
  • /var/tmp/snmpd.log — 시스템에서 snmpd 명령이 실행 중이면

원문 그림 11이 /var 파일 시스템의 주요 하위 디렉터리를 보여 줍니다.

디렉터리 내용
/var/adm 시스템 로깅과 계정 파일
/var/news 시스템 소식
/var/preserve 중단된 편집 세션의 보존 데이터. 예전 릴리스의 /usr/preserve와 비슷합니다.
/var/spool 전자 메일 같은 프로그램이 처리 중인 파일. 예전 릴리스의 /usr/spool과 비슷합니다.
/var/tmp 임시 파일. 예전 릴리스의 /usr/tmp와 비슷하며 /usr/tmp는 이제 /var/tmp에 대한 심볼릭 링크입니다.

/export 디렉터리

/export 디렉터리에는 디스크 없는(diskless), 데이터 없는(dataless), 디스크가 적은 기계 같은 클라이언트에 내보낸 서버 파일이 있습니다.

서버는 실행 프로그램 패키지, 디스크 없는 클라이언트용 페이징 공간, 디스크 없거나 디스크 자원이 적은 클라이언트용 루트 파일 시스템 등 여러 종류의 디스크 공간을 내보낼 수 있습니다. 파일 트리에서 이런 디스크 공간의 표준 위치는 /export 디렉터리입니다. /export 디렉터리의 일부 하위 디렉터리는 다음과 같습니다.

디렉터리 내용
/exec 디스크 없는 클라이언트가 자기 /usr 파일 시스템 위에 마운트하는 디렉터리
/swap 디스크 없는 클라이언트의 원격 페이징용 파일
/share 디스크 없는 클라이언트가 자기 /usr/share 디렉터리 위에 마운트하는 디렉터리
/root 디스크 없는 클라이언트가 자기 /(루트) 파일 시스템 위에 마운트하는 디렉터리
/home 디스크 없는 클라이언트가 자기 /home 파일 시스템 위에 마운트하는 디렉터리

/export 디렉터리는 diskless 명령의 클라이언트 자원 기본 위치입니다. /export 디렉터리는 서버에서의 클라이언트 자원 위치일 뿐입니다. 클라이언트가 이 자원을 자기 파일 트리에 마운트하므로 클라이언트에게는 파일 트리의 보통 위치에 있는 것처럼 보입니다. /export 디렉터리의 주요 하위 디렉터리와 클라이언트 파일 트리의 해당 마운트 지점은 다음과 같습니다.

디렉터리 설명
/export/root 클라이언트 루트(/) 파일 시스템 위에 마운트합니다. 클라이언트 루트 디렉터리는 기본으로 /export/root에 있으며 클라이언트 호스트 이름으로 이름을 붙입니다.
/export/exec SPOT(Shared Product Object Tree) 디렉터리라고도 합니다. 클라이언트 /usr 파일 시스템 위에 마운트합니다. SPOT은 /export/exec에 저장한 /usr 파일 시스템 판으로 이름이 릴리스 수준을 반영하며, 기본 이름은 RISCAIX입니다.
/export/share 클라이언트 /usr/share 디렉터리 위에 마운트합니다. 여러 아키텍처가 공유할 수 있는 데이터가 있습니다. 기본 위치는 /export/share/AIX/usr/share입니다.
/export/home 클라이언트 /home 파일 시스템 위에 마운트합니다. 클라이언트 호스트 이름별로 묶은 사용자 디렉터리가 있습니다. 클라이언트 홈 디렉터리의 기본 위치는 /export/home입니다.
/export/swap 페이징 디렉터리라고도 합니다. 독립 실행형이나 데이터 없는 시스템은 로컬 디스크가 페이징을 맡고, 디스크 없는 클라이언트는 서버의 파일이 맡습니다. 이 파일은 클라이언트 호스트 이름을 따서 이름을 붙이며 기본으로 /export/swap에 있습니다.
/export/dump 독립 실행형 시스템은 로컬 디스크를 덤프 장치로 쓰고, 디스크 없는 클라이언트는 서버의 파일을 씁니다. 파일은 클라이언트 호스트 이름을 딴 디렉터리에 있으며 기본으로 /export/dump에 있습니다.
microcode 물리 장치용 마이크로코드. 기본 위치는 /export/exec/RISCAIX/usr/lib/microcode입니다.

JFS2 파일 시스템 암호화

AIX Version 6.1부터 JFS2 파일 시스템에서 암호화 파일 시스템(EFS)을 지원합니다. EFS로 데이터를 암호화하고 키 기반 보호로 데이터 접근을 제어할 수 있습니다.

키는 사용자마다 연결되며 암호학적으로 보호한 키 저장소에 저장됩니다. 로그인에 성공하면 사용자 키가 커널에 적재되어 프로세스 자격 증명과 연결됩니다. EFS로 보호한 파일을 열려면 프로세스 자격 증명을 시험합니다. 프로세스가 파일 보호와 맞는 키를 찾으면 파일 키와 파일 내용을 복호화합니다.

기본적으로 JFS2 파일 시스템은 EFS가 켜져 있지 않습니다. 데이터를 암호화하려면 먼저 JFS2 파일 시스템에서 EFS를 켜야 합니다. EFS를 켜는 방법은 Commands Reference, Volume 2의 efsenable 명령을 봅니다.

영어 원문

File system concepts

Before you can manage and configure your file system you need to understand the basic organization and content of the file tree.

Organization and contents of the file tree

The file tree organizes files into directories containing similar information. This organization facilitates remote mounting of directories and files.

System administrators can use these directories as building blocks to construct a unique file tree for each client mounting individual directories from one or more servers. Mounting files and directories remotely, rather than keeping all information local, has the following advantages:

  • Conserves disk space

  • Allows easy, centralized system administration

  • Provides a more secure environment

The file tree has the following characteristics:

  • Files that can be shared by machines of the same hardware architecture are located in the /usr file system.

  • Variable per-client files, such as spool and mail files, are located in the /var file system.

  • Architecture-independent, shareable text files, such as manual pages, are located in the /usr/share directory.

  • The / (root) file system contains files and directories critical for system operation. For example, it contains a device directory, programs used for system startup, and mount points where file systems can be mounted onto the root file system.

  • The /home file system is the mount point for user home directories.

File system structure:

It is important to understand the difference between a file system and a directory. A file system is a section of hard disk that has been allocated to contain files. This section of hard disk is accessed by mounting the file system over a directory. After the file system is mounted, it looks just like any other directory to the end user.

However, because of the structural differences between the file systems and directories, the data within these entities can be managed separately.

When the operating system is installed for the first time, it is loaded into a directory structure, as shown in the following illustration.

The directories on the right (/usr, /tmp, /var, and /home) are all file systems so they have separate sections of the hard disk allocated for their use. These file systems are mounted automatically when the system is started, so the end user does not see the difference between these file systems and the directories listed on the left (/bin, /dev, /etc, and /lib).

On standalone machines, the following file systems reside on the associated device by default:

  • /dev/hd1 — /home
  • /dev/hd2 — /usr
  • /dev/hd3 — /tmp
  • /dev/hd4 — /(root)
  • /dev/hd9var — /var
  • /proc — /proc
  • /dev/hd10opt — /opt

The file tree has the following characteristics: Figure 7. / (root) File System Tree. This tree chart shows a directory structure with the / (root) file system at the top,

  • Files that can be shared by machines of the same hardware architecture are located in the /usr file system.

  • Variable per-client files, for example, spool and mail files, are located in the /var file system.

  • The /(root) file system contains files and directories critical for system operation. For example, it contains – A device directory (/dev) – Mount points where file systems can be mounted onto the root file system, for example, /mnt

  • The /home file system is the mount point for users' home directories.

  • For servers, the /export directory contains paging-space files, per-client (unshared) root file systems, dump, home, and /usr/share directories for diskless clients, as well as exported /usr directories.

  • The /proc file system contains information about the state of processes and threads in the system.

  • The /opt file system contains optional software, such as applications.

The following list provides information about the contents of some of the subdirectories of the /(root) file system.

  • /bin — Symbolic link to the /usr/bin directory.
  • /dev — Contains device nodes for special files for local devices. The /dev directory contains special files for tape drives, printers, disk partitions, and terminals.
  • /etc — Contains configuration files that vary for each machine. Examples include: • /etc/hosts • /etc/passwd
  • /export — Contains the directories and files on a server that are for remote clients.
  • /home — Serves as a mount point for a file system containing user home directories. The /home file system contains per-user files and directories. In a standalone machine, a separate local file system is mounted over the /home directory. In a network, a server might contain user files that should be accessible from several machines. In this case, the server's copy of the /home directory is remotely mounted onto a local /home file system.
  • /lib — Symbolic link to the /usr/lib directory, which contains architecture-independent libraries with names in the form lib*.a.
  • /sbin — Contains files needed to boot the machine and mount the /usr file system. Most of the commands used during booting come from the boot image's RAM disk file system; therefore, very few commands reside in the /sbin directory.
  • /tmp — Serves as a mount point for a file system that contains system-generated temporary files.
  • /u — Symbolic link to the /home directory.
  • /usr — Serves as a mount point for a file system containing files that do not change and can be shared by machines (such as executable programs and ASCII documentation). Standalone machines mount a separate local file system over the /usr directory. Diskless and disk-poor machines mount a directory from a remote server over the /usr file system.
  • /var — Serves as a mount point for files that vary on each machine. The /var file system is configured as a file system because the files that it contains tend to grow. For example, it is a symbolic link to the /usr/tmp directory, which contains temporary work files.
  • Root file system:

The root file system is the top of the hierarchical file tree. It contains the files and directories critical for system operation, including the device directory and programs for booting the system. The root file system also contains mount points where file systems can be mounted to connect to the root file system hierarchy.

The following diagram shows many of the subdirectories of the root file system.

The following list provides information about the contents of some of the subdirectories of the / (root) file system.

  • /etc — Contains configuration files that vary for each machine. Examples include: • /etc/hosts • /etc/passwd The /etc directory contains the files generally used in system administration. Most of the commands that previously resided in the /etc directory now reside in the /usr/sbin directory. However, for compatibility, the /usr/sbin directory contains symbolic links to the locations of some executable files. Examples include: • /etc/chown is a symbolic link to /usr/bin/chown. • /etc/exportvg is a symbolic link to /usr/sbin/exportvg.
  • /bin — Symbolic link to the /usr/bin directory. In prior UNIX file systems, the /bin directory contained user commands that now reside in the /usr/bin directory.
  • /sbin — Contains files needed to boot the machine and mount the /usr file system. Most of the commands used during booting come from the boot image's RAM disk file system; therefore, very few commands reside in the /sbin directory.
  • /dev — Contains device nodes for special files for local devices. The /dev directory contains special files for tape drives, printers, disk partitions, and terminals.
  • /tmp — Serves as a mount point for a file system that contains system-generated temporary files. The /tmp file system is an empty directory.
  • /var — Serves as a mount point for files that vary on each machine. The /var file system is configured as a file system since the files it contains tend to grow. See “/var file system” on page 420 for more information.
  • /u — Symbolic link to the /home directory.

Figure 8. Root File System. This diagram shows the root file system and its subdirectories. The /bin subdirectory

  • /usr — Contains files that do not change and can be shared by machines such as executables and ASCII documentation. Standalone machines mount the root of a separate local file system over the /usr directory. Diskless machines and machines with limited disk resources mount a directory from a remote server over the /usr file system. See “/usr file system” for more information about the file tree mounted over the /usr directory.
  • /home — Serves as a mount point for a file system containing user home directories. The /home file system contains per-user files and directories. In a standalone machine, the /home directory is contained in a separate file system whose root is mounted over the /home directory root file system. In a network, a server might contain user files that are accessible from several machines. In this case, the server copy of the /home directory is remotely mounted onto a local /home file system.
  • /export — Contains the directories and files on a server that are for remote clients. See “/export directory” on page 421 for more information about the file tree that resides under the /export directory.
  • /lib — Symbolic link to the /usr/lib directory. See “/usr file system” for more information.
  • /tftpboot — Contains boot images and boot information for diskless clients.
  • /usr file system:

The /usr file system contains executable files that can be shared among machines.

The major subdirectories of the /usr directory are shown in the following diagram.

On a standalone machine the /usr file system is a separate file system (in the /dev/hd2 logical volume). On a diskless machine or a machine with limited disk resources, a directory from a remote server is mounted with read-only permissions over the local /usr file system. The /usr file system contains read-only commands, libraries, and data. Figure 9. /usr File System. This diagram shows the major subdirectories of the /usr directory, which includes: /bin, /ccs, /lib, /lpp, /adm and its /var/adm subdirectory, and /man and its /usr/share/man subdirectory.

Except for the contents of the /usr/share directory, the files and directories in the /usr file system can be shared by all machines of the same hardware architecture.

The /usr file system includes the following directories:

  • /usr/bin — Contains ordinary commands and shell scripts. For example, the /usr/bin directory contains the ls, cat, and mkdir commands.
  • /usr/ccs — Contains unbundled development package binaries.
  • /usr/include — Contains include, or header, files.
  • /usr/lbin — Contains executable files that are backends to commands.
  • /usr/lib — Contains architecture-independent libraries with names of the form lib*.a. The /lib directory in / (root) is a symbolic link to the /usr/lib directory, so all files that were once in the /lib directory are now in the /usr/lib directory. This includes a few nonlibrary files for compatibility.
  • /usr/lpp — Contains optionally installed products.
  • /usr/sbin — Contains utilities used in system administration, including System Management Interface Tool (SMIT) commands. Most of the commands that once resided in the /etc directory now reside in the /usr/sbin directory.
  • /usr/share — Contains files that can be shared among machines with different architectures. See “/usr/share directory” for more information.

The following are symbolic links to the /var directory:

  • /usr/adm — Symbolic link to the /var/adm directory
  • /usr/mail — Symbolic link to the /var/spool/mail directory
  • /usr/news — Symbolic link to the /var/news directory
  • /usr/preserve — Symbolic link to the /var/preserve directory
  • /usr/spool — Symbolic link to the /var/spool directory
  • /usr/tmp — Symbolic link to the /var/tmp directory, because the /usr directory is potentially shared by many nodes and is read-only

The following are symbolic links to the /usr/share and /usr/lib directories:

  • /usr/dict — Symbolic link to the /usr/share/dict directory
  • /usr/man — Symbolic link to the /usr/share/man directory
  • /usr/lpd — Symbolic link to the /usr/lib/lpd directory
  • /usr/share directory:

The /usr/share directory contains architecture-independent shareable text files. The contents of this directory can be shared by all machines, regardless of hardware architecture.

In a mixed architecture environment, the typical diskless client mounts one server directory over its own /usr directory and then mounts a different directory over the /usr/share directory. The files below the /usr/share directory are contained in one or more separately installable packages. Thus, a node might have the other parts of the /usr directory it depends on locally installed while using a server to provide the /usr/share directory.

Some of the files in the /usr/share directory include the directories and files shown in the following diagram.

This diagram shows several directories under the /usr/share directory, including /lib, /lpp, /dict, and /man.

The /usr/share directory includes the following:

  • /usr/share/man — Contains the manual pages if they have been loaded
  • /usr/share/dict — Contains the spelling dictionary and its indexes
  • /usr/share/lib — Contains architecture-independent data files, including terminfo, learn, tmac, me, and macros
  • /usr/share/lpp — Contains data and information about optionally installable products on the system
  • /var file system:

The /var file system tends to grow because it contains subdirectories and data files that are used by busy applications such as accounting, mail, and the print spooler.

Attention: If applications on your system use the /var file system extensively, routinely run the skulker command or increase the file system size beyond the 4MB /var default.

Specific /var files that warrant periodic monitoring are /var/adm/wtmp and /var/adm/ras/errlog.

Other /var files to monitor are:

  • /var/adm/ras/trcfile — If the trace facility is turned on
  • /var/tmp/snmpd.log — If the snmpd command is running on your system

The /var directory diagram shows some of the directories in the /var file system.

  • /var/adm — Contains system logging and accounting files
  • /var/news — Contains system news

Figure 10. /usr/share Directory.

Figure 11. /var Directory. This diagram shows the major subdirectories of the /var directory, including /adm, /news, /preserve, /spool, and /tmp.

  • /var/preserve — Contains preserved data from interrupted edit sessions; similar to the /usr/preserve directory in previous releases
  • /var/spool — Contains files being processed by programs such as electronic mail; similar to the /usr/spool directory in previous releases
  • /var/tmp — Contains temporary files; similar to the /usr/tmp directory in previous releases. The /usr/tmp directory is now a symbolic link to /var/tmp.
  • /export directory:

The /export directory contains server files exported to clients, such as diskless, dataless, or disk-poor machines.

A server can export several types of disk space, including packages of executable programs, paging space for diskless clients, and root file systems for diskless clients or those with low disk resources. The standard location for such disk space in the file tree is the /export directory. Some of the subdirectories of the /export directory are shown in the following list:

/exec Contains directories that diskless clients mount over their /usr file systems

/swap Contains files for diskless clients' remote paging

/share Contains directories that diskless clients mount over their /usr/share directory

/root Contains directories that diskless clients mount over their / (root) file system

/home Contains directories that diskless clients mount over their /home file system

The /export directory is the default location for client resources for the diskless commands. The /export directory is only the location of client resources on the server. Because clients mount these resources onto their own file tree, these resources appear to clients at the normal places in a file tree. The major subdirectories of the /export directory, and their corresponding mount points on a client file tree, include:

/export/root This directory is mounted over the client root ( / ) file system. Client root directories are located in the /export/root directory by default and are named with the client's host name.

/export/exec Also called the Shared Product Object Tree (SPOT) directory. This directory is mounted over the client /usr file system. SPOTs are versions of the /usr file system stored in the /export/exec directory and have names that reflect their release level. By default, the name is RISCAIX.

/export/share This directory is mounted over the client /usr/share directory. This directory contains data that can be shared by many architectures. The default location is /export/share/AIX/usr/share.

/export/home This directory is mounted over the client /home file system. It contains user directories grouped by client host names. The default location for client home directories is /export/home.

/export/swap Also called the paging directory. In standalone or dataless systems, paging is provided by a local disk; for diskless clients, this service is provided by a file on a server. This file is named after the client's host name and by default is found in the /export/swap directory.

/export/dump Standalone systems use a local disk as the dump device; diskless clients use a file on a server. The file resides in a directory named after the client host name and by default is found in the /export/dump directory.

microcode This directory contains microcode for physical devices. The default location is /export/exec/RISCAIX/usr/lib/microcode.

Encrypting JFS2 file systems

Beginning with AIX Version 6.1, Encrypted File System (EFS) is supported on JFS2 file systems. EFS allows you to encrypt your data and control access to the data through keyed protection.

A key is associated with each user and is stored in a cryptographically protected key store. Upon successful login, the user's keys are loaded into the kernel and associated with the process credentials. To open an EFS-protected file, the process credentials are tested. If the process finds a key that matches the file protection, the process decrypts the file key and the file content.

By default, JFS2 file systems are not EFS-enabled. A JFS2 file system must be EFS-enabled before any data can be encrypted. For information about how to enable EFS, see the efsenable command in Commands Reference, Volume 2.

파일 시스템 구성

파일 시스템을 더하거나 구성할 때 Web-based System Manager의 File Systems 컨테이너에서 옵션을 고르거나 SMIT 빠른 경로를 쓸 수 있습니다.

SMIT 빠른 경로는 다음 표와 같습니다.

표 64. 논리 볼륨과 파일 시스템 관리 작업

작업 SMIT 빠른 경로
JFS나 JFS2 더하기 smit crfs
기존 논리 볼륨에 JFS2 더하기 smit crjfs2lvstd
미리 정의한 논리 볼륨에 JFS 더하기 Create logical volume 메뉴 뒤 smit crjfslv
JFS나 JFS2의 속성 바꾸기(참고 1) smit chfs
파일 시스템 크기 확인 smit fs
파일 시스템 크기 늘리기 JFS: smit chjfs, JFS2: smit chjfs2
파일 시스템 크기 줄이기 JFS2: smit chjfs2

참고: 파일 시스템 크기 줄이기 SMIT 빠른 경로는 JFS2에만 있습니다.

영어 원문

Configuring file systems

When adding or configuring file systems, you can select options in the File Systems container of Web-based System Manager or use the SMIT fast paths.

The SMIT fast paths are provided in the following table:

Table 64. Managing Logical Volumes and File Systems Tasks Task SMIT Fast Path Add a JFS or JFS2 smit crfs Add a JFS2 to an existing logical volume smit crjfs2lvstd Add a JFS to a previously defined logical volume menu Create logical volume, then smit crjfslv Change the attributes of a JFS or a JFS2 Note 1 smit chfs Check size of a file system smit fs Increase size of a file system JFS: smit chjfs JFS2: smit chjfs2 Decrease size of a file system JFS2: smit chjfs2

Note: The SMIT Fast Path for Decrease size of a file system is only for JFS2.

파일 시스템 관리

파일 시스템은 루트 디렉터리와 그 아래의 모든 하위 디렉터리와 파일을 포함한 완전한 디렉터리 구조입니다.

파일 시스템은 논리 볼륨 하나에 한정됩니다. 가장 중요한 시스템 관리 작업 가운데 일부는 파일 시스템과 관련됩니다.

  • 논리 볼륨에 파일 시스템 공간 할당
  • 파일 시스템 만들기
  • 시스템 사용자가 파일 시스템 공간을 쓸 수 있게 하기
  • 파일 시스템 공간 사용 감시
  • 시스템 고장 때 데이터 손실에 대비한 파일 시스템 백업
  • 특정 시점의 일관된 블록 수준 파일 시스템 이미지를 잡는 스냅숏 만들기
  • 파일 시스템을 일관된 상태로 유지

다음은 파일 시스템 관리를 돕는 시스템 관리 명령입니다.

명령 설명
backup 파일 시스템의 전체나 증분 백업을 합니다.
chfs -a splitcopy 마운트된 JFS 파일 시스템의 온라인 백업을 만듭니다.
dd 파일 시스템 백업을 만들려고 한 장치에서 다른 장치로 데이터를 직접 복사합니다.
df 파일 시스템의 사용 공간과 빈 공간을 보고합니다.
fsck 파일 시스템을 검사하고 불일치를 고칩니다.
mkfs 지정한 논리 볼륨에 지정한 크기의 파일 시스템을 만듭니다.
mount 파일 시스템을 시스템 전체 이름 구조에 붙여 그 파일과 디렉터리에 접근할 수 있게 합니다.
restore 백업에서 파일을 복원합니다.
snapshot JFS2 파일 시스템의 스냅숏을 만듭니다.
umount 파일 시스템을 시스템 전체 이름 구조에서 떼어 그 파일과 디렉터리에 접근할 수 없게 합니다.

파일 시스템의 사용 가능한 공간 보기(df 명령)

df 명령으로 파일 시스템의 총 공간과 사용 가능한 공간 정보를 봅니다. FileSystem 매개변수는 파일 시스템이 있는 장치 이름, 파일 시스템이 마운트된 디렉터리, 또는 파일 시스템의 상대 경로 이름을 지정합니다.

FileSystem 매개변수를 지정하지 않으면 df 명령은 지금 마운트된 모든 파일 시스템의 정보를 보여 줍니다. 파일이나 디렉터리를 지정하면 그것이 있는 파일 시스템의 정보를 보여 줍니다.

보통 df 명령은 슈퍼블록에 든 빈 공간 수를 씁니다. 예외적인 경우 이 수가 틀릴 수 있습니다. 예를 들어 df 명령이 실행되는 동안 파일 시스템이 활발히 바뀌면 빈 공간 수가 정확하지 않을 수 있습니다.

전체 구문은 Commands Reference, Volume 2의 df 명령을 봅니다.

참고: NFS 같은 일부 원격 파일 시스템에서는 서버가 정보를 주지 않으면 표시의 사용 가능 공간 열이 비어 있습니다.

다음은 df 명령 쓰는 예입니다.

  • 마운트된 모든 파일 시스템의 정보를 보려면 다음을 입력합니다.
text
df

/, /usr, /site, /usr/venus 디렉터리가 별도 파일 시스템에 있도록 시스템이 구성돼 있으면 df 명령 출력은 다음과 비슷합니다.

text
Filesystem 512-blocks  free   %used   Iused %Iused   Mounted on
/dev/hd4    20480     13780    32%      805   13%     /
/dev/hd2   385024     15772    95%    27715   28%     /usr
/dev/hd9var 40960     38988     4%      115    1%     /var
/dev/hd3    20480     18972     7%       81    1%     /tmp
/dev/hd1     4096      3724     9%       44    4%     /home
  • 현재 디렉터리가 있는 파일 시스템의 사용 가능 공간을 보려면 다음을 입력합니다.
text
df .

파일 시스템 명령

형과 관계없이 파일 시스템에 동작하는 명령이 여럿 있습니다.

/etc/filesystems 파일이 다음 명령이 다룰 수 있는 파일 시스템 목록을 제어합니다.

명령 설명
chfs 파일 시스템의 특성을 바꿉니다.
crfs 파일 시스템을 더합니다.
lsfs 파일 시스템의 특성을 보여 줍니다.
rmfs 파일 시스템을 지웁니다.
mount 파일 시스템을 쓸 수 있게 합니다.

네 명령은 가상 파일 시스템 형에 동작합니다. /etc/vfs 파일에 다음 명령이 다루는 파일 시스템 형 정보가 있습니다.

명령 설명
chvfs 파일 시스템 형의 특성을 바꿉니다.
crvfs 새 파일 시스템 형을 더합니다.
lsvfs 파일 시스템 형의 특성을 나열합니다.
rmvfs 파일 시스템 형을 지웁니다.

다른 기계의 파일 시스템 비교

다른 기계에 있는 파일 시스템이 같아야 하는데 하나가 손상됐다고 의심되면 파일 시스템을 비교할 수 있습니다.

다음 절차는 현재 호스트(이 시나리오에서는 orig_host)의 파일 시스템 속성을 원격 호스트의 같은 파일 시스템과 비교하는 방법입니다.

이 시나리오의 정보는 특정 AIX 버전으로 시험했습니다. AIX 버전과 수준에 따라 결과가 크게 다를 수 있습니다.

  1. root 사용자로 원격 호스트에 로그인합니다. 예:
text
tn juniper.mycompany.com
AIX Version 6.1
(C) Copyrights by IBM and by others 1982, 2002.
login: root
root’s Password:
  1. 편집기로 원격 호스트의 .rhosts 파일을 편집해 root 사용자가 보안 원격 명령을 실행할 수 있게 하는 스탠자를 더합니다. 새 스탠자는 다음 형식입니다.
text
orig_host root

결과 .rhosts 파일은 다음과 비슷할 수 있습니다.

text
NIM.mycompany.com root
nim.mycompany.com root
host.othernetwork.com root
orig_host.mycompany.com root
  1. 변경을 저장하고 원격 연결을 끝냅니다.
  2. orig_host에서 root 권한으로 편집기를 써서 파일을 하나 더 만듭니다. 이 시나리오에서 새 파일 이름은 compareFS입니다. 예:
text
vi compareFS
  1. 이 파일에 다음 텍스트를 넣습니다. FSname은 비교할 파일 시스템 이름, remote_host는 비교할 파일 시스템이 있는 호스트 이름입니다.
text
FSname -> remote_host
install -v ;

참고: 이 파일의 install 명령행에서는 -v 매개변수와 세미콜론(;) 사이에 공백이 있어야 합니다. 예:

text
/home/jane/* -> juniper.mycompany.com
install -v ;
  1. 파일을 저장하고 편집기를 끝냅니다. compareFS 파일은 다음 단계에서 rdist 명령의 distfile로 씁니다.
  2. 명령 프롬프트에서 다음을 입력합니다.
text
/usr/bin/rdist -f compareFS

비교 출력이 많을 것 같으면 출력을 파일로 보냅니다. 예:

text
/usr/bin/rdist -f compareFS > compareFS_output

출력에 파일 시스템 사이의 차이가 나열됩니다.

관련 정보

  • rdist 명령, TCP/IP용 rhosts 파일 형식, 보안 원격 명령 이해
영어 원문

Managing file system

A file system is a complete directory structure, including a root directory and any subdirectories and files beneath it.

File systems are confined to a single logical volume. Some of the most important system management tasks are concerning file systems, specifically:

  • Allocating space for file systems on logical volumes

  • Creating file systems

  • Making file system space available to system users

  • Monitoring file system space usage

  • Backing up file systems to guard against data loss in the event of system failures

  • Making a snapshot to capture a consistent block-level image of a file system at a given point in time

  • Maintaining file systems in a consistent state.

Following is a list of system management commands that help manage file systems:

  • backup — Performs a full or incremental backup of a file system
  • chfs -a splitcopy — Creates an online backup of a mounted JFS file system
  • dd — Copies data directly from one device to another for making file system backups
  • df — Reports the amount of space used and free on a file system
  • fsck — Checks file systems and repairs inconsistencies
  • mkfs — Makes a file system of a specified size on a specified logical volume
  • mount — Attaches a file system to the system-wide naming structure so that files and directories in that file system can be accessed
  • restore — Restores files from a backup
  • snapshot — Creates a snapshot of a JFS2 file system
  • umount — Removes a file system from the system-wide naming structure, making the files and directories in the file system inaccessible.

Displaying available space on a file system (df command)

Use the df command to display information about total space and available space on a file system. The FileSystem parameter specifies the name of the device on which the file system resides, the directory on which the file system is mounted, or the relative path name of a file system.

If you do not specify the FileSystem parameter, the df command displays information for all currently mounted file systems. If a file or directory is specified, then the df command displays information for the file system on which it resides.

Normally, the df command uses free counts contained in the superblock. Under certain exceptional conditions, these counts might be in error. For example, if a file system is being actively modified when the df command is running, the free count might not be accurate.

See the df command in the Commands Reference, Volume 2 for the complete syntax.

Note: On some remote file systems, such as Network File Systems (NFS), the columns representing the available space on the display are left blank if the server does not provide the information.

The following are examples of how to use the df command:

  • To display information about all mounted file systems, type the following:
text
df

If your system is configured so the /, /usr, /site, and /usr/venus directories reside in separate file systems, the output from the df command is similar to the following:

text
Filesystem 512-blocks  free   %used   Iused %Iused   Mounted on
/dev/hd4    20480     13780    32%      805   13%     /
/dev/hd2   385024     15772    95%    27715   28%     /usr
/dev/hd9var 40960     38988     4%      115    1%     /var
/dev/hd3    20480     18972     7%       81    1%     /tmp
/dev/hd1     4096      3724     9%       44    4%     /home
  • To display available space on the file system in which your current directory resides, type the following:
text
df .

File system commands

There are a number of commands designed to operate on file systems, regardless of type.

The /etc/filesystems file controls the list of file systems that the following commands can manipulate:

  • chfs — Changes the characteristics of a file system
  • crfs — Adds a file system
  • lsfs — Displays the characteristics of a file system
  • rmfs — Removes a file system
  • mount — Makes a file system available for use

Four commands operate on virtual file systems types. The /etc/vfs file contains the information on the file system types that the following commands manipulate:

  • chvfs — Changes the characteristics of a file system type
  • crvfs — Adds a new file system type
  • lsvfs — Lists the characteristics of a file system type
  • rmvfs — Removes a file system type

Comparing file systems on different machines

When file systems that exist on different machines should be identical but you suspect one is damaged, you can compare the file systems.

The following procedure describes how to compare the attributes of a file system that resides on your current host (in this scenario, called orig_host) to the same file system on a remote host.

The information in this how-to scenario was tested using specific versions of AIX. The results you obtain might vary significantly depending on your version and level of AIX.

  1. Log in to the remote host as the root user. For example:
text
tn juniper.mycompany.com
AIX Version 6.1
(C) Copyrights by IBM and by others 1982, 2002.
login: root
root’s Password:
  1. Using your favorite editor, edit the remote host's .rhosts file to add a stanza that allows the root user to execute secure remote commands. Use the following format for the new stanza:
text
orig_host root

The resulting .rhosts file might look similar to the following:

text
NIM.mycompany.com root
nim.mycompany.com root
host.othernetwork.com root
orig_host.mycompany.com root
  1. Save your changes and exit the remote connection.

  2. With root authority on orig_host, create another file using your favorite editor. For this scenario, the new file is named compareFS. For example:

text
vi compareFS
  1. Insert the following text in this file, where FSname is the name of the file system that you want to compare, and remote_host is the name of the host on which the comparison file system resides:
text
FSname -> remote_host
install -v ;

Note: In the install command line of this file, there must be a space between the -v parameter and the semicolon (;). For example:

text
/home/jane/* -> juniper.mycompany.com
install -v ;
  1. Save the file and exit the editor. The compareFS file is used as the distfile for the rdist command in the following step.

  2. Type the following at the command prompt:

text
/usr/bin/rdist -f compareFS

Or, if you expect a significant amount of output from the comparison, send the output to a file name. For example:

text
/usr/bin/rdist -f compareFS > compareFS_output

The output lists any differences between the file systems.

Related information

rdist command rhosts File Format for TCP/IP Understanding the Secure Remote Commands