[AIX 운영 체제와 장치 관리 2] 시스템 실행 수준, 부팅 과정과 RAM 파일 시스템, 시작 문제 해결, 백업 개념

핵심 정리

  • 실행 수준: 01 예약, 2 기본, 39 사용자 정의, a·b·c는 지금 프로세스를 죽이지 않고 해당 프로세스만 시작, Q·q는 inittab 다시 읽기. 지금 수준은 cat /etc/.init.state, 이력은 /usr/lib/acct/fwtmp </var/adm/wtmp에서 run-level을 걸러 봅니다. 바꿀 때는 getty가 모든 수준에서 켜져 있는지 확인하고 wall로 알린 뒤 smit telinit.
  • 부팅 종류는 하드 디스크, 디스크 없는 네트워크, 유지 보수 부팅입니다. 하드 디스크 부팅은 펌웨어(부트 목록, PSN 부트 레코드, 부트 이미지) → rc.boot 1단계(restbase, cfgmgr 1단계로 기본 장치) → 2단계(ipl_varyon, 파일 시스템 마운트, swapon, ODM 복사) → inittab의 3단계(/tmp 마운트, cfgmgr 2단계, savebase)로 진행합니다.
  • 유지 보수 부팅은 CD·DVD·테이프·네트워크에서 rootvg를 varyon하지 않고 페이징도 하지 않습니다. RAM 파일 시스템은 부팅 종류별 원형 파일로 bosboot·mkfs가 만듭니다.
  • 부팅 실패 원인은 하드웨어, 부트 매체, 네트워크 부트 서버, 손상된 파일 시스템, rc.boot 같은 스크립트 오류입니다. (6.1) 참조 코드 2702와 INSUFFICIENT ENTITLED MEMORY는 HMC에서 진입 메모리를 늘립니다.
  • 백업은 이름 기준(backup -i, 개별 파일)과 i-node 기준(파일 시스템, 증분 가능)이 있습니다. 백업을 주기적으로 검사하고 옛 백업을 남기고, 백업 전 fsck와 사용하지 않는 상태를 지키며, 시스템 데이터와 사용자 데이터(/home)를 나눠 둡니다. 복원은 같은 종류의 플랫폼에서만 합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 진입 메모리 부족 참조 코드 2702 등이 더해짐)
원문 Operating system and device management — 5.3판 719쪽·148151쪽, 6.1판 13~23쪽
파일 /etc/inittab, /etc/.init.state, /var/adm/wtmp, /sbin/rc.boot, /dev/rfd0, /dev/rmt0
관련 명령어 init, telinit, fwtmp, wall, bootlist, cfgmgr, savebase, bosboot, backup, mksysb, savevg, cpio, tar, dd, pax, restore, fsck, tapechk

시스템 실행 수준(run level)은 시스템 상태를 지정하고 어떤 프로세스를 시작할지 정의합니다.

예를 들어 시스템 실행 수준이 3이면 그 실행 수준에서 동작하도록 정의된 모든 프로세스가 시작됩니다. 부팅 과정의 시스템 부팅 단계가 끝날 무렵 /etc/inittab 파일의 initdefault 항목에서 실행 수준을 읽습니다. 시스템은 바꾸라는 신호를 받을 때까지 그 실행 수준에서 동작합니다. 시스템 실행 수준은 init 명령으로 바꿀 수 있습니다. /etc/inittab 파일에는 프로세스마다 그 프로세스의 실행 수준을 정의하는 레코드가 있습니다. 시스템이 부팅하면 init 명령이 /etc/inittab 파일을 읽어 어떤 프로세스를 시작할지 정합니다.

지금 정의된 실행 수준은 다음과 같습니다.

실행 수준 설명
0-9 init 명령이 실행 수준 0~9로 바꾸면 지금 실행 수준의 모든 프로세스를 죽인 뒤 새 실행 수준에 연결된 프로세스를 다시 시작합니다.
0-1 앞으로 운영 체제가 쓰려고 예약했습니다.
2 기본 실행 수준
3-9 사용자가 원하는 대로 정의할 수 있습니다.
a, b, c init 명령이 실행 수준 a, b, c로 바꾸라고 요청하면 지금 실행 수준의 프로세스를 죽이지 않고, 새 실행 수준에 할당된 프로세스만 시작합니다.
Q, q init 명령에 /etc/inittab 파일을 다시 살펴보라고 알립니다.

관련 작업:

  • /etc/inittab 파일 고치기: /etc/inittab 파일의 레코드를 고치는 명령은 네 가지입니다.

시스템 실행 수준 알아보기

운영 체제를 정비하거나 시스템 실행 수준을 바꾸기 전에 여러 실행 수준을 살펴봐야 할 수 있습니다.

이 절차는 시스템이 동작하는 실행 수준을 알아보는 방법과 이전 실행 수준의 이력을 보여 주는 방법을 설명합니다. 시스템 실행 수준은 init 명령이 정합니다.

현재 실행 수준 알아보기

명령행에서 cat /etc/.init.state를 입력합니다. 시스템이 숫자 하나를 보여 주며 그것이 현재 실행 수준입니다. 실행 수준에 관한 자세한 정보는 init 명령이나 /etc/inittab 파일을 봅니다.

이전 실행 수준의 이력 보기

fwtmp 명령으로 이전 실행 수준의 이력을 볼 수 있습니다.

참고: 이 명령을 쓰려면 시스템에 bosext2.acct.obj 코드가 설치되어 있어야 합니다.

  1. root 사용자로 로그인합니다.
  2. 명령 프롬프트에서 다음을 입력합니다.
text
/usr/lib/acct/fwtmp </var/adm/wtmp |grep run-level

시스템이 다음과 비슷한 정보를 보여 줍니다.

text
run-level 2  0 1 0062 0123 697081013 Sun Feb  2 19:36:53 CST 1992
run-level 2  0 1 0062 0123 697092441 Sun Feb  2 22:47:21 CST 1992
run-level 4  0 1 0062 0123 698180044 Sat Feb 15 12:54:04 CST 1992
run-level 2  0 1 0062 0123 698959131 Sun Feb 16 10:52:11 CST 1992
run-level 5  0 1 0062 0123 698967773 Mon Feb 24 15:42:53 CST 1992

다중 사용자 시스템에서 실행 수준 구성

다중 사용자 시스템에서 실행 수준을 바꿀 수 있습니다.

  1. /etc/inittab 파일을 확인해 바꿀 실행 수준이 지금 실행 중인 프로세스를 지원하는지 확인합니다. getty 프로세스는 시스템 콘솔과 다른 로그인의 터미널 회선 접근을 제어하므로 특히 중요합니다. getty 프로세스가 모든 실행 수준에서 켜져 있는지 확인합니다.
  2. wall 명령으로 모든 사용자에게 실행 수준을 바꿀 것이라고 알리고 로그오프를 요청합니다. wall 명령에 관한 자세한 정보는 wall을 봅니다.
  3. smit telinit 빠른 경로로 Set System Run Level 메뉴에 들어갑니다.
  4. System RUN LEVEL 필드에 새 실행 수준을 입력합니다.
  5. Enter를 눌러 이 절차의 모든 설정을 적용합니다. 시스템은 실행 수준 변경으로 끝나거나 시작하는 프로세스를 알려 주고 다음 메시지를 보여 줍니다.
text
INIT: New run level: n

여기서 n은 새 실행 수준 번호입니다.

단일 사용자 시스템에서 실행 수준 구성

단일 사용자 시스템에서 실행 수준을 바꿀 수 있습니다.

  1. /etc/inittab 파일을 확인해 바꿀 실행 수준이 지금 실행 중인 프로세스를 지원하는지 확인합니다. getty 프로세스는 시스템 콘솔과 다른 로그인의 터미널 회선 접근을 제어하므로 특히 중요합니다. getty 프로세스가 모든 실행 수준에서 켜져 있는지 확인합니다. inittab 파일에 관한 자세한 정보는 inittab을 봅니다.
  2. smit telinit 빠른 경로로 Set System Run Level 메뉴에 들어갑니다. telinit 명령에 관한 자세한 정보는 telinit을 봅니다.
  3. System RUN LEVEL 필드에 새 시스템 실행 수준을 입력합니다.
  4. Enter를 눌러 이 절차의 모든 설정을 적용합니다. 시스템은 실행 수준 변경으로 끝나거나 시작하는 프로세스를 알려 주고 다음 메시지를 보여 줍니다.
text
INIT: New run level: n

여기서 n은 새 실행 수준 번호입니다.

영어 원문

System run level

The system run level specifies the system state and defines which processes are started.

For example, when the system run level is 3, all processes defined to operate at that run level are started. Near the end of the system boot phase of the boot process, the run level is read from the initdefault entry of the /etc/inittab file. The system operates at that run level until it receives a signal to change it. The system run level can be changed with the init command. The /etc/inittab file contains a record for each process that defines run levels for that process. When the system boots, the init command reads the /etc/inittab file to determine which processes to start.

The following are the currently-defined run levels:

  • 0-9 — When the init command changes to run levels 0-9, it kills all processes at the current run levels then restarts any processes associated with the new run levels.
  • 0-1 — Reserved for the future use of the operating system.
  • 2 — Default run level.
  • 3-9 — Can be defined according to the user's preferences.
  • a, b, c — When the init command requests a change to run levels a, b, or c, it does not kill processes at the current run levels; it simply starts any processes assigned with the new run levels.
  • Q, q — Tells the init command to reexamine the /etc/inittab file.

Related tasks

Modifying the /etc/inittab file Four commands are available to modify the records in the etc/inittab file.

Identifying the system run level

Before performing maintenance on the operating system or changing the system run level, you might need to examine the various run levels.

This procedure describes how to identify the run level at which the system is operating and how to display a history of previous run levels. The init command determines the system run level.

Identification of the current run level

At the command line, type cat /etc/.init.state. The system displays one digit; that is the current run level. See the init command or the /etc/inittab file for more information about run levels.

Displaying a history of previous run levels:

You can display a history of previous run levels using the fwtmp command.

Note: The bosext2.acct.obj code must be installed on your system to use this command.

  1. Log in as root user.

  2. Type the following at a command prompt:

text
/usr/lib/acct/fwtmp </var/adm/wtmp |grep run-level

The system displays information similar to the following:

text
run-level 2  0 1 0062 0123 697081013 Sun Feb  2 19:36:53 CST 1992
run-level 2  0 1 0062 0123 697092441 Sun Feb  2 22:47:21 CST 1992
run-level 4  0 1 0062 0123 698180044 Sat Feb 15 12:54:04 CST 1992
run-level 2  0 1 0062 0123 698959131 Sun Feb 16 10:52:11 CST 1992
run-level 5  0 1 0062 0123 698967773 Mon Feb 24 15:42:53 CST 1992

Configuring run levels on multiuser systems

You can change run levels on multiuser systems.

  1. Check the /etc/inittab file to confirm that the run level to which you are changing supports the processes that you are running. The getty process is particularly important, since it controls the terminal line access for the system console and other logins. Ensure that the getty process is enabled at all run levels.

  2. Use the wall command to inform all users that you intend to change the run level and request that users log off. For more information about the wall command, see wall.

  3. Use the smit telinit fast path to access the Set System Run Level menu.

  4. Type the new run level in the System RUN LEVEL field.

  5. Press Enter to implement all of the settings in this procedure. The system responds by telling you which processes are terminating or starting as a result of the change in run level and by displaying the message:

text
INIT: New run level: n

where n is the new run-level number.

Configuring run levels on single-user systems

You can change run levels on single-user systems.

  1. Check the /etc/inittab file to confirm that the run level to which you are changing supports the processes that you are running. The getty process is particularly important, since it controls the terminal line access for the system console and other logins. Ensure that the getty process is enabled at all run levels. For more information about the inittab file, see inittab.

  2. Use the smit telinit fast path to access the Set System Run Level menu. For more information about the telinit command, see telinit.

  3. Type the new system run level in the System RUN LEVEL field.

  4. Press Enter to implement all of the settings in this procedure. The system responds by telling you which processes are terminating or starting as a result of the change in run level and by displaying the message:

text
INIT: New run level: n

where n is the new run-level number.

부팅 과정

시스템 부팅에는 세 가지 종류가 있고, 운영 체제를 부팅하려면 두 가지 자원이 필요합니다.

부팅 과정에서 시스템은 하드웨어를 시험하고, 운영 체제를 올려 실행하고, 장치를 구성합니다. 운영 체제를 부팅하려면 다음 자원이 필요합니다.

  • 기계를 켜거나 재설정한 뒤 올릴 수 있는 부트 이미지
  • 루트(/)와 /usr 파일 시스템에 대한 접근

시스템 부팅에는 세 가지 종류가 있습니다.

부팅 종류 설명
하드 디스크 부팅 보통 운영을 위해 기계를 시작합니다.
디스크 없는 네트워크 부팅 디스크가 없거나(diskless) 데이터 디스크만 있는(dataless) 워크스테이션을 네트워크 너머로 원격 시작합니다. 보통 운영을 위해 기계를 시작합니다. 원격 파일 서버 하나 이상이 이런 워크스테이션이 부팅하는 데 필요한 파일과 프로그램을 제공합니다.
유지 보수 부팅 하드 디스크, 네트워크, 테이프, CD-ROM에서 유지 보수 모드로 기계를 시작합니다. 시스템 관리자는 새 소프트웨어나 갱신된 소프트웨어 설치, 진단 검사 같은 작업을 할 수 있습니다.

하드 디스크 부팅에서는 운영 체제를 설치할 때 만든 로컬 디스크에서 부트 이미지를 찾습니다. 부팅 과정에서 시스템은 기계에 있는 모든 장치를 구성하고, 시스템이 동작하는 데 필요한 다른 기본 소프트웨어(LVM 등)를 초기화합니다. 이 과정이 끝나면 파일 시스템이 마운트되어 쓸 준비가 됩니다.

디스크 없는 네트워크 클라이언트에도 같은 일반 요구 사항이 적용됩니다. 이들도 부트 이미지와 운영 체제 파일 트리에 대한 접근이 필요합니다. 디스크 없는 네트워크 클라이언트는 로컬 파일 시스템이 없고 모든 정보를 원격 접근으로 얻습니다.

시스템 부팅 처리

대부분의 사용자는 일반 운영을 위해 시스템을 시작할 때 하드 디스크 부팅을 합니다. 시스템은 부팅 과정에 필요한 모든 정보를 자기 디스크 드라이브에서 찾습니다.

전원 스위치를 켜서 시스템을 시작하거나(cold boot) reboot이나 shutdown 명령으로 다시 시작하면(warm boot) 시스템을 쓸 준비가 되기 전에 여러 이벤트가 일어나야 합니다. 이 이벤트는 다음 단계로 나눌 수 있습니다.

펌웨어 단계

펌웨어는 시스템이 운영 체제를 올려 실행할 준비를 합니다.

초기화 단계는 다음과 같습니다.

  1. 펌웨어가 운영 체제를 시작하는 데 필요한 시스템 자원에 기본 시험을 합니다.

  2. 펌웨어가 쓸 수 있는 부트 장치 목록인 사용자 부트 목록을 확인합니다. 이 부트 목록은 bootlist 명령으로 필요에 맞게 바꿀 수 있습니다. NVRAM(non-volatile random access memory)의 사용자 부트 목록이 올바르지 않거나 올바른 부트 장치를 찾지 못하면 기본 부트 목록을 확인합니다. 어느 경우든 부트 목록에서 처음 찾은 올바른 부트 장치로 시스템을 시작합니다. NVRAM에 올바른 사용자 부트 목록이 있으면 목록의 장치를 순서대로 확인합니다. 사용자 부트 목록이 없으면 버스의 모든 어댑터와 장치를 확인합니다. 어느 경우든 시스템 시작에 쓸 올바른 부트 장치를 찾을 때까지 장치를 계속 되풀이해 확인합니다.

    참고: 시스템은 보통 모드 부팅용 기본 부트 목록을 NVRAM에 저장해 유지합니다. 별도의 서비스 모드 부트 목록도 NVRAM에 저장되며, 서비스 모드 부트 목록에 접근하는 방법은 해당 모델의 하드웨어 지시를 봐야 합니다.

  3. 올바른 부트 장치를 찾으면 첫 레코드, 곧 PSN(program sector number)을 확인합니다. 올바른 부트 레코드면 메모리로 읽어 메모리의 IPL 제어 블록에 더합니다. 핵심 부트 레코드 데이터에는 부트 장치에서 부트 이미지의 시작 위치, 부트 이미지의 길이, 부트 이미지를 메모리 어디에 올릴지에 관한 지시가 들어 있습니다.

  4. 부트 이미지를 부트 장치에서 메모리로, NVRAM에 지정한 위치부터 순차적으로 읽습니다. 디스크 부트 이미지는 커널, RAM 파일 시스템, 기본 사용자 정의 장치 정보로 이루어집니다.

  5. 제어가 커널로 넘어가고 커널이 시스템 초기화를 시작합니다.

  6. 커널이 init를 실행하고, init가 rc.boot 스크립트의 1단계를 실행합니다.

커널 초기화 단계가 끝나면 기본 장치 구성이 시작됩니다.

기본 장치 구성 단계

init 프로세스가 rc.boot 스크립트를 시작합니다. rc.boot 스크립트의 1단계가 기본 장치 구성을 합니다.

rc.boot 스크립트의 1단계는 다음과 같습니다.

  1. 부트 스크립트가 restbase 프로그램을 불러, 압축된 사용자 정의 데이터에서 RAM 파일 시스템에 사용자 정의 ODM(Object Data Manager) 데이터베이스를 만듭니다.
  2. 부트 스크립트가 구성 관리자를 시작하며, 구성 관리자는 1단계 ODM 구성 규칙에 접근해 기본 장치를 구성합니다.
  3. 구성 관리자가 sys, bus, disk, SCSI, LVM(Logical Volume Manager), rootvg 볼륨 그룹 구성 메서드를 시작합니다.
  4. 구성 메서드가 장치 드라이버를 올리고, 특수 파일을 만들고, ODM 데이터베이스의 사용자 정의 데이터를 갱신합니다.

시스템 부팅

이 절차로 시스템 부팅 단계를 마칩니다.

  1. init 프로세스가 rc.boot 스크립트의 2단계 실행을 시작합니다. rc.boot의 2단계는 다음과 같습니다.

    1. ipl_varyon 프로그램을 불러 rootvg 볼륨 그룹을 varyon합니다.

    2. 하드 디스크 파일 시스템을 보통 마운트 지점에 마운트합니다.

    3. swapon 프로그램을 실행해 페이징을 시작합니다.

    4. RAM 파일 시스템의 ODM 데이터베이스에 있는 사용자 정의 데이터를 하드 디스크 파일 시스템의 ODM 데이터베이스로 복사합니다.

    5. rc.boot 스크립트를 빠져나옵니다.

  2. rc.boot 스크립트의 2단계가 끝나면 부팅 과정이 RAM 파일 시스템에서 하드 디스크에 저장된 파일 시스템으로 바뀝니다.

  3. 그런 다음 init 프로세스가 /etc/inittab 파일의 레코드로 정의된 프로세스를 실행합니다. /etc/inittab 파일의 지시 가운데 하나가 rc.boot 스크립트의 3단계를 실행하며, 3단계는 다음과 같습니다.

    1. /tmp 하드 디스크 파일 시스템을 마운트합니다.

    2. 구성 관리자 2단계를 시작해 나머지 모든 장치를 구성합니다.

    3. savebase 명령으로 사용자 정의 데이터를 부트 논리 볼륨에 저장합니다.

    4. rc.boot 스크립트를 빠져나옵니다.

이 과정이 끝나면 시스템이 올라와 쓸 준비가 됩니다.

유지 보수 부팅 과정

새 소프트웨어나 갱신된 소프트웨어 설치, 진단 검사, 정비 같은 특수 작업을 하려고 부팅해야 할 때가 있습니다. 이 경우 시스템은 CD-ROM, DVD, 테이프 드라이브, 네트워크, 디스크 드라이브 같은 부팅 가능한 매체에서 시작합니다.

유지 보수 부팅의 이벤트 순서는 보통 부팅과 비슷합니다.

  1. 펌웨어가 운영 체제를 시작하는 데 필요한 시스템 자원에 기본 시험을 합니다.

  2. 펌웨어가 사용자 부트 목록을 확인합니다. bootlist 명령으로 사용자 부트 목록을 필요에 맞게 바꿀 수 있습니다. NVRAM의 사용자 부트 목록이 올바르지 않거나 올바른 부트 장치를 찾지 못하면 기본 부트 목록을 확인합니다. 어느 경우든 부트 목록에서 처음 찾은 올바른 부트 장치로 시스템을 시작합니다.

    참고: 보통 부팅을 위해 운영 체제는 기본 부트 목록과 사용자 부트 목록도 NVRAM에 저장해 유지합니다. 유지 보수 모드로 시스템을 시작하기 위한 별도의 기본 부트 목록과 사용자 부트 목록도 유지합니다.

  3. 올바른 부트 장치를 찾으면 첫 레코드, 곧 PSN을 확인합니다. 올바른 부트 레코드면 메모리로 읽어 메모리의 IPL(initial program load) 제어 블록에 더합니다. 핵심 부트 레코드 데이터에는 부트 장치에서 부트 이미지의 시작 위치, 부트 이미지의 길이, 부트 이미지가 메모리에 올라왔을 때 실행을 시작할 진입점의 오프셋이 들어 있습니다.

  4. 부트 이미지를 부트 장치에서 메모리로, NVRAM에 지정한 위치부터 순차적으로 읽습니다.

  5. 제어가 커널로 넘어가고 커널이 RAM 파일 시스템의 프로그램을 실행하기 시작합니다.

  6. ODM 데이터베이스 내용으로 어떤 장치가 있는지 정하고, cfgmgr 명령이 루트 파일 시스템을 담을 모든 디스크를 포함해 찾은 모든 장치를 동적으로 구성합니다.

  7. CD-ROM, DVD, 테이프, 네트워크로 시스템을 부팅하면 rootvg 볼륨 그룹(rootvg)을 varyon하지 않습니다. (새 시스템에 운영 체제를 설치할 때처럼) rootvg가 없을 수 있기 때문입니다. 이때 네트워크 구성이 일어날 수 있습니다. 유지 보수 부팅에서는 페이징이 일어나지 않습니다.

이 과정이 끝나면 시스템이 설치, 정비, 진단할 준비가 됩니다.

참고: 하드 디스크에서 시스템을 시작하면 rootvg가 varyon되고, 하드 디스크의 루트 파일 시스템과 /usr 파일 시스템이 RAM 파일 시스템에 마운트되며, 여러 진단 모드나 단일 사용자 모드로 들어갈 수 있는 메뉴가 나옵니다. 단일 사용자 모드를 고르면 부팅 과정을 이어 가 단일 사용자 모드로 들어가며, 이때 init 실행 수준은 글자 S로 설정됩니다. 그러면 시스템이 정비, 소프트웨어 갱신, bosboot 명령 실행을 할 준비가 됩니다.

RAM 파일 시스템

부트 이미지의 일부인 RAM 파일 시스템은 전부 메모리에 상주하며 부팅 과정을 이어 가게 하는 모든 프로그램을 담고 있습니다. RAM 파일 시스템의 파일은 부팅 종류마다 다릅니다.

유지 보수 부팅의 RAM 파일 시스템에는 rootvg를 varyon할 필요가 없을 수 있으므로 논리 볼륨 루틴이 없을 수 있습니다. 그러나 하드 디스크 부팅에서는 rootvg를 varyon하고 페이징을 되도록 빨리 활성화하는 것이 바람직합니다. 두 부팅 상황에는 차이가 있지만 RAM 파일 시스템의 구조는 크게 다르지 않습니다.

RAM 파일 시스템에 있는 init 명령은 부팅 과정에서 쓰도록 설계된 기본 부트 명령 해석기 프로그램입니다. 이 부트 명령 해석기 프로그램은 rc.boot 스크립트를 불러 부팅 과정을 제어합니다. rc.boot 스크립트는 기계가 어느 장치에서 시작했는지 판단합니다. 부트 장치에 따라 RAM 파일 시스템에서 어떤 장치를 구성해야 하는지 정해집니다. 기계가 네트워크로 시작했으면 클라이언트 파일 시스템을 원격 마운트할 수 있도록 네트워크 장치를 구성해야 합니다. 테이프, CD-ROM, DVD 부팅에서는 콘솔이 BOS(base operating system) 설치 메뉴를 보여 주도록 구성됩니다. rc.boot 스크립트가 부트 장치를 알아내면 RAM 파일 시스템에서 알맞은 구성 루틴을 부릅니다. 부트 명령 해석기 프로그램은 부팅 과정의 두 구성 단계에 맞춰 rc.boot 스크립트를 두 번 부릅니다. 디스크나 네트워크 부팅에서는 진짜 init 명령이 불릴 때 rc.boot를 세 번째로 부릅니다. inittab 파일에는 기계의 마지막 구성을 마치는 rc.boot 스탠자가 있습니다.

RAM 파일 시스템은 구성할 장치 종류가 여러 가지이므로 부트 장치마다 고유합니다. 부트 장치 종류마다 원형(prototype) 파일이 연결되어 있습니다. 원형 파일은 RAM 파일 시스템을 이루는 파일의 틀입니다. bosboot 명령은 mkfs 명령과 여러 원형 파일로 RAM 파일 시스템을 만듭니다. 자세한 내용은 bosboot 명령을 봅니다.

영어 원문

Boot process

There are three types of system boots and two resources that are required in order to boot the operating system.

During the boot process, the system tests the hardware, loads and runs the operating system, and configures devices. To boot the operating system, the following resources are required:

  • A boot image that can be loaded after the machine is turned on or reset.

  • Access to the root (/) and /usr file systems.

There are three types of system boots:

  • Hard Disk Boot — A machine is started for normal operations.
  • Diskless Network Boot — A diskless or dataless workstation is started remotely over a network. A machine is started for normal operations. One or more remote file servers provide the files and programs that diskless or dataless workstations need to boot.
  • Maintenance Boot — A machine is started from a hard disk, network, tape, or CD-ROM in maintenance mode. A system administrator can perform tasks such as installing new or updated software and running diagnostic checks.

During a hard disk boot, the boot image is found on a local disk created when the operating system was installed. During the boot process, the system configures all devices found in the machine and initializes

other basic software required for the system to operate (such as the Logical Volume Manager). At the end of this process, the file systems are mounted and ready for use.

The same general requirements apply to diskless network clients. They also require a boot image and access to the operating system file tree. Diskless network clients have no local file systems and get all their information by way of remote access.

Related concepts

“Processing the system boot” Most users perform a hard disk boot when starting the system for general operations. The system finds all information necessary to the boot process on its disk drive. Maintenance boot process Occasions might arise when a boot is needed to perform special tasks such as installing new or updated software, performing diagnostic checks, or for maintenance. In this case, the system starts from a bootable medium such as a CD-ROM, DVD, tape drive, network, or disk drive. RAM file system The RAM file system, part of the boot image, is totally memory-resident and contains all programs that allow the boot process to continue. The files in the RAM file system are specific to the type of boot.

Processing the system boot

Most users perform a hard disk boot when starting the system for general operations. The system finds all information necessary to the boot process on its disk drive.

When the system is started by turning on the power switch (a cold boot) or restarted with the reboot or shutdown commands (a warm boot), a number of events must occur before the system is ready for use. These events can be divided into the following phases:

Related concepts

Boot process There are three types of system boots and two resources that are required in order to boot the operating system.

Firmware phase:

The firmware prepares the system to load and run the operating system.

Its initialization phase involves the following steps:

  1. The firmware performs basic testing on the system resources that are required for starting the operating system.

  2. The firmware checks the user boot list, a list of available boot devices. This boot list can be changed to suit your requirements by using the bootlist command. If the user boot list in non-volatile random access memory (NVRAM) is not valid or if a valid boot device is not found, the default boot list is then checked. In either case, the first valid boot device found in the boot list is used for system startup. If a valid user boot list exists in NVRAM, the devices in the list are checked in order. If no user boot list exists, all adapters and devices on the bus are checked. In either case, devices are checked in a continuous loop until a valid boot device is found for system startup.

Note: The system maintains a default boot list that is stored in NVRAM for normal mode boot. A separate service mode boot list is also stored in NVRAM, and you must refer to the specific hardware instructions for your model to learn how to access the service-mode boot list.

  1. When a valid boot device is found, the first record or program sector number (PSN) is checked. If it is a valid boot record, it is read into memory and is added to the IPL control block in memory. Included in the key boot record data are the starting location of the boot image on the boot device, the length of the boot image, and instructions on where to load the boot image in memory.

  2. The boot image is read sequentially from the boot device into memory starting at the location specified in NVRAM. The disk boot image consists of the kernel, a RAM file system, and base customized device information.

  3. Control is passed to the kernel, which begins system initialization.

  4. The kernel runs init, which runs phase 1 of the rc.boot script.

When the kernel initialization phase is completed, base device configuration begins.

Base device configuration phase:

The init process starts the rc.boot script. Phase 1 of the rc.boot script performs the base device configuration.

Phase 1 of the rc.boot script includes the following steps:

  1. The boot script calls the restbase program to build the customized Object Data Manager (ODM) database in the RAM file system from the compressed customized data.

  2. The boot script starts the configuration manager, which accesses phase 1 ODM configuration rules to configure the base devices.

  3. The configuration manager starts the sys, bus, disk, SCSI, and the Logical Volume Manager (LVM) and rootvg volume group configuration methods.

  4. The configuration methods load the device drivers, create special files, and update the customized data in the ODM database.

Booting the system:

This procedure completes the system boot phase.

  1. The init process starts phase 2 running of the rc.boot script. Phase 2 of rc.boot includes the following steps: a. Call the ipl_varyon program to vary on the rootvg volume group. b. Mount the hard disk file systems onto their normal mount points. c. Run the swapon program to start paging. d. Copy the customized data from the ODM database in the RAM file system to the ODM database in the hard disk file system. e. Exit the rc.boot script.

  2. After phase 2 of the rc.boot script is complete, the boot process switches from the RAM file system to the file systems that are stored on the hard disk.

  3. Then the init process runs the processes defined by records in the /etc/inittab file. One of the instructions in the /etc/inittab file runs phase 3 of the rc.boot script, which includes the following steps: a. Mount the /tmp hard disk file system. b. Start the configuration manager phase 2 to configure all remaining devices. c. Use the savebase command to save the customized data to the boot logical volume. d. Exit the rc.boot script.

At the end of this process, the system is up and ready for use.

Maintenance boot process

Occasions might arise when a boot is needed to perform special tasks such as installing new or updated software, performing diagnostic checks, or for maintenance. In this case, the system starts from a bootable medium such as a CD-ROM, DVD, tape drive, network, or disk drive.

The maintenance boot sequence of events is similar to the sequence of a normal boot.

  1. The firmware performs basic testing on the system resources that are required for starting the operating system.

  2. The firmware checks the user boot list. You can use the bootlist command to change the user boot list to suit your requirements. If the user boot list in non-volatile random access memory (NVRAM) is not valid or if no valid boot device is found, the default boot list is checked. In either case, the first valid boot device found in the boot list is used for starting the system.

Note: For a normal boot, the operating system also maintains a default boot list and a user boot list, which are stored in NVRAM. Separate default boot list and user boot list are also maintained for starting the system in maintenance mode.

  1. When a valid boot device is found, the first record or program sector number (PSN) is checked. If it is a valid boot record, it is read into memory and is added to the initial program load (IPL) control block in memory. Included in the key boot record data are the starting location of the boot image on the boot device, the length of the boot image, and the offset to the entry point to start running when the boot image is in memory.

  2. The boot image is read sequentially from the boot device into memory, starting at the location specified in NVRAM.

  3. Control is passed to the kernel, which begins running programs in the RAM file system.

  4. The ODM database contents determine which devices are present, and the cfgmgr command dynamically configures all devices found, including all disks which are to contain the root file system.

  5. If a CD-ROM, DVD, tape, or the network is used to boot the system, the rootvg volume group (or rootvg) is not varied on, because the rootvg might not exist (as is the case when installing the operating system on a new system). Network configuration can occur at this time. No paging occurs when a maintenance boot is performed.

At the end of this process, the system is ready for installation, maintenance, or diagnostics.

Note: If the system is started from the hard disk, the rootvg is varied on, the hard disk root file system and the hard disk /usr file system are mounted in the RAM file system, a menu is displayed that allows you to enter various diagnostics modes or single-user mode. If you select single-user mode, you can continue the boot process and enter single-user mode, where the init run level is set to the letter S. The system is then ready for maintenance, software updates, or for running the bosboot command.

Related concepts

Boot process There are three types of system boots and two resources that are required in order to boot the operating system.

RAM file system

The RAM file system, part of the boot image, is totally memory-resident and contains all programs that allow the boot process to continue. The files in the RAM file system are specific to the type of boot.

A maintenance boot RAM file system might not have the logical volume routines, because the rootvg might not need to be varied on. During a hard disk boot, however, it is desirable that the rootvg be varied on and paging activated as soon as possible. Although there are differences in these two boot scenarios, the structure of the RAM file system does not vary to a great extent.

The init command, which is located on the RAM file system, is a basic boot command interpreter program that is designed for use during the boot process. This boot command interpreter program controls the boot process by calling the rc.boot script. The rc.boot script determines from which device the machine was started. The boot device determines which devices must be configured on the RAM file system. If the machine is started over the network, the network devices need to be configured so that the client file systems can be remotely mounted. In the case of a tape, CD-ROM, or DVD boot, the console is

configured to display the base operating system (BOS) installation menus. After the rc.boot script identifies the boot device, the appropriate configuration routines are called from the RAM file system. The rc.boot script is called twice by the boot command interpreter program to match the two configuration phases during the boot process. A third call to rc.boot occurs during a disk or a network boot when the real init command is called. The inittab file contains an rc.boot stanza that completes the final configuration of the machine.

The RAM file system for each boot device is also unique because of the various types of devices to be configured. A prototype file is associated with each type of boot device. The prototype file is a template of files making up the RAM file system. The bosboot command uses the mkfs command to create the RAM file system using the various prototype files. See the bosboot command for more details.

Related concepts

Boot process There are three types of system boots and two resources that are required in order to boot the operating system.

시스템 시작 문제 해결

시스템이 시작할 때 생길 수 있는 기본 문제를 다루는 문제 해결 방법입니다. 문제 해결 정보로 문제가 풀리지 않으면 서비스 담당자에게 연락합니다.

부팅하지 않는 시스템

시스템이 하드 디스크에서 부팅하지 않더라도, 문제를 알아내 고치려고 시스템에 접근할 수 있을 수 있습니다.

하드 디스크에서 부팅하지 않는 시스템이 있으면 Installation and migration의 Troubleshooting your installation에 있는, 부팅하지 않는 시스템에 접근하는 절차를 봅니다.

이 절차로 시스템 프롬프트를 얻어 시스템에서 데이터를 복구하거나, 시스템이 하드 디스크에서 부팅하도록 바로잡는 조치를 할 수 있습니다.

주:

  • 이 절차는 하드 디스크에서 부팅하지 못하는 시스템을 부팅하거나 데이터를 복구하는 방법을 아는 숙련된 시스템 관리자만을 위한 것입니다. 대부분의 사용자는 이 절차를 시도하지 말고 서비스 담당자에게 연락해야 합니다.
  • 이 절차는 새 설치를 막 마친 시스템 관리자를 위한 것이 아닙니다. 이 경우 시스템에 복구해야 할 데이터가 없기 때문입니다. 새 설치를 마친 뒤 하드 디스크에서 부팅할 수 없으면 서비스 담당자에게 연락합니다.

부팅 문제 진단

여러 요인 때문에 시스템이 부팅하지 못할 수 있습니다.

그런 요인은 다음과 같습니다.

  • 하드웨어 문제
  • 결함 있는 부트 테이프나 CD-ROM
  • 잘못 구성된 네트워크 부트 서버
  • 손상된 파일 시스템
  • /sbin/rc.boot 같은 스크립트의 오류

(6.1) 부팅 과정이 참조 코드 2702로 멈추고 "INSUFFICIENT ENTITLED MEMORY" 메시지를 보여 주면 HMC로 그 파티션이 쓸 수 있는 진입(entitled) 메모리 양을 늘립니다.

영어 원문

Troubleshooting system startup

Use these troubleshooting methods to tackle some of the basic problems that might occur when your system is starting. If the troubleshooting information does not address your problem, contact your service representative.

Systems that will not boot

If a system will not boot from the hard disk, you may still be able to gain access to the system in order to ascertain and correct the problem.

If you have a system that will not boot from the hard disk, see the procedure on how to access a system that will not boot in Troubleshooting your installation in the Installation and migration.

This procedure enables you to get a system prompt so that you can attempt to recover data from the system or perform corrective action enabling the system to boot from the hard disk.

Note

  • This procedure is intended only for experienced system managers who have knowledge of how to boot or recover data from a system that is unable to boot from the hard disk. Most users should not attempt this procedure, but should contact their service representative.

  • This procedure is not intended for system managers who have just completed a new installation, because in this case the system does not contain data that needs to be recovered. If you are unable to boot from the hard disk after completing a new installation, contact your service representative.

Related reference

“Boot problem diagnostics” A variety of factors can cause a system to be unable to boot.

Boot problem diagnostics

A variety of factors can cause a system to be unable to boot.

Some of these factors are:

  • Hardware problems

  • Defective boot tapes or CD-ROMs

  • Improperly configured network boot servers

  • Damaged file systems

  • Errors in scripts such as /sbin/rc.boot

If the boot process halts with reference code 2702 and displays the message "INSUFFICIENT ENTITLED MEMORY" use the HMC to increase the amount of entitled memory available for that partition.

Related concepts

Systems that will not boot If a system will not boot from the hard disk, you may still be able to gain access to the system in order to ascertain and correct the problem.

시스템 백업

시스템을 쓰기 시작했으면 다음으로 생각할 일은 파일 시스템, 디렉터리, 파일을 백업하는 것입니다. 파일 시스템을 백업하면 하드 디스크가 고장 났을 때 파일이나 파일 시스템을 복원할 수 있습니다. 정보를 백업하는 방법은 여러 가지입니다.

파일 시스템, 디렉터리, 파일을 백업하는 데는 상당한 시간과 노력이 듭니다. 동시에 모든 컴퓨터 파일은 의도적으로든 실수로든 바꾸거나 지우기 쉽습니다.

주의: 하드 디스크가 고장 나면 그 디스크에 있던 정보는 파괴됩니다. 파괴된 데이터를 되찾는 유일한 방법은 백업 사본에서 정보를 가져오는 것입니다.

파일 시스템을 신중하고 체계적으로 백업하면 언제나 최근 버전의 파일이나 파일 시스템을 큰 어려움 없이 복원할 수 있을 것입니다.

정보를 백업하는 방법은 여러 가지입니다. 가장 자주 쓰는 방법 가운데 하나는 이름 기준 백업, 파일 이름 아카이브, 또는 정규 백업이라고 부릅니다. 이것은 파일 전송을 위해, 또는 원본 데이터가 의도치 않게 바뀌거나 파괴될 경우를 대비해 보관하는 파일 시스템, 디렉터리, 파일의 사본입니다. 이 방법은 i 플래그를 지정할 때 쓰며 개별 파일과 디렉터리의 백업 사본을 만드는 데 씁니다. 개인 사용자가 자기 계정을 백업할 때 흔히 쓰는 방법입니다.

또 자주 쓰는 방법은 i-node 기준 백업, 파일 시스템 아카이브, 또는 아카이브 백업이라고 부릅니다. 이 방법은 i 플래그를 지정하지 않을 때 씁니다. 나중에 참고하거나, 기록 목적이거나, 원본 데이터가 손상되거나 잃어버렸을 때 복구하는 데 씁니다. 파일 시스템 전체의 백업 사본을 만드는 데 쓰며, 시스템 관리자가 /home의 모든 사용자 계정처럼 큰 파일 묶음을 백업할 때 흔히 쓰는 방법입니다. 파일 시스템 백업은 증분 백업을 쉽게 할 수 있게 합니다. 증분 백업은 지정한 이전 백업 뒤에 바뀐 모든 파일을 백업합니다.

compress와 pack 명령은 저장을 위해 파일을 압축하고, uncompress와 unpack 명령은 복원한 뒤 파일을 풉니다. 파일을 압축하고 푸는 데는 시간이 걸리지만, 압축하면 데이터가 백업 매체에서 공간을 덜 씁니다. 이 명령에 관한 자세한 정보는 compress, pack, uncompress, unpack을 봅니다.

백업과 아카이브를 만드는 명령은 여러 가지입니다. 그래서 백업한 데이터에는 어떤 명령으로 백업을 시작했는지, 백업을 어떻게(이름 기준인지 파일 시스템 기준인지) 했는지 꼬리표를 붙여야 합니다.

명령 설명
backup 이름이나 파일 시스템 기준으로 파일을 백업합니다. 자세한 정보는 backup을 봅니다.
mksysb rootvg의 설치 가능한 이미지를 만듭니다. 자세한 정보는 mksysb를 봅니다.
cpio 파일을 아카이브 저장소로 복사하거나 아카이브에서 복사해 옵니다. 자세한 정보는 cpio를 봅니다.
dd 파일을 변환하고 복사합니다. 메인프레임처럼 다른 운영 체제를 실행하는 시스템과 데이터를 변환해 주고받는 데 흔히 씁니다. dd는 여러 파일을 아카이브 하나로 묶지 않으며, 데이터를 다루고 옮기는 데 씁니다. 자세한 정보는 dd를 봅니다.
tar tar 형식 아카이브를 만들거나 다룹니다. 자세한 정보는 tar를 봅니다.
rdump 파일 시스템 기준으로 원격 기계의 장치에 파일을 백업합니다. 자세한 정보는 rdump를 봅니다.
pax (POSIX를 따르는 아카이브 유틸리티) tar와 cpio 아카이브를 읽고 씁니다. 자세한 정보는 pax를 봅니다.

관련 개념:

  • BSD 4.3 시스템 관리자를 위한 백업: BSD 4.3 시스템 관리자도 데이터를 백업할 수 있습니다.

관련 작업:

  • 사용자 파일이나 파일 시스템 백업: 파일과 파일 시스템을 백업하는 데는 SMIT 빠른 경로 smit backfile이나 smit backfilesys와 backup 명령, 두 절차를 쓸 수 있습니다.
영어 원문

System backup

Once your system is in use, your next consideration should be to back up the file systems, directories, and files. If you back up your file systems, you can restore files or file systems in the event of a hard disk crash. There are different methods for backing up information.

Backing up file systems, directories, and files represents a significant investment of time and effort. At the same time, all computer files are potentially easy to change or erase, either intentionally or by accident.

Attention: When a hard disk crashes, the information contained on that disk is destroyed. The only way to recover the destroyed data is to retrieve the information from your backup copy.

If you use a careful and methodical approach to backing up your file systems, you should always be able to restore recent versions of files or file systems with little difficulty.

Several methods exist for backing up information. One of the most frequently used methods is called backup by name, file name archive, or regular backup. This is a copy of a file system, directory, or file that is kept for file transfer or in case the original data is unintentionally changed or destroyed. This method of backup is done when the i flag is specified and is used to make a backup copy of individual files and directories. It is a method commonly used by individual users to back up their accounts.

Another frequently used method is called backup by i-node, file system archive, or archive backup. This method of backup is done when the i flag is not specified. This is used for future reference, historical purposes, or for recovery if the original data is damaged or lost. It is used to make a backup copy of an entire file system and is the method commonly used by system administrators to back up large groups of files, such as all of the user accounts in /home. A file system backup allows incremental backups to be performed easily. An incremental backup backs up all files that have been modified since a specified previous backup.

The compress and pack commands enable you to compress files for storage, and the uncompress and unpack commands unpack the files once they have been restored. The process of packing and unpacking files takes time, but once packed, the data uses less space on the backup medium. For more information about these commands, see compress, pack, uncompress, and unpack.

Several commands create backups and archives. Because of this, data that has been backed up needs to be labeled as to which command was used to initiate the backup, and how the backup was made (by name or by file system).

  • backup — Backs up files by name or by file system. For more information, see backup.
  • mksysb — Creates an installable image of the rootvg. For more information, see mksysb.
  • cpio — Copies files into and out of archive storage. For more information, see cpio.
  • dd — Converts and copies a file. Commonly used to convert and copy data to and from systems running other operating systems, for example, mainframes. dd does not group multiple files into one archive; it is used to manipulate and move data. For more information, see dd.
  • tar — Creates or manipulates tar format archives. For more information, see tar.
  • rdump — Backs up files by file system onto a remote machine's device. For more information, see rdump.
  • pax — (POSIX-conformant archive utility) Reads and writes tar and cpio archives. For more information, see pax.

Related concepts

Backup for BSD 4.3 system managers BSD 4.3 system managers can back up data.

Related tasks

Backing up user files or file systems Two procedures can be used to back up files and file systems: the SMIT fast paths smit backfile or smit backfilesys, and the backup command.

백업 개념

데이터 백업을 시작하기 전에 쓸 수 있는 데이터 종류, 정책, 매체를 이해해야 합니다.

백업 정책

모든 사용자의 요구를 채우는 백업 정책은 없습니다. 예를 들어 사용자 한 명인 시스템에 잘 맞는 정책이 사용자 백 명을 서비스하는 시스템에는 모자랄 수 있습니다. 마찬가지로 매일 많은 파일이 바뀌는 시스템을 위해 만든 정책은 데이터가 드물게 바뀌는 시스템에는 비효율적일 것입니다.

사이트에 알맞은 백업 전략이 무엇이든, 전략이 있고 백업을 자주, 정기적으로 하는 것이 아주 중요합니다. 좋은 백업 전략을 실행하지 않았으면 데이터 손실에서 복구하기 어렵습니다.

시스템에 가장 좋은 백업 정책은 직접 정할 수밖에 없지만 다음 일반 지침이 도움이 될 수 있습니다.

  • 큰 손실에서 복구할 수 있는지 확인합니다. 고정 디스크 하나가 고장 나도 시스템이 계속 돌아갈 수 있습니까? 모든 고정 디스크가 고장 나도 시스템을 복구할 수 있습니까? 화재나 도난으로 백업 디스켓이나 테이프를 잃어도 시스템을 복구할 수 있습니까? 데이터를 잃으면 다시 만드는 것이 얼마나 어렵습니까? 일어날 법하지 않은 것까지 가능한 큰 손실을 생각해 보고, 그 가운데 어느 것이 일어나도 시스템을 복구할 수 있는 백업 정책을 설계합니다.
  • 백업을 주기적으로 확인합니다. 백업 매체와 그 하드웨어는 믿을 수 없을 때가 있습니다. 데이터를 고정 디스크로 다시 읽어 들일 수 없다면 백업 테이프나 디스켓을 아무리 많이 모아 두어도 쓸모가 없습니다. 백업을 쓸 수 있는지 확인하려면 백업 테이프의 목차를 주기적으로 봅니다(아카이브 테이프는 restore -T나 tar -t). 디스켓으로 백업하고 디스켓 드라이브가 둘 이상이면 디스켓을 만든 드라이브가 아닌 다른 드라이브에서 읽어 봅니다. 레벨 0 백업마다 두 번째 매체 묶음으로 되풀이하는 안전장치를 두고 싶을 수 있습니다. 스트리밍 테이프 장치로 백업하면 tapechk 명령으로 테이프의 기본적인 일관성 검사를 할 수 있습니다. 이 명령에 관한 자세한 정보는 restore -T, tar -t, tapechk를 봅니다.
  • 옛 백업을 남깁니다. 백업 매체를 다시 쓰는 정기 주기를 만들되, 모든 백업 매체를 다시 쓰지는 않습니다. 사용자가 중요한 파일이 손상되었거나 없어진 것을 알아차리기까지 몇 달이 걸릴 때도 있습니다. 그럴 때를 위해 옛 백업을 남깁니다. 예를 들어 백업 테이프나 디스켓을 다음 세 주기로 운영할 수 있습니다.
    • 매주 한 번, 금요일 디스켓을 빼고 모든 일일 디스켓을 다시 씁니다.
    • 매달 한 번, 그 달 마지막 금요일 것을 빼고 모든 금요일 디스켓을 다시 씁니다. 그러면 마지막 네 번의 금요일 백업이 늘 남습니다.
    • 분기마다 한 번, 마지막 것을 빼고 모든 월간 디스켓을 다시 씁니다. 분기마다 마지막 월간 디스켓은 되도록 다른 건물에 영구히 보관합니다.
  • 백업 전에 파일 시스템을 검사합니다. 손상된 파일 시스템으로 만든 백업은 쓸모없을 수 있습니다. 백업하기 전에 fsck 명령으로 파일 시스템의 무결성을 검사하는 것이 좋은 정책입니다. 자세한 정보는 fsck를 봅니다.
  • 백업 중에 파일을 쓰고 있지 않은지 확인합니다. 백업하는 동안에는 시스템을 쓰지 않습니다. 시스템을 쓰고 있으면 백업하는 동안 파일이 바뀌어 백업 사본이 정확하지 않게 됩니다.
  • 시스템을 크게 바꾸기 전에 백업합니다. 하드웨어 시험이나 수리를 하기 전, 또는 새 장치, 프로그램, 그 밖의 시스템 기능을 설치하기 전에 시스템 전체를 백업하는 것이 언제나 좋은 정책입니다.
  • 그 밖의 요인. 백업 전략을 계획하고 실행할 때 다음 요인을 생각합니다.
    • 데이터는 얼마나 자주 바뀝니까? 운영 체제 데이터는 자주 바뀌지 않으므로 자주 백업할 필요가 없습니다. 반면 사용자 데이터는 보통 자주 바뀌므로 자주 백업해야 합니다.
    • 시스템에 사용자가 몇 명입니까? 사용자 수는 백업에 필요한 저장 매체의 양과 빈도에 영향을 줍니다.
    • 데이터를 다시 만드는 것이 얼마나 어렵습니까? 백업이 없으면 다시 만들 수 없는 데이터도 있다는 점을 생각하는 것이 중요합니다.

데이터를 지키는 백업 전략을 갖춰 두는 것은 아주 중요합니다. 사이트의 요구를 평가하면 가장 좋은 백업 정책을 정하는 데 도움이 됩니다. 사용자 정보 백업은 자주, 정기적으로 합니다. 좋은 백업 전략을 실행하지 않았으면 데이터 손실에서 복구하기가 아주 어렵습니다.

참고: named pipe(FIFO 특수 파일)를 백업할 때 파이프는 닫혀 있든 열려 있든 됩니다. 그러나 열린 named pipe를 백업하면 복원이 실패합니다. FIFO 특수 파일을 복원할 때는 모든 특성 정보가 i-node에 들어 있으므로 다시 만드는 데 i-node만 있으면 됩니다. named pipe의 내용은 복원과 관계없습니다. 그래서 백업하기 전에 (모든 FIFO가 닫혀 있으면) 백업 중 파일 크기는 0입니다.

주의: 시스템 백업과 복원 절차는 백업을 만든 것과 같은 종류의 플랫폼에 시스템을 복원해야 합니다. 특히 CPU와 I/O planar 보드가 같은 종류여야 합니다.

백업 매체

여러 종류의 백업 매체를 쓸 수 있습니다. 특정 시스템 구성에서 쓸 수 있는 백업 매체 종류는 소프트웨어와 하드웨어에 따라 다릅니다.

가장 자주 쓰는 종류는 테이프(8 mm 테이프와 9트랙 테이프), 디스켓(5.25인치 디스켓과 3.5인치 디스켓), 원격 아카이브, 다른 로컬 하드 디스크입니다. backup -f 명령으로 다른 장치를 지정하지 않으면 backup 명령은 출력을 디스켓 드라이브인 /dev/rfd0에 자동으로 씁니다.

주의: backup 명령을 실행하면 고른 백업 매체에 전에 저장했던 모든 내용을 잃습니다.

디스켓

디스켓은 표준 백업 매체입니다. backup -f 명령으로 다른 장치를 지정하지 않으면 backup 명령은 출력을 디스켓 드라이브인 /dev/rfd0 장치에 자동으로 씁니다. 기본 테이프 장치로 데이터를 백업하려면 /dev/rmt0을 입력하고 Enter를 누릅니다(원문 그대로, backup -f /dev/rmt0처럼 장치를 지정한다는 뜻).

디스켓은 조심해서 다룹니다. 정보 하나하나가 디스켓에서 아주 작은 영역을 차지하므로 작은 긁힘, 먼지, 음식이나 담배 가루로도 정보를 쓸 수 없게 될 수 있습니다. 다음을 기억합니다.

  • 기록면을 만지지 않습니다.
  • 전화기, 녹음 장비, 전자계산기 같은 자석과 자기장 근원에서 디스켓을 멀리 둡니다.
  • 디스켓을 극한의 더위와 추위에서 멀리 둡니다. 권장 온도 범위는 섭씨 10도60도(화씨 50도140도)입니다.
  • 제대로 관리하면 정보 손실을 막는 데 도움이 됩니다.
  • 디스켓의 백업 사본을 정기적으로 만듭니다.

주의: 데이터를 성공적으로 저장하려면 디스켓 드라이브와 디스켓이 올바른 종류여야 합니다. 3.5인치 디스켓 드라이브에 잘못된 디스켓을 쓰면 디스켓의 데이터가 파괴될 수 있습니다.

디스켓 드라이브는 다음 3.5인치 디스켓을 씁니다.

  • 1 MB 용량(약 720 KB의 데이터 저장)
  • 2 MB 용량(약 1.44 MB의 데이터 저장)

테이프

테이프는 용량이 크고 내구성이 좋아 파일 시스템의 아카이브 사본처럼 큰 파일이나 많은 파일을 저장하는 데 자주 고릅니다. 한 시스템에서 다른 시스템으로 많은 파일을 옮기는 데도 씁니다. 다른 매체가 접근 시간이 훨씬 빠르므로 자주 접근하는 파일 저장에는 테이프를 널리 쓰지 않습니다.

테이프 파일은 테이프 드라이브를 열고, 쓰고, 닫는 backup, cpio, tar 같은 명령으로 만듭니다.

백업 전략

많은 양의 데이터를 백업하는 방법은 두 가지입니다.

  • 시스템 전체 백업
  • 증분 백업

이 두 백업 종류와 어느 것이 사이트나 시스템에 맞는지 이해하려면 파일 시스템 구조와 데이터 배치를 이해하는 것이 중요합니다. 데이터 배치 전략을 정했으면 그 데이터의 백업 전략을 세울 수 있습니다.

관련 작업:

  • 예약 백업 실행: 사용자 파일의 주간 전체 백업과 일일 증분 백업을 하는 스크립트를 만들어 쓰는 절차를 설명합니다.

시스템 데이터와 사용자 데이터

데이터는 프로그램이나 텍스트로 정의하며, 여기서는 두 종류로 나눕니다.

  • 시스템 데이터: 운영 체제와 그 확장을 이룹니다. 이 데이터는 언제나 시스템 파일 시스템, 곧 /(root), /usr, /tmp, /var 등에 둡니다.
  • 사용자 데이터: 보통 개인이 자기 일을 하는 데 필요한 로컬 데이터입니다. 이 데이터는 /home 파일 시스템이나 사용자 데이터용으로 따로 만든 파일 시스템에 둡니다.

사용자 프로그램과 텍스트는 시스템 데이터를 담도록 설계된 파일 시스템에 두지 않습니다. 예를 들어 시스템 관리자는 새 파일 시스템을 만들어 /local 위에 마운트할 수 있습니다. 예외는 시스템과 사용자 데이터의 임시 저장에 쓰는 /tmp입니다.

백업

대체로 사용자와 시스템 데이터의 백업은 데이터를 실수로 지우거나 디스크가 고장 날 때를 대비해 보관합니다. 사용자 데이터를 시스템 데이터와 따로 두면 백업을 관리하기 쉽습니다.

시스템 데이터를 사용자 데이터와 따로 두는 이유는 다음과 같습니다.

  • 사용자 데이터는 운영 체제 데이터보다 훨씬 자주 바뀌는 경향이 있습니다. 시스템 데이터를 사용자 데이터와 같은 이미지에 백업하지 않으면 백업 이미지가 훨씬 작아집니다. 사용자 수는 백업에 필요한 저장 매체와 빈도에 영향을 줍니다.
  • 사용자 데이터를 따로 두면 복원이 더 빠르고 쉽습니다. 운영 체제를 사용자 데이터와 함께 복원하려면 시간과 노력이 더 듭니다. 운영 체제 데이터를 복구하는 방법이 이동식 매체(테이프나 CD)로 시스템을 시작해 시스템 백업을 설치하는 것이기 때문입니다.

시스템 데이터를 백업하려면 umount 명령으로 /home을 포함한 모든 사용자 파일 시스템을 마운트 해제합니다. 이 파일 시스템을 쓰고 있으면 마운트 해제할 수 없습니다. 마운트 해제할 수 있도록 사용량이 적은 시간에 백업을 예약합니다. 사용자 데이터 파일 시스템이 마운트된 채로 있으면 운영 체제 데이터와 함께 백업됩니다. mount 명령으로 운영 체제 파일 시스템만 마운트되어 있는지 확인합니다.

마운트된 파일 시스템은 /, /usr, /var, /tmp뿐이며, mount 명령의 결과는 다음과 비슷할 수 있습니다.

text
node  mounted  mounted over vfs       date         options
      /dev/hd4     /        jfs   Jun 11 10:36  rw,log=/dev/hd8
      /dev/hd2     /usr     jfs   Jun 11 10:36  rw,log=/dev/hd8
      /dev/hd9var  /var     jfs   Jun 11 10:36  rw,log=/dev/hd8
      /dev/hd      /tmp     jfs   Jun 11 10:36  rw,log=/dev/hd8

모든 사용자 파일 시스템이 마운트 해제되었음을 확인했으면 이제 운영 체제 데이터를 백업할 준비가 된 것입니다.

운영 체제 백업을 마치면 smit mount 명령으로 사용자 파일 시스템을 마운트합니다. 그런 다음 필요에 따라 파일, 파일 시스템, 다른 볼륨 그룹을 백업할 수 있습니다.

관련 개념:

  • 시스템 이미지와 사용자 정의 볼륨 그룹 백업: rootvg는 하드 디스크나 디스크 묶음에 저장되며 시작 파일, BOS, 구성 정보, 선택 소프트웨어 제품을 담습니다. 사용자 정의 볼륨 그룹(nonrootvg 볼륨 그룹이라고도 함)은 보통 데이터 파일과 응용 소프트웨어를 담습니다.

시스템 복제(cloning)

복제는 사용자나 시스템 데이터와 함께 구성 데이터를 저장합니다. 예를 들어 시스템이나 볼륨 그룹을 복제하고 싶을 수 있으며, 이를 cloning이라고도 합니다.

그런 다음 이 이미지를 다른 시스템에 설치해 처음 시스템처럼 쓸 수 있습니다. 운영 체제가 든 rootvg 볼륨 그룹을 복제하는 데는 mksysb 명령을, 볼륨 그룹을 복제하는 데는 savevg 명령을 씁니다.

백업 파일과 저장 매체 명령 요약

파일을 백업하고 데이터를 저장하는 명령입니다.

명령 설명
backup 파일과 파일 시스템을 백업합니다.
compress 데이터를 압축하고 풉니다.
cpio 파일을 아카이브 저장소와 디렉터리로 복사하거나 복사해 옵니다.
fdformat 디스켓을 포맷합니다.
flcopy 디스켓으로 복사하거나 디스켓에서 복사합니다.
format 디스켓을 포맷합니다.
fsck 파일 시스템 일관성을 검사하고 대화식으로 수리합니다.
pack 파일을 압축합니다.
restore backup 명령으로 로컬 장치에 만든, 이전에 백업한 파일 시스템이나 파일을 복사해 옵니다.
tapechk 스트리밍 테이프 장치의 일관성을 검사합니다.
tar 아카이브를 다룹니다.
tcopy 자기 테이프를 복사합니다.
uncompress 데이터를 압축하고 풉니다.
unpack 파일을 풉니다.
영어 원문

Backup concepts

Before you start backing up your data, you need to understand the types of data, policies, and media that you can use.

Backup policies

No single backup policy can meet the needs of all users. A policy that works well for a system with one user, for example, could be inadequate for a system that serves one hundred users. Likewise, a policy developed for a system on which many files are changed daily would be inefficient for a system on which data changes infrequently.

Whatever the appropriate backup strategy for your site, it is very important that one exist and that backups be done frequently and regularly. It is difficult to recover from data loss if a good backup strategy has not been implemented.

Only you can determine the best backup policy for your system, but the following general guidelines might be helpful:

  • Make sure you can recover from major losses. Can your system continue to run after any single fixed disk failure? Can you recover your system if all the fixed disks should fail? Could you recover your system if you lost your backup diskettes or tape to fire or theft? If data were lost, how difficult would it be to re-create it? Think through possible, even unlikely, major losses, and design a backup policy that enables you to recover your system after any of them.

  • Check your backups periodically. Backup media and their hardware can be unreliable. A large library of backup tapes or diskettes is useless if data cannot be read back onto a fixed disk. To make certain that your backups are usable, display the table of contents from the backup tape periodically (using restore -T or tar -t for archive tapes). If you use diskettes for your backups and have more than one diskette drive, read diskettes from a drive other than the one on which they were created. You might want the security of repeating each level 0 backup with a second set of media. If you use a streaming tape device for backups, you can use the tapechk command to perform rudimentary consistency checks on the tape. For more information about these commands, see restore -T, tar -t, and tapechk.

  • Keep old backups. Develop a regular cycle for reusing your backup media; however, do not reuse all of your backup media. Sometimes it is months before you or some other user of your system notices that an important file is damaged or missing. Save old backups for such possibilities. For example, you could have the following three cycles of backup tapes or diskettes: – Once per week, recycle all daily diskettes except the Friday diskette. – Once per month, recycle all Friday diskettes except for the one from the last Friday of the month. This makes the last four Friday backups always available. – Once per quarter, recycle all monthly diskettes except for the last one. Keep the last monthly diskette from each quarter indefinitely, preferably in a different building.

  • Check file systems before backing up. A backup made from a damaged file system might be useless. Before making your backups, it is good policy to check the integrity of the file system with the fsck command. For more information, see fsck.

  • Ensure files are not in use during a backup.

Do not use the system when you make your backups. If the system is in use, files can change while they are being backed up, and the backup copy will not be accurate.

  • Back up your system before major changes are made to the system. It is always good policy to back up your entire system before any hardware testing or repair work is performed or before you install any new devices, programs, or other system features.

  • Other factors. When planning and implementing a backup strategy, consider the following factors: – How often does the data change? The operating system data does not change very often, so you do not need to back it up frequently. User data, on the other hand, usually changes frequently, so you should back it up frequently. – How many users are on the system? The number of users affects the amount of storage media and frequency required for backups. – How difficult would it be to re-create the data? It is important to consider that some data cannot be re-created if there is no backup available.

Having a backup strategy in place to preserve your data is very important. Evaluating the needs of your site will help you to determine the backup policy that is best for you. Perform user information backups frequently and regularly. Recovering from data loss is very difficult if a good backup strategy has not been implemented.

Note: For the backup of named pipes (FIFO special files) the pipes can be either closed or open. However, the restoration fails when the backup is done on open named pipes. When restoring a FIFO special file, its i-node is all that is required to recreate it because it contains all its characteristic information. The content of the named pipe is not relevant for restoration. Therefore, the file size during backup is zero (all the FIFOs closed) before the backup is made.

Attention: System backup and restoration procedures require that the system be restored on the same type of platform from which the backup was made. In particular, the CPU and I/O planar boards must be of the same type.

Backup media

Several different types of backup media are available. The different types of backup media available to your specific system configuration depend upon both your software and hardware.

Several types of backup media are available. The types of backup media available to your specific system configuration depend upon your software and hardware. The types most frequently used are tapes (8-mm tape and 9-track tape), diskettes (5.25-inch diskette and 3.5-inch diskette), remote archives, and alternate local hard disks. Unless you specify a different device using the backup -f command, the backup command automatically writes its output to /dev/rfd0, which is the diskette drive.

Attention: Running the backup command results in the loss of all material previously stored on the selected backup medium.

Diskettes

Diskettes are the standard backup medium. Unless you specify a different device using the backup -f command, the backup command automatically writes its output to the /dev/rfd0 device, which is the diskette drive. To back up data to the default tape device, type /dev/rmt0 and press Enter.

Be careful when you handle diskettes. Because each piece of information occupies such a small area on the diskette, small scratches, dust, food, or tobacco particles can make the information unusable. Be sure to remember the following:

  • Do not touch the recording surfaces.

  • Keep diskettes away from magnets and magnetic field sources, such as telephones, dictation equipment, and electronic calculators.

  • Keep diskettes away from extreme heat and cold. The recommended temperature range is 10 degrees Celsius to 60 degrees Celsius (50 degrees Fahrenheit to 140 degrees Fahrenheit).

  • Proper care helps prevent loss of information.

  • Make backup copies of your diskettes regularly.

Attention: Diskette drives and diskettes must be the correct type to store data successfully. If you use the wrong diskette in your 3.5-inch diskette drive, the data on the diskette could be destroyed.

The diskette drive uses the following 3.5-inch diskettes:

  • 1 MB capacity (stores approximately 720 KB of data)

  • 2 MB capacity (stores approximately 1.44 MB of data)

Tapes

Because of their high capacity and durability, tapes are often chosen for storing large files or many files, such as archive copies of file systems. They are also used for transferring many files from one system to another. Tapes are not widely used for storing frequently accessed files because other media provide much faster access times.

Tape files are created using commands such as backup, cpio, and tar, which open a tape drive, write to it, and close it.

Backup strategy

There are two methods of backing up large amounts of data.

  • Complete system backup

  • Incremental backup

To understand these two types of backups and which one is right for a site or system, it is important to have an understanding of file system structure and data placement. After you have decided on a strategy for data placement, you can develop a backup strategy for that data.

Related tasks

Implementing scheduled backups This procedure describes how to develop and use a script to perform a weekly full backup and daily incremental backups of user files.

System data versus user data:

Data is defined as programs or text and for this discussion is broken down into two classes:

  • System data, which makes up the operating system and its extensions. This data is always to be kept in the system file systems, namely / (root), /usr, /tmp, /var, and so on.

  • User data is typically local data that individuals need to complete their specific tasks. This data is to be kept in the /home file system or in file systems that are created specifically for user data.

User programs and text are not to be placed in file systems designed to contain system data. For example, a system manager might create a new file system and mount it over/local. An exception is /tmp, which is used for temporary storage of system and user data.

Backups:

In general, backups of user and system data are kept in case the data is accidentally removed or if there is a disk failure. It is easier to manage backups when user data is kept separate from system data.

The following are reasons for keeping system data separate from user data:

  • User data tends to change much more often than operating system data. Backup images are much smaller if the system data is not backed up into the same image as the user data. The number of users affects the storage media and frequency that is required for backup.

  • It is quicker and easier to restore user data when it is kept separate. Restoring the operating system along with the user data requires extra time and effort. The reason is that the method that is used to recover the operating system data involves starting the system from removable media (tape or CD) and installing the system backup.

To back up the system data, unmount all user file systems, including /home with the umount command. If these file systems are in use, you cannot unmount them. Schedule the backups at low usage times so they can be unmounted; if the user data file systems remain mounted, they are backed up along with the operating system data. Use the mount command to ensure that only the operating system file systems are mounted.

The only mounted file systems are /, /usr, /var, and /tmp, and the result of the mount command can be similar to the following output:

text
node  mounted  mounted over vfs       date         options
      /dev/hd4     /        jfs   Jun 11 10:36  rw,log=/dev/hd8
      /dev/hd2     /usr     jfs   Jun 11 10:36  rw,log=/dev/hd8
      /dev/hd9var  /var     jfs   Jun 11 10:36  rw,log=/dev/hd8
      /dev/hd      /tmp     jfs   Jun 11 10:36  rw,log=/dev/hd8

After you are certain that all user file systems are unmounted, you are now ready to back up the operating system data.

When you finish backing up the operating system, mount the user file system by using the smit mount command. Next, you can back up files, file systems, or other volume groups, depending on your needs.

Related concepts

System image and user-defined volume groups backup The rootvg is stored on a hard disk, or group of disks, and contains start up files, the BOS, configuration information, and any optional software products. A user-defined volume group (also called nonrootvg volume group) typically contains data files and application software.

System replication (cloning):

Cloning saves configuration data along with user or system data. For example, you might want to replicate a system or volume group; it is sometimes called cloning.

You can then install this image onto another system and can use it just like the first system. The mksysb command is used to clone the rootvg volume group, which contains the operating system, while the savevg command is used to clone a volume group.

Command summary for backup files and storage media:

Commands are available for backing up files and storing data.

  • backup — Backs up files and file systems
  • compress — Compresses and expands data
  • cpio — Copies files into and out of archive storage and directories
  • fdformat — Formats diskettes
  • flcopy — Copies to and from diskettes
  • format — Formats diskettes
  • fsck — Checks file system consistency and interactively repairs the file system
  • pack — Compresses files
  • restore — Copies previously backed-up file systems or files, which were created by the backup command from a local device
  • tapechk — Checks consistency of the streaming tape device
  • tar — Manipulates archives
  • tcopy — Copies a magnetic tape
  • uncompress — Compresses and expands data
  • unpack — Expands files