rmfs 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-rmfs
핵심 정리
- 파일 시스템을 지웁니다. JFS·JFS2면 파일 시스템이 있는 논리 볼륨과
/etc/filesystems의 스탠자를 함께 지우고, 그 밖의 유형이면 스탠자만 지웁니다. - 데이터가 모두 사라지므로 먼저 백업하고,
umount로 마운트를 푼 뒤 실행합니다. -r은 마운트 지점 디렉터리도 지우고,-i는 지우기 전에 경고하고 확인을 받습니다.- root나 system 그룹 구성원만 실행할 수 있습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (내용이 같고, 6.1 문서에 RBAC 안내가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 4, 6.1 Volume 4 |
| 파일 | /usr/sbin/rmfs, /etc/filesystems |
| 관련 명령어 | crfs, chfs, lsfs, umount, rmlv |
목적
파일 시스템을 지웁니다.
영어 원문
Removes a file system.
구문
rmfs [ -r | -i ] FileSystem
설명
rmfs 명령은 파일 시스템을 지웁니다. JFS나 JFS2면 파일 시스템이 있는 논리 볼륨과 /etc/filesystems의 해당 스탠자를 함께 지웁니다. JFS·JFS2가 아니면 스탠자만 지웁니다. FileSystem 매개변수는 지울 파일 시스템입니다.
Web-based System Manager(wsm)의 File Systems 응용 프로그램이나 SMIT 빠른 경로 smit rmfs로도 실행할 수 있습니다.
영어 원문
The rmfs command removes a file system. If the file system is a journaled file system (JFS or JFS2), the rmfs command removes both the logical volume on which the file system resides and the associated stanza in the /etc/filesystems file. If the file system is not a JFS or JFS2 file system, the command removes only the associated stanza in the /etc/filesystems file. The FileSystem parameter specifies the file system to be removed.
You can use the File Systems application in Web-based System Manager (wsm) to change file system characteristics.
You could also use the System Management Interface Tool (SMIT) smit rmfs fast path to run this command.
플래그
| 플래그 | 설명 |
|---|---|
-r |
파일 시스템의 마운트 지점도 지웁니다. |
-i |
파일 시스템을 지우기 전에 경고를 보여 주고 확인을 받습니다. |
영어 원문
-r— Removes the mount point of the file system.-i— Displays warning and prompts the user before removing file system.
종료 상태
| 값 | 뜻 |
|---|---|
| 0 | 파일 시스템을 지움 |
| 0보다 큼 | 지우지 못함 |
영어 원문
This command returns the following exit values:
- 0 — File system is successfully removed.
>0— File system is not successfully removed.
보안
접근 제어: root나 system 그룹 구성원만 실행할 수 있습니다.
RBAC 사용자와 Trusted AIX 사용자는 주의하세요. 이 명령은 특권 작업을 할 수 있으며, 특권 작업은 특권 사용자만 할 수 있습니다. 특권과 권한 목록은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다(6.1 문서에만 있음).
영어 원문
Access Control: Only the root user or a member of the system group can run this command.
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.
예제
/test 파일 시스템을 지웁니다. 파일 시스템, /etc/filesystems의 항목, 그 아래의 논리 볼륨을 지웁니다.
rmfs /test
자주 쓰는 형태:
umount /olddata
rmfs -r /olddata # 마운트 지점 디렉터리까지 지움
lsvg -l datavg # 논리 볼륨이 지워졌는지 확인
영어 원문
To remove the /test file system, enter: rmfs /test
This removes the /test file system, its entry in the /etc/filesystems file, and the underlying logical volume.
파일
| 파일 | 설명 |
|---|---|
/etc/rmfs |
rmfs 명령 |
/etc/filesystems |
알려진 파일 시스템과 그 특성 |
영어 원문
- /etc/rmfs — Contains the rmfs command.
- /etc/filesystems — Lists the known file systems and defines their characteristics.
Related reference:
- rmlv Command
Related information:
- chfs command
- mkfs command
- File systems
- System management interface tool
리눅스(GNU)와 다른 점
리눅스에서는 파일 시스템 정보가 /etc/fstab에 있고(AIX는 스탠자 형식의 /etc/filesystems), LVM과 파일 시스템 명령이 나뉘어 있습니다. 만들기는 lvcreate 뒤 mkfs.xfs·mkfs.ext4, 늘리기는 lvextend -r(또는 lvextend 뒤 xfs_growfs·resize2fs), 지우기는 umount 뒤 /etc/fstab 항목과 lvremove로 따로 합니다. AIX의 crfs·chfs·rmfs는 이것을 한 명령으로 합니다.