cfgmgr 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-cfgmgr
핵심 정리
- 시스템에 새로 붙은 장치를 찾아 구성합니다(Available로 만듦). 디스크·어댑터를 더하거나 SAN에서 LUN을 할당한 뒤 가장 먼저 실행합니다.
- 옵션 없이
cfgmgr는 2단계(보통 부팅) 규칙을 모두 실행해 시스템 전체를 다시 찾습니다. 특정 장치 아래만 찾으려면cfgmgr -l fcs0처럼-l을 줍니다(더 빠름). -v는 무엇을 하는지 자세히 보여 주고,-i 설치매체는 장치 소프트웨어가 없으면 자동으로 설치합니다.- 장치 소프트웨어가 없는 장치를 찾으면
0514-621 WARNING과 설치해야 할 패키지(devices.pci.xxx) 이름을 보여 줍니다. - 구성 규칙은 ODM
Config_Rules에 있으며, 단계(1·2·3)와 순서(seq)대로 실행합니다. 중간에 멈추면 ODM이 망가질 수 있어 인터럽트되지 않습니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 -u Drc Name(슬롯 단위 구성)과 -c Connection(FC 대상 지정 구성)이 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 1, 6.1 Volume 1 |
| 파일 | /usr/sbin/cfgmgr, /etc/objrepos/Config_Rules, /usr/include/sys/cfgdb.h |
| 관련 명령어 | lsdev, mkdev, rmdev, chdev, lsattr, lsslot, installp |
목적
구성 규칙(Configuration Rules) 객체 클래스에 지정된 프로그램을 실행해 장치를 구성하고, 필요하면 장치 소프트웨어를 설치합니다.
영어 원문
Configures devices and optionally installs device software by running the programs specified in the Configuration Rules object class.
구문
cfgmgr [ -f | -s | -p Phase ] [ -i Device ] [ -u Drc Name | -l Name ] [ -v ]
cfgmgr [ -f | -s | -p Phase ] [ -i Device ] [ [ -l Name | -u Drc Name ] -c Connection ] [ -v ]
-u와 -c는 6.1 구문에만 있습니다.
설명
cfgmgr 명령은 장치를 구성하고, 필요하면 장치 소프트웨어를 시스템에 설치합니다. 구성할 수 있는 장치는 장치 구성 데이터베이스에 속한 구성 규칙 객체 클래스가 제어합니다. 구성 규칙마다 다음을 정합니다.
- 실행할 프로그램의 전체 경로
- 다른 규칙과 비교해 언제 실행할지
- 어느 단계(phase)에서 실행할지
시스템을 부팅할 때 cfgmgr는 시스템을 쓰는 데 필요한 모든 장치를 구성합니다. 부팅은 두 단계입니다.
- 1단계: 커널이 올라오고 부트 파일 시스템이 초기화될 때 시작합니다. 이 단계에서
cfgmgr를-f로 불러 1단계 구성 규칙을 모두 실행하며, 그 결과 기본 장치가 구성됩니다. - 2단계:
cfgmgr를-s로 부릅니다.
cfgmgr는 세 단계의 구성 규칙을 압니다.
- 1단계
- 2단계(보통 부팅의 두 번째 부팅 단계)
- 3단계(서비스 부팅의 두 번째 부팅 단계)
cfgmgr는 부를 때 지정한 단계의 규칙을 모두 실행합니다(예: -f면 1단계). 다만 -l을 주면 그 장치와 자식만 구성합니다.
단계 옵션(-f, -s, -p) 없이 부르면 2단계 규칙을 실행합니다. 3단계 규칙은 -p로만 실행할 수 있습니다.
각 단계의 규칙은 seq 필드 값으로 순서를 정합니다. seq는 같은 단계의 다른 규칙과 비교한 우선순위로, 값이 클수록 나중에 실행합니다. 예를 들어 1인 규칙이 10인 규칙보다 먼저 실행됩니다. 다만 0은 "상관없음"을 뜻해 맨 나중에 실행합니다. 그래서 1이 가장 먼저 실행됩니다.
장치를 구성하다가 장치 소프트웨어가 설치되지 않은 장치를 찾으면, 설치해야 할 장치 패키지 이름이나 가능한 이름 목록과 함께 경고를 보여 줍니다. 패키지 이름을 정확히 알면 경고 아래 줄에 그 이름 하나를, 모르면 가능한 이름을 콜론으로 나눠 한 줄에 보여 줍니다. 소프트웨어 없는 장치가 여럿이면 장치마다 한 줄씩 보여 줍니다.
cfgmgr: 0514-621 WARNING: The following device packages are
required for device support but are not currently
installed.
devices.pci.22100020
devices.pci.14101800
devices.pci.scsi:devices.pci.00100300:devices.pci.NCR.53C825
이 예에서는 소프트웨어가 없는 장치 두 개의 패키지 이름을 보여 주고, 세 번째 장치는 가능한 패키지 이름 여러 개를 보여 줍니다. 가능한 이름이 여럿이면 보통 설치 매체에는 그중 하나만 실제로 있으며 그것을 설치합니다. 여럿이 실제로 있으면 목록에서 설치 매체에 있는 첫 번째 패키지를 설치합니다. -i를 주면 올바른 패키지를 설치합니다.
-i로 부르면 새로 찾은 장치마다 장치 소프트웨어를 자동으로 설치하려 합니다. -i의 Device는 설치 매체 위치로, 하드웨어 장치(테이프, 디스켓 등), 설치 이미지가 있는 디렉터리, 설치 이미지 파일 자체를 쓸 수 있습니다.
주의: 구성 데이터베이스를 보호하려고 cfgmgr는 인터럽트되지 않습니다. 끝나기 전에 멈추면 데이터베이스가 망가질 수 있습니다.
영어 원문
The cfgmgr command configures devices and optionally installs device software into the system. The configurable devices are controlled by the Configuration Rules object class, which is part of the Device Configuration database. Each configuration rule specifies the following:
The full path name of an executable program to run
When to run the program (in relation to the other rules)
In which phase to run the program
During system boot, the cfgmgr command configures all the devices that are necessary to use the system. System boot is a two-step process:
Called phase 1, this step begins when the kernel is brought into the system and the boot file system is initialized. During this phase, the cfgmgr command is invoked, specifying this as phase 1 by using the
-fflag. The cfgmgr command runs all of the phase 1 configuration rules, which results in the base devices being configured.Phase 2 execution begins, and the cfgmgr command is called with the
-sflag.
The cfgmgr command recognizes three phases of configuration rules:
Phase 1
Phase 2 (second boot phase for normal boot)
Phase 3 (second boot phase for service boot)
The cfgmgr command runs all of the rules for the phase specified during invocation (for example, phase 1 rules for the -f flag). However, if the -l flag is used, the cfgmgr command configures only the named device and its children.
If the cfgmgr command is invoked without a phase option (for example, without the -f,-s, or -p flags), then the command runs the phase 2 rules. The only way to run the phase 3 rules is with the -p flag.
The configuration rules for each phase are ordered based on the values specified in the seq field. This field is an integer that specifies the priority in which to run this rule, relative to the other rules for this phase. The higher the number specified by the seq field, the lower the priority. For example, a value of 1 specified in the seq field is executed before a rule with a value of 10. There is one exception: a seq field value of 0 implies a "don't care" condition, and runs last. Therefore, a seq field value of 1 is the highest priority and runs first.
If there are any devices detected that have no device software installed when configuring devices, the cfgmgr command returns a warning message with the name or a list of possible names for the device package that must be installed. If the specific name of the device package is determined, it is displayed as the only package name on a line below the warning message. If the specific name cannot be determined,
a colon-separated list of possible package names is displayed on a single line. A package name or list of possible package names is displayed for each of the devices, if more than one device is detected without its device software.
The system displays the following warning message when devices without their device software are detected: cfgmgr: 0514-621 WARNING: The following device packages are
required for device support but are not currently
installed.
devices.pci.22100020 devices.pci.14101800 devices.pci.scsi:devices.pci.00100300:devices.pci.NCR.53C825
In this example, two devices missing software were found, and the cfgmgr command displays the names of the device packages that must be installed. A third device that is also missing software was found, but in this case, the cfgmr command displays several possible device package names.
When more than one possible package name is identified for a device, only one of the names will actually correspond to a device package on the installation medium. This is the package you must install. However, in some cases, more than one of the names will correspond to actual device packages on the installation medium. In this case, the first package name in the list for which there is a device package on the install medium is the package that must be installed. If the cfgmgr command is used with the -i flag, then the correct packages will be installed.
If you invoke the cfgmgr command with the -i flag, the command attempts to install device software automatically for each new detected device. The Device variable of the -i flag specifies where to find the installation medium. The installation medium can be a hardware device (such as a tape or diskette drive), a directory that contains installation images, or the installation image file itself.
Attention: To protect the Configuration database, the cfgmgr command is not interruptible. Stopping this command before it is complete could result in a corrupted database.
플래그
| 플래그 | 설명 |
|---|---|
-c Connection |
특정 대상 장치를 구성하는 데 필요한 연결 정보. 형식은 "Targeted configuration of FC and FCoE devices"를 봅니다. 6.1부터 |
-u Drc name |
자식과 함께 구성할 PCI 슬롯이나 가상 슬롯의 DRC 이름. lsslot으로 얻습니다. 6.1부터 |
-f |
1단계 구성 규칙을 실행합니다. 실행 중(시스템 시작 뒤)에는 쓸 수 없습니다. |
-i Device |
설치 매체 위치. |
-l Name |
자식과 함께 구성할 장치 이름. |
-p Phase |
지정한 단계를 실행합니다. |
-s |
2단계 구성 규칙을 실행합니다. |
-v |
자세한 출력. 하는 일을 표준 출력에 씁니다. |
영어 원문
-cConnection — Specifies the connection information required to configure the specific targeted device. See the Targeted configuration of FC and FCoE devices instructions regarding the connection information for a specific device.-uDrc name — Specifies the Drc name variable of the Peripheral Component Interconnect (PCI) or virtual slot to configure along with the children of the slot. You can get the Drc name variable of the device by using the lsslot command.-f— Specifies that the cfgmgr command runs the phase 1 configuration rules. This flag is not valid at run time (after system start).-iDevice — Specifies the location of the installation medium.-lName — Specifies the named device to configure along with the children of the device.-pPhase — Specifies that the cfgmgr command runs the specified phase.-s— Specifies that the cfgmgr command runs the phase 2 configuration rules.-v— Specifies verbose output. The cfgmgr command writes information about what it is doing to standard output.
Configuration Rules
| 필드 | 설명 |
|---|---|
phase |
규칙이 속한 단계. 1, 2, 3(서비스 모드의 두 번째 부팅 단계). |
seq |
규칙의 상대 우선순위(정수). |
rule |
실행할 프로그램의 전체 경로를 담은 문자열. 플래그도 넣을 수 있으며 명령줄에 입력한 것처럼 프로그램 이름 뒤에 둡니다. |
영어 원문
- phase — Specifies whether this rule belongs to phase 1, phase 2, or phase 3 (second boot phase for service mode).
- seq — Specifies the relative priority of this rule as an integer.
- rule — A string containing the full path name of a program to execute. It can also contain any flags, but they must follow the program name as the whole string run as if it was typed on the command line.
보안
접근 제어: root와 system 그룹 구성원만 이 명령의 실행(x) 권한을 가져야 합니다.
감사 이벤트: DEV_Configure(장치 이름).
영어 원문
Access Control: Only the root user and members of the system group should have execute (x) access to this command.
Auditing Event:
Event Information DEV_Configure Device name
예제
아래 예는 구성 규칙이 다음과 같다고 봅니다(phase, seq, rule).
| phase | seq | rule |
|---|---|---|
| 1 | 10, 12 | defsys, deflvm |
| 2 | 10, 12, 13, 17, 18, 19, 20, 20, 22, 25, 27 | defsys, deflvm, startusb, cfgvlan -2, cfgrcnet, ptynode, vconnode, startlft, startrcm, starttty, startsgio |
| 2 | 0 | defaio, def_posix_aio, cfg_perfstat load, load_blockset_ext |
| 3 | 10, 12, 13, 15, 19, 20, 20, 22, 27 | defsys, deflvm, startusb, starttty, ptynode, startlft, vconnode, startrcm, startsgio |
cfgmgr -f는 1단계 규칙을defsys,deflvm순서로 실행합니다.-f는 실행 중에 쓸 수 없습니다.cfgmgr -s는 2단계 규칙을 seq 순서로 실행하고, seq가 0인 규칙(defaio,def_posix_aio,cfg_perfstat load,load_blockset_ext)을 맨 나중에 실행합니다.cfgmgr -p 3은 3단계 규칙을defsys,deflvm,startusb,starttty,ptynode,startlft,vconnode,startrcm,startsgio순서로 실행합니다.- 플래그 없이
cfgmgr를 실행하면-s와 같이 2단계 규칙을 실행합니다.
| 명령 | 하는 일 |
|---|---|
cfgmgr -l scsi0 |
scsi0 어댑터에 붙은 장치를 찾아 구성 |
cfgmgr -l fscsi0 -c "ww_name=0x5001738000330191,lun_id=0x1000000000000" |
(6.1) fscsi0 아래에서 -c로 지정한 연결의 자식 장치만 구성 |
cfgmgr -i /usr/sys/inst.images |
구성하면서 /usr/sys/inst.images의 소프트웨어로 장치 소프트웨어를 자동 설치 |
자주 쓰는 형태:
cfgmgr -v # 전체 다시 찾기(자세히)
cfgmgr -l fcs0; lsdev -Cc disk # FC 어댑터 아래 새 LUN 찾기
cfgmgr -l vio0 # (VIO 클라이언트) 가상 장치 다시 찾기
odmget Config_Rules | more # 구성 규칙 보기
영어 원문
These examples are based on the configuration rules containing the following information: phase seq rule
1 10 /usr/lib/methods/defsys 1 12 /usr/lib/methods/deflvm
2 10 /usr/lib/methods/defsys 2 12 /usr/lib/methods/deflvm 2 13 /etc/methods/startusb 2 17 /etc/methods/cfgvlan -2 2 18 /usr/lib/methods/cfgrcnet 2 19 /usr/lib/methods/ptynode 2 20 /etc/methods/vconnode 2 20 /usr/lib/methods/startlft 2 22 /etc/methods/startrcm 2 25 /usr/lib/methods/starttty 2 27 /etc/methods/startsgio 2 0 /usr/lib/methods/defaio 2 0 /usr/lib/methods/def_posix_aio 2 0 /usr/lib/perf/cfg_perfstat load 2 0 /usr/lib/perf/load_blockset_ext
3 10 /usr/lib/methods/defsys 3 12 /usr/lib/methods/deflvm 3 13 /etc/methods/startusb 3 15 /usr/lib/methods/starttty 3 19 /usr/lib/methods/ptynode 3 20 /usr/lib/methods/startlft 3 20 /etc/methods/vconnode 3 22 /etc/methods/startrcm 3 27 /etc/methods/startsgio
- When the cfgmgr command is invoked with the
-fflag, the command gets all of the configuration rules with phase = 1 and runs them in the following order:/usr/lib/methods/defsys /usr/lib/methods/deflvm
Note: The -f flag cannot be used during run time.
- When the cfgmgr command is run with the
-sflag, the command gets all of the configuration rules with phase = 2 and runs them in the following order:
/usr/lib/methods/defsys
/usr/lib/methods/deflvm
/etc/methods/cfgvlan -2
/usr/lib/methods/cfgrcnet
/usr/lib/methods/ptynode
/etc/methods/vconnode
/usr/lib/methods/startlft
/etc/methods/startrcm
/usr/lib/methods/starttty
/etc/methods/startsgio
/usr/lib/methods/defaio
/usr/lib/methods/def_posix_aio
/usr/lib/perf/cfg_perfstat load
/usr/lib/perf/load_blockset_ext
- When the cfgmgr command is run with the
-p 3flag, the command gets all of the configuration rules with phase = 3 and runs them in the following order:
/usr/lib/methods/defsys
/usr/lib/methods/deflvm
/etc/methods/startusb
/usr/lib/methods/starttty
/usr/lib/methods/ptynode
/usr/lib/methods/startlft
/etc/methods/vconnode
/etc/methods/startrcm
/etc/methods/startsgio
- If the cfgmgr command is run without a flag, the command functions the same as when used with the -s flag. Thus, the phase 2 rules are run in the the following order:
/usr/lib/methods/defsys
/usr/lib/methods/deflvm
/etc/methods/cfgvlan -2
/usr/lib/methods/cfgrcnet
/usr/lib/methods/ptynode
/etc/methods/vconnode
/usr/lib/methods/startlft
/etc/methods/startrcm
/usr/lib/methods/starttty
/etc/methods/startsgio
/usr/lib/methods/defaio
/usr/lib/methods/def_posix_aio
/usr/lib/perf/cfg_perfstat load
/usr/lib/perf/load_blockset_ext
- To configure detected devices attached to the
scsi0adapter, type the following:
cfgmgr -l scsi0
- To configure the child device of the
fscsi0adapter that is attached to the connection specified by the-cflag, type the following:
cfgmgr -l fscsi0 -c "ww_name=0x5001738000330191,lun_id=0x1000000000000"
- To install device software automatically during configuration with the software contained in the
/usr/sys/inst.imagesdirectory, type the following:
cfgmgr -i /usr/sys/inst.images
파일
| 파일 | 설명 |
|---|---|
/usr/sbin/cfgmgr |
명령 파일 |
/usr/include/sys/cfgdb.h |
구성 규칙 객체 클래스 필드의 숫자 표현 |
영어 원문
- /usr/sbin/cfgmgr — Specifies the command file.
- /usr/include/sys/cfgdb.h — Contains numeric representations for fields in the Configuration Rules object class.
Related reference:
- chdev Command
Related information:
- lsattr command
- lsdev command
- mkdev command
- rmdev command
리눅스(GNU)와 다른 점
리눅스에는 ODM 같은 장치 구성 데이터베이스가 없고, 장치는 커널과 udev가 자동으로 인식합니다. 장치 목록은 lspci, lsusb, lsblk, lshw, ip link로, 속성은 /sys 아래 파일이나 udevadm info로 봅니다. 장치 다시 찾기는 echo "- - -" > /sys/class/scsi_host/host0/scan이나 rescan-scsi-bus.sh가 cfgmgr에 가깝습니다. 장치 드라이버 패키지를 자동 설치하는 기능은 없고, 배포판의 펌웨어·드라이버 패키지를 따로 설치합니다.