crfs 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-crfs
핵심 정리
- 볼륨 그룹에 파일 시스템을 만들고
/etc/filesystems에 스탠자를 넣습니다.-d로 기존 논리 볼륨을 주지 않으면 논리 볼륨도 새로 만듭니다. - 기본 형태:
crfs -v jfs2 -g datavg -m /data -a size=10G -A yes. 만든 뒤mount /data로 마운트합니다(-A yes는 부팅할 때 자동 마운트). -a로 유형별 속성을 줍니다. JFS2는size,agblksize(블록 크기),logname=INLINE(inline log),ea=v2(NFS4 ACL), (6.1)efs,quota,mountguard등이 있습니다.agblksize,ea형식 같은 일부 속성은 만들 때만 정할 수 있습니다. 크기는 나중에chfs로 늘릴 수 있지만 JFS는 줄일 수 없습니다.- root나 system 그룹 구성원만 실행할 수 있습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 JFS2 속성 efs, isnapshot, maxext, mountguard, quota, vix가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 1, 6.1 Volume 1 |
| 파일 | /usr/sbin/crfs, /etc/filesystems |
| 관련 명령어 | chfs, rmfs, lsfs, mklv, mkfs, mount |
목적
파일 시스템을 추가합니다.
영어 원문
Adds a file system.
구문
crfs -v VfsType { -g VolumeGroup | -d Device } [ -l LogPartitions ] -m MountPoint [ -n NodeName ] [ -u MountGroup ] [ -A { yes | no } ] [ -p { ro | rw } ] [ -a Attribute=Value ... ] [ -t { yes | no } ]
설명
crfs 명령은 미리 만든 볼륨 그룹 안의 논리 볼륨에 파일 시스템을 만듭니다. -d로 기존 논리 볼륨 이름을 주지 않으면 파일 시스템용 논리 볼륨을 새로 만듭니다. 만든 파일 시스템의 항목을 /etc/filesystems에 넣습니다.
crfs는 알지 못하는 Attribute=Value 쌍을 무시하지만, /etc/filesystems의 해당 스탠자에는 넣습니다. 예를 들어 crfs -a abcd=1G /는 루트 스탠자에 새 속성 abcd를 1G 값으로 넣습니다.
참고:
- 파일 시스템은 setgid(set group ID) 비트가 켜진 상태로 만들어집니다. 이것이 기본 그룹 권한을 정하며, 새 파일 시스템 아래에 만드는 디렉터리는 모두 같은 기본 그룹 권한을 가집니다. (6.1) 기존 논리 볼륨 위에 JFS2를 만들면 setgid 비트는 켜지지 않습니다.
- 스트라이프 논리 볼륨에 파일 시스템을 만드는 방법은
mklv문서의 "File Systems on Striped Logical Volumes"를 봅니다.
Web-based System Manager(wsm)의 File Systems 응용 프로그램이나 SMIT 빠른 경로 smit crfs로도 실행할 수 있습니다.
영어 원문
The crfs command creates a file system on a logical volume within a previously created volume group. A new logical volume is created for the file system unless the name of an existing logical volume is specified using the -d. An entry for the file system is put into the /etc/filesystems file.
The crfs command ignores any Attribute=Value pair that the command does not understand but adds them to an appropriate stanza in the /etc/filesystems file.
Example: crfs -a abcd=1G /
This sets the new abcd attribute to the value of 1G in the root stanza in the /etc/filesystems file.
Note:
The file system is created with the setgid (set group ID) bit enabled. This determines the default group permissions. All directories created under the new file system will have the same default group permissions. If the command was run over an existing logical volume for a jfs2 file system the setgid bit is never set.
For information about creating a filesystem on a striped logical volume, refer to File Systems on Striped Logical Volumes in the mklv documentation.
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 crfs fast path to run this command.
플래그
| 플래그 | 설명 |
|---|---|
-a Attribute=Value |
VFS 유형별 속성과 값. 여럿이면 -a를 여러 번 줍니다. JFS와 JFS2 속성은 아래 표에 있습니다. |
-A { yes, no } |
시스템을 다시 시작할 때마다 마운트할지 정합니다. yes면 자동 마운트, no면 하지 않습니다(기본). 값은 첫 글자만 봅니다. |
-d Device |
파일 시스템을 만들 장치나 논리 볼륨 이름. 이미 있는 논리 볼륨에 만들 때 씁니다. |
-g VolumeGroup |
파일 시스템을 만들 기존 볼륨 그룹. 볼륨 그룹은 하나 이상의 물리 볼륨 모음입니다. |
-l LogPartitions |
로그 논리 볼륨의 크기(논리 파티션 수). 로그 장치가 아직 없는 JFS·JFS2에만 해당합니다. |
-m MountPoint |
마운트 지점, 곧 파일 시스템을 쓸 수 있게 하는 디렉터리. 상대 경로를 주면 절대 경로로 바꿔 /etc/filesystems에 넣습니다. |
-n NodeName |
파일 시스템이 있는 원격 호스트 이름. NFS 같은 원격 VFS에서만 쓸 수 있습니다. |
-p { ro, rw } |
권한. ro는 읽기 전용, rw는 읽기·쓰기. |
-t { yes, no } |
계정(accounting) 하위 시스템이 처리할지 정합니다. yes면 켬, no면 끔(기본). |
-u MountGroup |
마운트 그룹. |
-v VfsType |
가상 파일 시스템 유형. |
JFS 속성
| 속성 | 설명 |
|---|---|
ag={ 8, 16, 32, 64 } |
할당 그룹 크기(MB). 할당 그룹은 BSD의 실린더 그룹과 비슷한 inode·디스크 블록 묶음입니다. 기본 8. |
bf={ true, false } |
큰 파일을 쓸 수 있는(large file enabled) 파일 시스템. 필요 없으면 false(기본). true는 조각 크기 4096과 compress=no가 필요합니다. |
compress={ no, LZ } |
데이터 압축. 기본 no. 압축하려면 조각 크기가 2048 이하여야 합니다. |
frag={ 512, 1024, 2048, 4096 } |
JFS 조각(fragment) 크기(바이트). 파일에 할당할 수 있는 가장 작은 디스크 단위입니다. 기본 4096. |
logname=LVName |
로그 논리 볼륨 이름. 이미 있어야 하며, 기본은 대상 볼륨 그룹에 있는 로그 장치를 씁니다. |
nbpi={ 512 ~ 131072 } |
inode당 바이트 수(512, 1024, 2048, 4096, 8192, 16384, 32768, 65536, 131072). 클수록 inode가 적습니다. 기본 4096. |
size=Value |
크기. 512바이트 블록 수, M(MB), G(GB) 접미사로 줍니다. 물리 파티션 크기로 나누어떨어지지 않으면 올림합니다. JFS를 만들 때 반드시 줘야 합니다. |
JFS의 최대 크기는 조각 크기와 NBPI로 정해집니다.
| NBPI | 최소 AG 크기(MB) | 조각 크기 | 최대 크기(GB) |
|---|---|---|---|
| 512 | 8 | 512, 1024, 2048, 4096 | 8 |
| 1024 | 8 | 512, 1024, 2048, 4096 | 16 |
| 2048 | 8 | 512, 1024, 2048, 4096 | 32 |
| 4096 | 8 | 512, 1024, 2048, 4096 | 64 |
| 8192 | 8 | 512, 1024, 2048, 4096 | 128 |
| 16384 | 8 | 1024, 2048, 4096 | 256 |
| 32768 | 16 | 2048, 4096 | 512 |
| 65536 | 32 | 4096 | 1024 |
| 131072 | 64 | 4096 | 1024 |
볼륨 그룹이 정하는 최대 논리 볼륨 크기도 파일 시스템 크기를 제한합니다.
참고: ag, bf, compress, frag, nbpi는 만들 때 정해지며 바꿀 수 없습니다. size는 최소 크기이며 만든 뒤 줄일 수 없습니다. 루트 파일 시스템(/)은 압축할 수 없습니다. 일부 nbpi와 할당 그룹 크기는 함께 쓸 수 없습니다.
JFS2 속성
| 속성 | 설명 |
|---|---|
agblksize={ 512, 1024, 2048, 4096 } |
JFS2 블록 크기(바이트). 기본 4096. |
ea={ v1, v2 } |
이름 있는 확장 속성의 저장 형식. v2는 확장 가능한 확장 속성과 NFS4 ACL을 지원하고, v1은 이전 AIX와 호환됩니다. 기본 v1. |
efs={ yes, no } |
(6.1) 암호화 파일 시스템(EFS)으로 만들지 정합니다. yes면 ea를 주지 않아도 v2 형식을 씁니다. 부팅 중에는 보안 기반이 없으므로 /, /usr, /var, /opt에는 켤 수 없습니다. |
isnapshot={ yes, no } |
(6.1) 내부 스냅숏을 지원할지 정합니다. 지원하면 v2 확장 속성도 씁니다. |
logname=LVName |
로그 논리 볼륨 이름. 이미 있어야 하며, 기본은 대상 볼륨 그룹의 로그 장치입니다. INLINE을 주면 로그를 파일 시스템 논리 볼륨 안에 두며, logsize가 없으면 논리 볼륨 크기의 0.4%를 씁니다. |
logsize=Value |
inline log 크기(MB). 양수이며 1 이상이면 정수여야 하고, 0 이상 1 미만이면 무시하고 기본 크기를 씁니다. INLINE이 아니면 무시합니다. 파일 시스템 크기의 10%와 2047MB를 넘을 수 없습니다. |
maxext=Value |
(6.1) 파일 익스텐트의 최대 크기(파일 시스템 블록 수). 0이면 JFS2 기본 최대값을 씁니다. 0보다 작거나 16777208을 넘으면 잘못된 값입니다. 기존 익스텐트에는 영향이 없습니다. |
mountguard={ yes, no } |
(6.1) PowerHA 같은 클러스터 환경에서 지원하지 않는 동시 마운트를 막습니다. 켜면 다른 노드에서 마운트된 것으로 보일 때 마운트할 수 없습니다. 잠시 무시하려면 mount의 noguard 옵션을 씁니다. |
options=mountOptions |
만들 파일 시스템에 줄 마운트 옵션. 쓸 수 있는 옵션은 mount 명령을 봅니다. |
quota={ userquota, groupquota, userquota,groupquota, no } |
(6.1) 켤 수 있는 쿼터 유형. 사용자 쿼터, 그룹 쿼터, 둘 다, 또는 모두 끔. |
size=Value |
크기. 512바이트 블록 수, M, G 접미사로 주며 물리 파티션 크기로 올림합니다. -d가 없으면 반드시 줘야 하고, -d를 주면 논리 볼륨 크기가 됩니다. 최소 16MB이고 최대는 블록 크기로 정해집니다(512바이트 4TB, 1024 8TB, 2048 16TB, 4096 32TB). |
vix={ yes, no } |
(6.1) 연속된 16KB 공간이 없을 때 16KB보다 작은 inode 익스텐트를 할당할지 정합니다. 켜면 AIX 5.1 이하에서는 그 파일 시스템을 쓸 수 없습니다. AIX 6.1부터 기본 yes. no는 이미 가변 길이 익스텐트가 있으면 효과가 없습니다. |
참고: agblksize는 만들 때 정해지며 바꿀 수 없습니다. size는 최소 크기입니다. ea 형식도 만들 때 정해지지만 chfs로 v1에서 v2로 바꿀 수 있고(되돌릴 수 없음), 바꾸기는 확장 속성이나 ACL을 쓸 때 파일마다 필요할 때 일어납니다. (6.1) maxext는 나중 릴리스에서 만들었어도 이전 릴리스에서는 무시합니다.
영어 원문
-aAttribute=Value — Specifies a virtual file system-dependent attribute/value pair. To specify more than one attribute/value pair, provide multiple-aAttribute=Value parameters (see an example). The following attribute/value pairs are specific to the Journaled File System (JFS):-a ag={ 8 | 16 | 32 | 64 }Specifies the allocation group size in megabytes. An allocation group is a grouping of i-nodes and disk blocks similar to BSD cylinder groups. The default ag value is 8.-a bf={ true | false }Specifies a large file enabled file system. See "Understanding Large File Enabled File Systems" for more information. If you do not need a large file enabled file system, set this option to false; this is the default. Specifying bf=true requires a fragment size of 4096 and compress=no.-a compress={ no | LZ }Specifies data compression. If you do not want data to be compressed, set this option to no. The default compress value is no. Selecting compression requires a fragment size of 2048 or less.-a frag={ 512 | 1024 | 2048 | 4096 }Specifies the JFS fragment size in bytes. A file system fragment is the smallest unit of disk storage that can be allocated to a file. The default fragment size is 4096 bytes.-a logname=LVName Specifies the log logical volume name. The specified logical volume will be the logging device for the new JFS. The LVName logical volume must already exist. The default action is to use an existing logging device in the target volume group.-a nbpi={ 512 | 1024 | 2048 | 4096 | 8192 | 16384 | 32768 | 65536 | 131072 }Specifies the number of bytes per i-node (nbpi). The nbpi affects the total number of i-nodes on the file system. The nbpi value is inversely proportional to the number of i-nodes on the file system. The default nbpi value is 4096 bytes.-a size=Value Specifies the size of the Journaled File System. Size can be specified in units of 512-byte blocks, Megabytes or Gigabytes. If Value has the M suffix, it is interpreted to be in Megabytes. If Value has a G suffix, it is interpreted to be in Gigabytes. If the specified size is not evenly divisible by the physical partition size, it is rounded up to the closest number that is evenly divisible. This attribute is required when creating a JFS file system. See "Understanding JFS Size Limitations" for more information. The maximum size of a JFS file system is a function of its fragment size and the NBPI value. These values yield the following size restrictions:NBPI Minimum AG Size Fragment Size Maximum Size (GB) 512 8 512, 1024, 2048, 4096 8 1024 8 512, 1024, 2048, 4096 16 2048 8 512, 1024, 2048, 4096 32 4096 8 512, 1024, 2048, 4096 64 8192 8 512, 1024, 2048, 4096 128 16384 8 1024, 2048, 4096 256 32768 16 2048, 4096 512 65536 32 4096 1024 131072 64 4096 1024You can have NBPI values from 512 to 128K, with corresponding maximum file system sizes. The volume group in which the file system resides defines a maximum logical volume size and also limits the file system size. Note: 1. The ag, bf, compress, frag, and nbpi attributes are set at file system creation and cannot be changed after the file system is successfully created. The size attribute defines the minimum file system size, and you cannot decrease it once the file system is created. 2. The root filesystem ( / ) cannot be compressed. 3. Some nbpi values and allocation group sizes are mutually exclusive. See "Understanding JFS Size Limitations" for information.- The following attribute/value pairs are specific to the Enhanced Journaled File System (JFS2):
-aAttribute=Value —-a agblksize={ 512 | 1024 | 2048 | 4096 }Specifies the JFS2 block size in bytes. A file system block is the smallest unit of disk storage that can be allocated to a file. The default block size is 4096 bytes.-a ea={v1 | v2}Specifies the format to be used to store named extended attributes in the JFS2 file system. The v2 format provides support for scalable named extended attributes as well as support for NFS4 ACLs. The v1 format is compatible with prior versions of AIX. The default format is v1.-a efs={yes | no}Specifies whether the file system is an Encrypted File System (EFS). yes The crfs command creates a file system that is EFS-enabled. When the file system is EFS-enabled, you do not need to specify the ea attribute because the crfs command automatically stores scalable extended attributes of the v2 format. no The crfs command creates a file system that is not EFS-enabled. Note: The crfs commands prevents EFS from enabling the following file systems (mount points) because the security infrastructures (kernel extensions, libraries and so on) are not available during boot: • / • /usr • /var • /opt-a isnapshot={yes|no}Specifies whether the file system supports internal snapshots. A file system created to support internal snapshots also uses extended attributes of the v2 format.-a logname=LVName Specifies the log logical volume name. The specified logical volume is the logging device for the new JFS2. The LVName logical volume must already exist. The default action is to use an existing logging device in the target volume group. Keyword INLINE can be used to place the log in the logical volume with the JFS2 file system. The INLINE log defaults to .4% of the logical volume size if logsize is not specified.-a logsize=Value Specifies the size for an INLINE log in MBytes. The input size must be a positive value. If the inline log size is greater than or equal to 1, the input size must be an integer. If the input is floating point value of less than 1 and greater than or equal to 0, the input size is ignored and the default inline log size is taken. The input is ignored if the INLINE log not being used. It cannot be greater than 10% of the size of the file system and it cannot be greater than 2047 MBytes.-a maxext=Value Specifies the maximum size of a file extent in file system blocks. A zero value implies that the JFS2 default maximum should be used. Values less than 0 or exceeding maximum supported extent size of 16777208 are invalid. Note that existing file extents are not affected by this change.-a mountguard={yes | no}Guards the file system against the unsupported concurrent mounts in a PowerHA or other clustering environment. If the mountguard is enabled, the file system cannot be mounted if it appears to be mounted on another node or system. To temporarily override the mountguard setting, see the noguard option of the mount command.-a options=mountOptions Specifies which mount option is passed into crfs for the file system being created. For a list of the valid options, refer to the mount command.-a quota={userquota | groupquota | userquota,groupquota | no}Specifies the type of quotas that can be enabled on the file system. You can set thequotaattribute to one of the following values: userquota The space for each user cannot exceed the space quota that is assigned for each user. groupquota The space for each group cannot exceed the space quota that is assigned for each group. userquota,groupquota Both user quota and group quota are enabled for each user and group. no All the quotas are disabled on the file system.-a size=Value Specifies the size of an Enhanced Journaled File System (JFS2). Size can be specified in units of 512-byte blocks, Megabytes or Gigabytes. If Value has the M suffix, it is interpreted to be in Megabytes. If Value has a G suffix, it is interpreted to be in Gigabytes. If the specified size is not evenly divisible by the physical partition size, it is rounded up to the closest number that is evenly divisible. This attribute is required when creating a JFS2 file system unless the-dflag has been specified. If the-dflag is specified, the file system is the size of the logical volume. The volume group in which the file system resides defines a maximum logical volume size and limits the file system size. The minimum size for a JFS2 file system is 16 MB. The maximum size is determined by the file system block size:fs block size (byte) MAX fssize (TB) =========================================== 512 4 1024 8 2048 16 4096 32 -a vix={yes|no}Specifies whether the file system can allocate i-node extents smaller than the default of 16 KB if there are no contiguous 16 KB extents free in the file system. After a file system is enabled for small free extents, the file system cannot be accessed on AIX 5.1 or earlier releases. yes The file system can allocate variable-length i-node extents. The yes value is the default value beginning with AIX 6.1. no The file system must use the default size of 16 KB for i-node extents. The no value has no effect if the file system contains variable-length i-node extents. -A— Specifies whether the file system is mounted at each system restart: yes File system is automatically mounted at system restart. no File system is not mounted at system restart (default value). Note: The crfs command accesses the first letter for the auto mount-Aoption.-dDevice — Specifies the device name of a device or logical volume on which to make the file system. This is used to create a file system on an already existing logical volume.-gVolumeGroup — Specifies an existing volume group on which to make the file system. A volume group is a collection of one or more physical volumes.-lLogPartitions — Specifies the size of the log logical volume, expressed as a number of logical partitions. This flag applies only to JFS and JFS2 file systems that do not already have a log device.-mMountPoint — Specifies the mount point, which is the directory where the file system will be made available. Note: If you specify a relative path name, it is converted to an absolute path name before being inserted into the /etc/filesystems file.-nNodeName — Specifies the remote host name where the file system resides. This flag is only valid with remote virtual file systems such as the Network File System (NFS).-p— Sets the permissions for the file system. ro Read-only permissions rw Read-write permissions-t— Specifies whether the file system is to be processed by the accounting subsystem: yes Accounting is enabled on the file system. no Accounting is not enabled on the file system (default value).-uMountGroup — Specifies the mount group.-vVfsType — Specifies the virtual file system type.- Note: The agblksize attribute is set at file system creation and cannot be changed after the file system is
successfully created. The size attribute defines the minimum file system size, and you cannot decrease it once the file system is created.
The ea attributes format is set at file system creation. The chfs command can be used to convert the extended attribute format from v1 to v2, but the format cannot be converted back. The conversion is done in an on-demand manner such that any extended attribute or ACL writes cause the conversion for that file object to occur.
The maxext attribute is ignored in older releases even if the file system was created with it on a later release.
보안
접근 제어: root나 system 그룹 구성원만 실행할 수 있습니다.
(6.1) RBAC와 Trusted AIX 사용자: 이 명령은 특권 작업을 할 수 있으며 특권 사용자만 할 수 있습니다. 권한과 특권은 lssecattr 명령이나 getcmdattr 하위 명령으로 봅니다.
영어 원문
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.
예제
| 명령 | 하는 일 |
|---|---|
crfs -v jfs -g rootvg -m /test -a size=32768 -a frag=512 -a nbpi=1024 |
rootvg에 조각 크기 512바이트, nbpi 1024, 처음 크기 16MB(512 × 32768)인 JFS /test를 만듦 |
crfs -v jfs -g rootvg -m /test -a size=16M -a frag=512 -a nbpi=1024 |
위와 같은 것을 MB 단위로 |
crfs -v jfs2 -g rootvg -m /test -a size=1G -a ea=v2 |
NFS4 ACL을 쓸 수 있는(확장 속성 v2) 1GB JFS2 /test를 만듦 |
자주 쓰는 형태:
crfs -v jfs2 -g datavg -m /data -a size=10G -A yes -a logname=INLINE
mount /data
mklv -y applv -t jfs2 datavg 40 hdisk2 # LV를 먼저 만들고
crfs -v jfs2 -d applv -m /app -A yes # 그 위에 파일 시스템
영어 원문
To make a JFS on the
rootvgvolume group with nondefault fragment size and nondefault nbpi, enter:crfs -v jfs -g rootvg -m /test -a \ size=32768 -a frag=512 -a nbpi=1024This command creates the /test file system on therootvgvolume group with a fragment size of 512 bytes, a number of bytes per i-node (nbpi) ratio of 1024, and an initial size of 16MB (512*32768).To make a JFS on the
rootvgvolume group with nondefault fragment size and nondefault nbpi, enter:crfs -v jfs -g rootvg -m /test -a size=16M -a frag=512 -a nbpi=1024
This command creates the /test file system on the rootvg volume group with a fragment size of 512 bytes, a number of bytes per i-node (nbpi) ratio of 1024, and an initial size of 16MB.
- To create a JFS2 file system which can support NFS4 ACLs, type:
crfs -v jfs2 -g rootvg -m /test -a size=1G -a ea=v2
This command creates the /test JFS2 file system on the rootvg volume group with an initial size of 1 gigabyte. The file system will store extended attributes using the v2 format.
파일
| 파일 | 설명 |
|---|---|
/etc/filesystems |
알려진 파일 시스템과 그 특성 |
영어 원문
- /etc/filesystems — Lists the known file systems and defines their characteristics.
Related reference:
- chfs Command
Related information:
- mkfs command
- File systems
- System Management Interface Tool (SMIT)
- JFS and JFS2 size limitations
리눅스(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는 이것을 한 명령으로 합니다.