[AIX 운영 체제와 장치 관리 4] 시스템 이미지·볼륨 그룹 백업(mksysb·savevg), 예약 백업, 매체 명령과 파일 백업

핵심 정리

  • rootvg 백업(mksysb, smit mksysb)에는 bos.sysmgt.sysbr 파일 세트(lslpp -l bos.sysmgt.sysbr로 확인)와 /tmp 여유 공간 8.8 MB가 필요합니다. 백업할 파일 시스템은 마운트하고 안 할 것은 마운트 해제하며, 로컬 디렉터리 위에 마운트한 로컬 디렉터리는 두 번 백업되므로 풉니다. NFS 마운트는 백업되지 않습니다.
  • 사용자 볼륨 그룹(savevg, smit savevg)은 varyon과 마운트 상태여야 하며, /etc/exclude.볼륨그룹에 grep 패턴으로 뺄 파일을 적습니다. 크기를 바꾸려면 mkvgdata VGName 뒤 VGName.data를 고치고 savevg에 -i·-m을 쓰지 않습니다.
  • 다른 기계에 설치할 이미지라면 필요한 장치 지원을 미리 설치하고, 비밀번호와 네트워크 주소가 복사되는 보안 문제를 생각합니다. 복원 때 크기는 image.data의 SHRINK가 yes가 아니면 원본과 같고, 하드웨어가 다르면 /etc/objrepos/Cu*와 /dev의 장치 속성이 바뀔 수 있습니다.
  • cron 예약 백업: 월요일 레벨 0, 화토 레벨 15를 0 2 * * 1 backup -0 -uf/dev/rmt0.1 /home/plan처럼 crontab -e로 넣습니다. DMAPI JFS2는 backbyinode가 온라인 데이터만 백업하므로 전체가 필요하면 tar를 씁니다.
  • 매체 명령: format -d /dev/rfd0, fdformat -h, fsck -p, flcopy, cpio -ov·-idmv, tcopy /dev/rmt0 /dev/rmt8, tapechk 3, tar -c·-xm·-vtf. 파일 백업은 이름 기준 backup -i -v, i-node 기준 backup -0 -u /, 8 mm 테이프 블록 크기 0으로 만든 백업은 특별 절차가 필요합니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (6.1에서 backup 명령 절이 새로 정리됨)
원문 Operating system and device management — 5.3판 144161쪽, 6.1판 3847쪽
파일 /tmp/vgdata/VGName/VGName.data, /etc/exclude.volume_group_name, image.data, /etc/objrepos/Cu*, /etc/dumpdates, /dev/rfd0, /dev/rmt0.1
관련 명령어 mksysb, savevg, mkvgdata, lsmksysb, lslpp, installp, crontab, backup, backbyinode, format, fdformat, fsck, flcopy, cpio, tcopy, tapechk, tar

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

Web-based System Manager, SMIT, 명령 절차로 시스템과 볼륨 그룹의 이미지를 백업할 수 있습니다. 백업 이미지에는 두 가지 쓰임이 있습니다. 하나는 시스템 백업 이미지로 손상된 시스템을 복원하는 것입니다. 다른 하나는 설치하고 구성한 소프트웨어를 한 시스템에서 다른 시스템으로 옮기는 것입니다.

Web-based System Manager와 SMIT 절차는 mksysb 명령으로 테이프나 파일에 저장할 수 있는 백업 이미지를 만듭니다. 테이프를 고르면 백업 프로그램이 테이프에 부트 이미지를 써서 설치에 쓸 수 있게 합니다.

주:

  • 시작 테이프는 PowerPC 기반 개인용 컴퓨터에서 만들거나 그런 컴퓨터를 시작하는 데 쓸 수 없습니다.
  • 백업에 SMIT 방법을 고르면 먼저 bos.sysmgt 소프트웨어 패키지의 sysbr 파일 세트를 설치해야 합니다.

관련 정보:

  • Installing optional software products and service updates

시스템 이미지와 사용자 정의 볼륨 그룹 백업

시스템 이미지와 사용자 정의 볼륨 그룹을 백업할 수 있습니다.

rootvg 볼륨 그룹을 백업하기 전에:

  • 테이프와 CD-ROM 드라이브 같은 외부 장치를 포함해 모든 하드웨어가 이미 설치되어 있어야 합니다.
  • 이 백업 절차에는 BOS System Management Tools and Applications 소프트웨어 패키지에 있는 sysbr 파일 세트가 필요합니다. 다음 명령을 입력해 시스템에 sysbr 파일 세트가 설치되어 있는지 확인합니다.
text
lslpp -l bos.sysmgt.sysbr

시스템에 sysbr 파일 세트가 설치되어 있으면 백업 절차를 이어 갑니다. lslpp 명령이 sysbr 파일 세트를 나열하지 않으면 백업 절차를 이어 가기 전에 설치합니다.

text
installp -agqXd device bos.sysmgt.sysbr

여기서 device는 소프트웨어 위치입니다. 예를 들어 테이프 드라이브는 /dev/rmt0입니다.

사용자 정의 볼륨 그룹을 백업하기 전에:

  • 저장하기 전에 볼륨 그룹을 varyon하고 파일 시스템을 마운트해야 합니다. 주의: savevg 명령을 실행하면 고른 출력 매체에 전에 저장했던 모든 내용을 잃습니다.
  • 오류를 막도록 백업 장치를 최근에 청소했는지 확인합니다.

다음 절차는 시스템의 설치 가능한 이미지를 만드는 방법을 설명합니다.

작업 SMIT 빠른 경로 명령이나 파일
rootvg 볼륨 그룹 백업 1. root로 로그인합니다. 2. 백업할 파일 시스템을 마운트합니다(주 1): smit mountfs 3. 다른 로컬 디렉터리 위에 마운트한 로컬 디렉터리를 마운트 해제합니다: smit umountfs 4. /tmp 디렉터리에 적어도 8.8 MB의 빈 공간을 마련합니다(주 2). 5. 백업: smit mksysb 6. 백업 매체에 쓰기 방지를 겁니다. 7. 백업한 root와 사용자 비밀번호를 기록해 둡니다. 1. root로 로그인합니다. 2. 백업할 파일 시스템을 마운트합니다(주 1). mount 명령을 봅니다. 3. 다른 로컬 디렉터리 위에 마운트한 로컬 디렉터리를 마운트 해제합니다. umount 명령을 봅니다. 4. /tmp 디렉터리에 적어도 8.8 MB의 빈 공간을 마련합니다(주 2). 5. 백업. mksysb 명령을 봅니다. 6. 백업 매체에 쓰기 방지를 겁니다. 7. 백업한 root와 사용자 비밀번호를 기록해 둡니다.
백업 테이프 확인(주 3) smit lsmksysb
사용자 정의 볼륨 그룹 백업(주 4) smit savevg 1. 필요하면 백업하기 전에 파일 시스템 크기를 고칩니다(주 5): mkvgdata VGName 뒤 /tmp/vgdata/VGName/VGName.data를 편집합니다. 2. 볼륨 그룹을 저장합니다. savevg 명령을 봅니다.

주:

  1. mksysb 명령은 NFS 네트워크 너머로 마운트한 파일 시스템을 백업하지 않습니다.
  2. mksysb 명령은 백업하는 동안 이 작업 공간이 필요합니다. /tmp 디렉터리의 빈 공간은 512바이트 블록 단위로 보고하는 df 명령으로 확인합니다. 필요하면 chfs 명령으로 파일 시스템 크기를 바꿉니다.
  3. 이 절차는 mksysb 백업 테이프의 내용을 나열합니다. 내용 목록은 테이프의 정보 대부분을 확인하지만, 설치용으로 테이프에서 부팅할 수 있는지는 확인하지 않습니다. mksysb 테이프의 부트 이미지가 올바르게 동작하는지 확인하는 유일한 방법은 테이프에서 부팅해 보는 것입니다.
  4. 사용자 정의 볼륨 그룹의 파일을 백업 이미지에서 빼려면 /etc/exclude.volume_group_name이라는 파일을 만듭니다. volume_group_name은 백업할 볼륨 그룹의 이름입니다. 그런 다음 /etc/exclude.volume_group_name을 편집해 백업 이미지에 넣고 싶지 않은 파일 이름 패턴을 입력합니다. 이 파일의 패턴은 grep 명령의 패턴 일치 규칙에 입력되어 어떤 파일을 백업에서 뺄지 정합니다.
  5. 파일 시스템 크기를 바꾸려고 VGName.data 파일을 고치기로 했다면, VGName.data 파일이 덮어써지므로 savevg 명령에 -i 플래그나 -m 플래그를 지정하면 안 됩니다.

관련 정보:

  • Installing optional software products and service updates, Installing system backups

백업 전 구성

원본 시스템의 백업 이미지를 만들기 전에 원본 시스템을 구성합니다. 그러나 백업 이미지를 구성이 다른 다른 대상 시스템 설치에 쓸 계획이라면, 원본 시스템을 구성하기 전에 이미지를 만듭니다.

원본 시스템은 백업 사본을 만든 시스템입니다. 대상 시스템은 백업 사본을 설치하는 시스템입니다.

설치 프로그램은 설치하는 기계의 하드웨어 구성에 필요한 장치 지원만 자동으로 설치합니다. 그래서 시스템 백업으로 다른 기계를 설치한다면, 백업 이미지를 만들어 대상 시스템 하나 이상을 설치하기 전에 원본 시스템에 추가 장치를 설치해야 할 수 있습니다.

원본 시스템에 추가 장치 지원을 설치하려면 Web-based System Manager나 SMIT 빠른 경로 smit devinst를 씁니다.

  • 원본과 대상 시스템에 디스크 공간이 충분하면 모든 장치 지원을 설치합니다.
  • 원본과 대상 시스템에 디스크 공간이 제한되어 있으면 장치 지원을 골라 설치합니다.

백업은 원본 시스템에서 대상 시스템으로 다음 구성을 옮깁니다.

  • 페이징 공간 정보
  • 논리 볼륨 정보
  • rootvg 정보
  • (map 옵션을 골랐다면) 논리 파티션 배치

관련 정보:

  • Installing optional software and service updates, Customizing your installation

파일 시스템 마운트와 마운트 해제

백업하기 전에 백업할 모든 파일 시스템을 마운트하고 백업하지 않을 모든 파일 시스템을 마운트 해제해야 합니다.

Backup Methods 절차는 rootvg의 마운트된 파일 시스템만 백업합니다. 그래서 시작하기 전에 백업할 모든 파일 시스템을 마운트해야 합니다. 마찬가지로 백업하지 않을 파일 시스템은 마운트 해제해야 합니다.

같은 파일 시스템에서 로컬 디렉터리를 다른 로컬 디렉터리 위에 마운트하면 이 백업 절차는 파일을 두 번 백업합니다. 예를 들어 /tmp를 /usr/tmp 위에 마운트하면 /tmp 디렉터리의 파일이 두 번 백업됩니다. 이 중복으로 파일 시스템이 담을 수 있는 파일 수를 넘으면 나중에 백업 이미지 설치가 실패할 수 있습니다.

백업의 보안 고려 사항

백업 이미지를 다른 시스템에 설치한다면, 보안상 비밀번호와 네트워크 주소가 대상 시스템에 복사되기를 원하지 않을 수 있습니다.

또 네트워크 주소를 대상 시스템에 복사하면 중복 주소가 생겨 네트워크 통신을 방해할 수 있습니다.

백업 이미지 복원

백업 이미지를 설치할 때 시스템은 대상 시스템에 백업에 저장된 모든 논리 볼륨을 만들 디스크 공간이 충분한지 확인합니다. 공간이 충분하면 백업 전체를 복구합니다. 그렇지 않으면 설치가 멈추고 대상 하드 디스크를 더 고르라고 묻습니다.

백업 이미지를 만들기 전에 image.data 파일에서 SHRINK 변수를 yes로 설정하지 않았다면, 대상 시스템에 만드는 파일 시스템은 원본 시스템과 같은 크기입니다. 예외는 /tmp 디렉터리로, bosboot 명령에 쓸 공간을 할당하도록 늘어날 수 있습니다. 변수 설정에 관한 정보는 image.data 파일을 봅니다.

시스템이 백업 이미지 설치를 마치면 설치 프로그램이 대상 시스템의 ODM을 다시 구성합니다. 대상 시스템의 하드웨어 구성이 원본 시스템과 똑같지 않으면, 프로그램이 다음 대상 시스템 파일의 장치 속성을 바꿀 수 있습니다.

  • /etc/objrepos에서 Cu로 시작하는 모든 파일
  • /dev 디렉터리의 모든 파일

관련 정보:

  • Installing system backups

예약 백업 실행

사용자 파일의 주간 전체 백업과 일일 증분 백업을 하는 스크립트를 만들어 쓰는 절차입니다.

  • 이 스크립트를 쓸 때 백업 예약 데이터 양은 테이프 한 개를 넘을 수 없습니다.
  • cron 명령이 스크립트를 실행하기 전에 백업 장치에 테이프가 들어 있는지 확인합니다.
  • 특히 밤에 실행하는 스크립트를 쓸 때는 장치가 연결되어 있고 쓸 수 있는지 확인합니다. lsdev -C 출력을 pg로 넘겨 쓸 수 있는지 확인합니다.
  • 오류를 막도록 백업 장치를 최근에 청소했는지 확인합니다.
  • 사용 중일 수 있는 파일 시스템을 백업한다면 파일 시스템 손상을 막도록 먼저 마운트 해제합니다.
  • 백업하기 전에 파일 시스템을 검사합니다. 파일 시스템 검증 절차를 쓰거나 fsck 명령을 실행합니다.

이 절차의 스크립트는 본보기일 뿐이며 사이트의 요구에 맞게 신중히 고쳐야 합니다.

관련 개념:

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

cron 명령으로 파일 시스템 백업

cron 명령에 넘겨 실행할 crontab 스크립트를 작성하는 절차입니다.

이 스크립트는 월요일부터 토요일 밤까지 두 사용자 파일 시스템 /home/plan과 /home/run을 백업합니다. 두 파일 시스템 모두 테이프 한 개에 백업하며, 매일 아침 다음 밤을 위해 새 테이프를 넣습니다. 월요일 밤 백업은 전체 아카이브(레벨 0)입니다. 화요일부터 토요일 백업은 증분 백업입니다.

  1. crontab 스크립트를 만드는 첫 단계는 crontab -e 명령을 실행하는 것입니다. 그러면 매일 밤 실행하도록 cron에 제출할 항목을 적을 빈 파일이 열립니다(기본 편집기는 vi). 다음을 입력합니다.
text
crontab -e
  1. 다음 예는 crontab의 여섯 필드를 보여 줍니다. 필드 1은 분, 필드 2는 24시간제의 시, 필드 3은 그 달의 날짜, 필드 4는 그 해의 달입니다. 필드 3과 4에는 day/wk 필드에 지정한 요일에 매달 스크립트가 실행됨을 나타내는 *(별표)가 들어 있습니다. 필드 5는 요일이며 1-6처럼 범위로도 지정할 수 있습니다. 필드 6은 실행할 셸 명령입니다.
text
min hr day/mo mo/yr day/wk       shell command
0   2    *     *       1         backup -0 -uf /dev/rmt0.1 /home/plan

위 명령줄은 사이트의 담당자가 필요할 때 프롬프트에 응답할 수 있다고 가정합니다. backup 명령의 -0(영) 플래그는 레벨 0, 곧 전체 백업을 뜻합니다. -u 플래그는 /etc/dumpdates 파일의 백업 기록을 갱신하고, f 플래그는 장치 이름, 곧 위 예처럼 raw 자기 테이프 장치 0.1을 지정합니다. 3. 특정 요일에 백업할 파일 시스템마다 2단계와 비슷한 줄을 입력합니다. 다음 예는 두 파일 시스템을 6일 동안 백업하는 전체 스크립트입니다.

text
0 2 * * 1 backup -0 -uf/dev/rmt0.1 /home/plan
0 3 * * 1 backup -0 -uf/dev/rmt0.1 /home/run
0 2 * * 2 backup -1 -uf/dev/rmt0.1 /home/plan
0 3 * * 2 backup -1 -uf/dev/rmt0.1 /home/run
0 2 * * 3 backup -2 -uf/dev/rmt0.1 /home/plan
0 3 * * 3 backup -2 -uf/dev/rmt0.1 /home/run
0 2 * * 4 backup -3 -uf/dev/rmt0.1 /home/plan
0 3 * * 4 backup -3 -uf/dev/rmt0.1 /home/run
0 2 * * 5 backup -4 -uf/dev/rmt0.1 /home/plan
0 3 * * 5 backup -4 -uf/dev/rmt0.1 /home/run
0 2 * * 6 backup -5 -uf/dev/rmt0.1 /home/plan
0 3 * * 6 backup -5 -uf/dev/rmt0.1 /home/run
  1. 만든 파일을 저장하고 편집기를 빠져나옵니다. 운영 체제가 crontab 파일을 cron에 넘깁니다.

관련 정보:

  • rmt Special File

DMAPI로 관리하는 JFS2 파일 시스템의 파일 백업

tar와 backbyinode 명령에는 확장 속성(EA)을 백업하는 옵션이 있습니다.

DMAPI 파일 시스템에서 backbyinode 명령은 명령을 실행하는 때 파일 시스템에 있는 데이터만 백업합니다. backbyinode 명령은 메타데이터의 현재 상태를 살펴 일합니다. DMAPI에서는 관리되는 파일 시스템의 상태를 백업하므로 이것이 유리할 수 있습니다. 그러나 오프라인 데이터는 백업되지 않습니다.

DMAPI 파일 시스템의 모든 데이터를 백업하려면 tar 명령처럼 파일 전체를 읽는 명령을 씁니다. 이렇게 하면 DMAPI 지원 응용 프로그램이 tar 명령이 접근하는 모든 파일의 데이터를 복원해, 2차와 3차 저장소 사이로 데이터가 오가므로 성능에 영향이 있을 수 있습니다.

디스켓 포맷(format이나 fdformat 명령)

format과 fdformat 명령으로 Device 매개변수가 지정한 디스켓 드라이브(기본은 /dev/rfd0 장치)의 디스켓을 포맷할 수 있습니다.

주의: 디스켓을 포맷하면 그 디스켓의 기존 데이터가 모두 파괴됩니다.

format 명령은 장치 종류를 다음 가운데 하나로 판단합니다.

  • 5.25인치 저밀도 디스켓(360 KB): 40x2 트랙, 트랙마다 9섹터
  • 5.25인치 고용량 디스켓(1.2 MB): 80x2 트랙, 트랙마다 15섹터
  • 3.5인치 저밀도 디스켓(720 KB): 80x2 트랙, 트랙마다 9섹터
  • 3.5인치 고용량 디스켓(2.88 MB): 80x2 트랙, 트랙마다 36섹터

모든 디스켓 종류의 섹터 크기는 512바이트입니다.

Device 매개변수가 다른 밀도를 지정하지 않으면 format 명령으로 디스켓을 고밀도로 포맷합니다.

-h 플래그를 지정하지 않으면 fdformat 명령으로 디스켓을 저밀도로 포맷합니다. Device 매개변수는 포맷할 디스켓이 든 장치(드라이브 0은 /dev/rfd0 장치 등)를 지정합니다.

디스켓을 포맷하기 전에 format과 fdformat 명령은 확인을 묻습니다. 그래서 필요하면 작업을 깔끔하게 끝낼 수 있습니다.

다음 예를 봅니다.

  • /dev/rfd0 장치의 디스켓을 포맷하려면 다음을 입력합니다.
text
format -d /dev/rfd0
  • 불량 트랙을 검사하지 않고 디스켓을 포맷하려면 다음을 입력합니다.
text
format -f
  • /dev/rfd1 장치의 5.25인치 1.2 MB 디스켓 드라이브에서 360 KB 디스켓을 포맷하려면 다음을 입력합니다.
text
format -l -d /dev/rfd1
  • fdformat 명령을 쓸 때 디스켓을 강제로 고밀도 포맷하려면 다음을 입력합니다.
text
fdformat -h

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

파일 시스템 무결성 검사(fsck 명령)

fsck 명령으로 일관성이 깨진 파일 시스템을 검사하고 대화식으로 수리합니다.

시스템 초기화의 일부로 모든 파일 시스템에 이 명령을 실행하는 것이 중요합니다. 파일 시스템이 있는 장치 파일(예: /dev/hd0 장치)을 읽을 수 있어야 합니다. 보통 파일 시스템은 일관되며, fsck 명령은 파일 시스템의 파일 수, 사용 블록, 빈 블록만 보고합니다. 파일 시스템의 일관성이 깨져 있으면 fsck 명령은 찾은 불일치 정보를 보여 주고 수리할 권한을 묻습니다. fsck 명령은 수리에 보수적이며 올바른 데이터를 잃을 수 있는 조치를 피하려 합니다. 그러나 어떤 경우에는 손상된 파일을 없애라고 권합니다.

주의: 시스템 고장 뒤에는 언제나 파일 시스템에 fsck 명령을 실행합니다. 바로잡는 조치로 일부 데이터를 잃을 수 있습니다. 일관성 수정마다 기본 동작은 운영자가 yes나 no를 입력하기를 기다리는 것입니다. 영향을 받는 파일에 쓰기 권한이 없으면 fsck 명령은 기본으로 no로 응답합니다.

다음 예를 봅니다.

  • 모든 기본 파일 시스템을 검사하려면 다음을 입력합니다.
text
fsck

이 형태의 fsck 명령은 파일 시스템을 바꾸기 전에 권한을 묻습니다.

  • 기본 파일 시스템의 작은 문제를 자동으로 고치려면 다음을 입력합니다.
text
fsck -p
  • /dev/hd1 파일 시스템을 검사하려면 다음을 입력합니다.
text
fsck /dev/hd1

이렇게 하면 /dev/hd1 장치에 있는 마운트되지 않은 파일 시스템을 검사합니다.

참고: fsck 명령은 마운트된 파일 시스템을 고치지 않습니다.

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

디스켓으로 복사하거나 디스켓에서 복사(flcopy 명령)

flcopy 명령으로 디스켓(/dev/rfd0으로 엶)을 현재 디렉터리에 만드는 floppy라는 파일로 복사합니다.

필요하면 Change floppy, hit return when done 메시지가 나옵니다. 그러면 flcopy 명령이 floppy 파일을 디스켓으로 복사합니다.

다음 예를 봅니다.

  • /dev/rfd1을 현재 디렉터리의 floppy 파일로 복사하려면 다음을 입력합니다.
text
flcopy -f /dev/rfd1 -r
  • 디스켓의 처음 100트랙을 복사하려면 다음을 입력합니다.
text
flcopy -f /dev/rfd1 -t 100

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

테이프나 디스크로 파일 복사(cpio -o 명령)

cpio -o 명령으로 표준 입력에서 파일 경로 이름을 읽어, 경로 이름과 상태 정보와 함께 이 파일들을 표준 출력으로 복사합니다.

경로 이름은 128자를 넘을 수 없습니다. 고유하게 링크된 파일이 많은 경로 이름을 cpio 명령에 주지 않습니다. 경로 이름을 추적할 메모리가 모자라 링크 정보를 잃을 수 있기 때문입니다.

다음 예를 봅니다.

  • 현재 디렉터리에서 이름이 .c로 끝나는 파일을 디스켓에 복사하려면 다음을 입력합니다.
text
ls *.c | cpio -ov >/dev/rfd0

-v 플래그는 각 파일의 이름을 보여 줍니다.

  • 현재 디렉터리와 모든 하위 디렉터리를 디스켓에 복사하려면 다음을 입력합니다.
text
find . -print | cpio -ov >/dev/rfd0

이렇게 하면 현재 디렉터리(.)에서 시작해 모든 하위 디렉터리와 파일을 포함하는 디렉터리 트리를 저장합니다.

  • 더 짧은 명령 문자열을 쓰려면 다음을 입력합니다.
text
find . -cpio /dev/rfd0 -print

-print 항목은 파일을 복사할 때마다 그 이름을 보여 줍니다.

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

테이프나 디스크에서 파일 복사(cpio -i 명령)

cpio -i 명령으로 cpio -o 명령이 만든 아카이브 파일을 표준 입력에서 읽고, 그 가운데 이름이 Pattern 매개변수와 맞는 파일을 복사합니다.

이 파일들은 현재 디렉터리 트리로 복사됩니다. ksh 명령에 설명된 파일 이름 표기로 Pattern 매개변수를 여럿 나열할 수 있습니다. Pattern 매개변수의 기본값은 현재 디렉터리의 모든 파일을 고르는 별표(*)입니다. [a-z] 같은 식에서 하이픈(-)은 현재 정렬 순서에 따라 "~까지"를 뜻합니다.

참고: 셸이 별표(*)를 패턴 일치 문자로 다루지 않도록 "*.c"와 "*.o" 패턴은 따옴표로 감싸야 합니다. 이것은 cpio 명령이 패턴 일치 문자를 직접 해석하는 특수한 경우입니다.

다음 예를 봅니다.

  • cpio 명령으로 디스켓에 저장한 파일을 나열하려면 다음을 입력합니다.
text
cpio -itv </dev/rfd0

이렇게 하면 전에 cpio 명령 형식으로 /dev/rfd0 파일에 저장한 데이터의 목차가 나옵니다. 목록은 ls -l 명령이 만드는 긴 디렉터리 목록과 비슷합니다.

  • 파일 경로 이름만 나열하려면 -it 플래그만 씁니다.
  • 전에 cpio 명령으로 저장한 파일을 디스켓에서 복사해 오려면 다음을 입력합니다.
text
cpio -idmv </dev/rfd0

이렇게 하면 전에 cpio 명령으로 /dev/rfd0 파일에 저장한 파일을 파일 시스템으로 다시 복사합니다(-i 플래그 지정). -d 플래그는 디렉터리 트리를 저장했으면 cpio 명령이 알맞은 디렉터리를 만들게 합니다. -m 플래그는 파일을 저장할 때의 마지막 수정 시간을 유지합니다. -v 플래그는 파일을 복사할 때마다 cpio 명령이 그 이름을 보여 주게 합니다.

  • 디스켓에서 고른 파일을 복사하려면 다음을 입력합니다.
text
cpio -i "*.c" "*.o" </dev/rfd0

이렇게 하면 디스켓에서 .c나 .o로 끝나는 파일을 복사합니다.

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

테이프로 복사하거나 테이프에서 복사(tcopy 명령)

tcopy 명령으로 자기 테이프를 복사합니다.

예를 들어 스트리밍 테이프 하나에서 9트랙 테이프로 복사하려면 다음을 입력합니다.

text
tcopy /dev/rmt0 /dev/rmt8

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

테이프 무결성 검사(tapechk 명령)

tapechk 명령으로 붙어 있는 스트리밍 테이프 장치에 기본적인 일관성 검사를 합니다.

스트리밍 테이프 드라이브의 일부 하드웨어 고장은 테이프를 읽기만 해도 감지할 수 있습니다. tapechk 명령은 파일 수준에서 테이프 읽기를 하는 방법을 제공합니다.

예를 들어 스트리밍 테이프 장치의 처음 세 파일을 검사하려면 다음을 입력합니다.

text
tapechk 3

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

파일 아카이브(tar 명령)

아카이브 백업 방법은 나중에 참고하거나, 기록 목적이거나, 원본 데이터가 손상되거나 잃어버렸을 때 복구하려고 저장하는 파일 하나 이상이나 데이터베이스 전체의 사본에 씁니다.

보통 아카이브는 특정 데이터를 시스템에서 지울 때 씁니다.

tar 명령으로 아카이브 저장소에 파일을 쓰거나 아카이브 저장소에서 파일을 가져옵니다. tar 명령은 다른 장치를 지정하지 않으면 기본 장치(보통 테이프)에서 아카이브를 찾습니다.

아카이브에 쓸 때 tar 명령은 임시 파일(/tmp/tar* 파일)을 쓰고, 링크가 여럿인 파일의 표를 메모리에 유지합니다. tar 명령이 임시 파일을 만들 수 없거나 링크 표를 담을 메모리가 모자라면 오류 메시지를 받습니다.

다음 예를 봅니다.

  • file1과 file2 파일을 기본 테이프 드라이브의 새 아카이브에 쓰려면 다음을 입력합니다.
text
tar -c file1 file2
  • /dev/rmt2 테이프 장치의 아카이브 파일에서 /tmp 디렉터리의 모든 파일을 꺼내고 꺼낸 시각을 수정 시간으로 쓰려면 다음을 입력합니다.
text
tar -xm -f/dev/rmt2 /tmp
  • 현재 디렉터리의 디스크 아카이브 파일 out.tar에 든 파일 이름을 보려면 다음을 입력합니다.
text
tar -vtf out.tar

자세한 정보와 전체 구문은 Commands Reference, Volume 5의 tar 명령을 봅니다.

영어 원문

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.

You can backup an image of the system and volume groups using Web-based System Manager, SMIT, or command procedures. A backup image serves two purposes. One is to restore a corrupted system using the system backup image. The other is to transfer installed and configured software from one system to others.

The Web-based System Manager and SMIT procedures use the mksysb command to create a backup image that can be stored either on tape or in a file. If you choose tape, the backup program writes a boot image to the tape, which makes it suitable for installing.

Note

  • Startup tapes cannot be made on or used to start a PowerPC-based personal computer.

  • If you choose the SMIT method for backup, you must first install the sysbr fileset in the bos.sysmgt software package.

Related concepts

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.

Related information

Installing optional software products and service updates

Backing up the system image and user-defined volume groups

You can make backups of the system image and the user-defined volume groups.

Before backing up the rootvg volume group:

  • All hardware must already be installed, including external devices, such as tape and CD-ROM drives.

  • This backup procedure requires the sysbr fileset, which is in the BOS System Management Tools and Applications software package. Type the following command to determine whether the sysbr fileset is installed on your system:

text
lslpp -l bos.sysmgt.sysbr

If your system has the sysbr fileset installed, continue the backup procedures. If the lslpp command does not list the sysbr fileset, install it before continuing with the backup procedure.

text
installp -agqXd device bos.sysmgt.sysbr

where device is the location of the software; for example, /dev/rmt0 for a tape drive.

Before backing up a user-defined volume group:

  • Before being saved, a volume group must be varied on and the file systems must be mounted. Attention: Executing the savevg command results in the loss of all material previously stored on the selected output medium.

  • Make sure the backup device has been cleaned recently to prevent errors.

The following procedures describe how to make an installable image of your system. Task SMIT Fast Path Command or File Backing up the rootvg volume group

  1. Log in as root.

  2. Mount file systems for backup.1smit mountfs

  3. Unmount any local directories that are mounted over another local directory. smit umountfs

  4. Make at least 8.8MB of free disk space available in the /tmp directory.2

  5. Back up: smit mksysb

  6. Write-protect the backup media.

  7. Record any backed-up root and user passwords.

  8. Log in as root.

  9. Mount file systems for backup.1 See mount command.

  10. Unmount any local directories that are mounted over another local directory. See umount command.

  11. Make at least 8.8MB of free disk space available in the /tmp directory.2

  12. Back up. See mksysb command.

  13. Write-protect the backup media.

  14. Record any backed-up root and user passwords.

Verify a Backup Tape3 smit lsmksysb Backing up a user-defined volume group4 smit savevg 1. Modify the file system size before backing up, if necessary.5 mkvgdata VGName then edit /tmp/vgdata/VGName/VGName.data

  1. Save the volume group. See the savevg command.

Note

  1. The mksysb command does not back up file systems mounted across an NFS network.

  2. The mksysb command requires this working space for the duration of the backup. Use the df command, which reports in units of 512-byte blocks, to determine the free space in the /tmp directory. Use the chfs command to change the size of the file system, if necessary.

  3. This procedure lists the contents of a mksysb backup tape. The contents list verifies most of the information on the tape but does not verify that the tape can be booted for installations. The only way to verify that the boot image on a mksysb tape functions correctly is by booting from the tape.

  4. If you want to exclude files in a user-defined volume group from the backup image, create a file named /etc/exclude.``volume_group_name, where volume_group_name is the name of the volume group that you want to back up. Then edit /etc/exclude.``volume_group_name and enter the patterns of file names that you do not want included in your backup image. The patterns in this file are input to the pattern matching conventions of the grep command to determine which files are excluded from the backup.

  5. If you choose to modify the VGName.data file to alter the size of a file system, you must not specify the -i flag or the -m flag with the savevg command, because the VGName.data file is overwritten.

Related information

Installing optional software products and service updates Installing system backups

Pre-backup configuration

Configure the source system before creating a backup image of it. If, however, you plan to use a backup image for installing other, differently configured target systems, create the image before configuring the source system.

The source system is the system from which you created the backup copy. The target system is the system on which you are installing the backup copy.

The installation program automatically installs only the device support required for the hardware configuration of the installed machine. Therefore, if you are using a system backup to install other machines, you might need to install additional devices on the source system before making the backup image and using it to install one or more target systems.

Use Web-based System Manager or the SMIT fast path, smit devinst, to install additional device support on the source system.

  • If there is sufficient disk space on the source and target systems, install all device support.

  • If there is limited disk space on the source and target systems, selectively install device support.

A backup transfers the following configurations from the source system to the target system:

  • Paging space information

  • Logical volume information

  • rootvg information

  • Placement of logical partitions (if you have selected the map option).

Related information

Installing optional software and service updates Customizing your installation

File system mounts and unmounts

Before performing a backup, you must mount all file systems you want to back up and unmount all file systems you do not want to back up.

The Backup Methods procedure backs up only mounted file systems in the rootvg. You must, therefore, mount all file systems you want to back up before starting. Similarly, you must unmount file systems you do not want backed up.

This backup procedure backs up files twice if a local directory is mounted over another local directory in the same file system. For example, if you mount /tmp over /usr/tmp, the files in the /tmp directory are backed up twice. This duplication might exceed the number of files a file system can hold, which can cause a future installation of the backup image to fail.

Security considerations for backups

If you install the backup image on other systems, you might not, for security reasons, want passwords and network addresses copied to the target systems.

Also, copying network addresses to a target system creates duplicate addresses that can disrupt network communications.

Backup image restoration

When installing the backup image, the system checks whether the target system has enough disk space to create all the logical volumes stored on the backup. If there is enough space, the entire backup is recovered. Otherwise, the installation halts and the system prompts you to choose more destination hard disks.

File systems created on the target system are the same size as they were on the source system, unless the SHRINK variable was set to yes in the image.data file before the backup image was made. An exception is the /tmp directory, which can be increased to allocate enough space for the bosboot command. For information about setting variables, see the image.data file.

When the system finishes installing the backup image, the installation program reconfigures the ODM on the target system. If the target system does not have exactly the same hardware configuration as the source system, the program might modify device attributes in the following target system files:

  • All files in /etc/objrepos beginning with Cu

  • All files in the /dev directory.

Related information

Installing system backups

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.

  • The amount of data scheduled for backup cannot exceed one tape when using this script.

  • Make sure the tape is loaded in the backup device before the cron command runs the script.

  • Make sure the device is connected and available, especially when using scripts that run at night. Use the lsdev -C | pg command to check availability.

  • Make sure the backup device has been cleaned recently to prevent errors.

  • If you are backing up file systems that might be in use, unmount them first to prevent file system corruption.

  • Check the file system before making the backup. Use the procedure File system verification or run the fsck command.

The script included in this procedure is intended only as a model and needs to be carefully tailored to the needs of the specific site.

Related concepts

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

Backing up file systems using the cron command

This procedure describes how to write a crontab script that you can pass to the cron command for execution.

The script backs up two user file systems, /home/plan and /home/run, on Monday through Saturday nights. Both file systems are backed up on one tape, and each morning a new tape is inserted for the next night. The Monday night backups are full archives (level 0). The backups on Tuesday through Saturday are incremental backups.

  1. The first step in making the crontab script is to issue the crontab-e command. This opens an empty file where you can make the entries that are submitted to the cron script for execution each night (the default editor is vi). Type:
text
crontab -e
  1. The following example shows the six crontab fields. Field 1 is for the minute, field 2 is for the hour on a 24-hour clock, field 3 is for the day of the month, and field 4 is for the month of the year. Fields 3 and 4 contain an * (asterisk) to show that the script runs every month on the day specified in the day/wk field. Field 5 is for the day of the week, and can also be specified with a range of days, for example, 1-6. Field 6 is for the shell command being run.
text
min hr day/mo mo/yr day/wk       shell command
0   2    *     *       1         backup -0 -uf /dev/rmt0.1 /home/plan

The command line shown assumes that personnel at the site are available to respond to prompts when appropriate. The -0 (zero) flag for the backup command stands for level zero, or full backup. The -u flag updates the backup record in the /etc/dumpdates file and the f flag specifies the device name, a raw magnetic tape device 0.1 as in the example above.

  1. Type a line similar to that in step 2 for each file system backed up on a specific day. The following example shows a full script that performs six days of backups on two file systems:
text
0 2 * * 1 backup -0 -uf/dev/rmt0.1 /home/plan
0 3 * * 1 backup -0 -uf/dev/rmt0.1 /home/run
0 2 * * 2 backup -1 -uf/dev/rmt0.1 /home/plan
0 3 * * 2 backup -1 -uf/dev/rmt0.1 /home/run
0 2 * * 3 backup -2 -uf/dev/rmt0.1 /home/plan
0 3 * * 3 backup -2 -uf/dev/rmt0.1 /home/run
0 2 * * 4 backup -3 -uf/dev/rmt0.1 /home/plan
0 3 * * 4 backup -3 -uf/dev/rmt0.1 /home/run
0 2 * * 5 backup -4 -uf/dev/rmt0.1 /home/plan
0 3 * * 5 backup -4 -uf/dev/rmt0.1 /home/run
0 2 * * 6 backup -5 -uf/dev/rmt0.1 /home/plan
0 3 * * 6 backup -5 -uf/dev/rmt0.1 /home/run
  1. Save the file you created and exit the editor. The operating system passes the crontab file to the cron script.

Related information

rmt Special File

Backup of files on a DMAPI-managed JFS2 file system

There are options in the tar and backbyinode commands that allow you to back up the extended attributes (EAs).

With the backbyinode command on a DMAPI file system, only the data resident in the file system at the time the command is issued is backed up. The backbyinode command examines the current state of metadata to do its work. This can be advantageous with DMAPI, because it backs up the state of the managed file system. However, any offline data will not be backed up.

To back up all of the data in a DMAPI file system, use a command that reads entire files, such as the tar command. This can cause a DMAPI-enabled application to restore data for every file accessed by the tar command, moving data back and forth between secondary and tertiary storage, so there can be performance implications.

Formatting diskettes (format or fdformat command)

You can format diskettes in the diskette drive specified by the Device parameter (the /dev/rfd0 device by default) with the format and fdformat commands.

Attention: Formatting a diskette destroys any existing data on that diskette.

The format command determines the device type, which is one of the following:

  • 5.25-inch low-density diskette (360 KB) containing 40x2 tracks, each with 9 sectors

  • 5.25-inch high-capacity diskette (1.2 MB) containing 80x2 tracks, each with 15 sectors

  • 3.5-inch low-density diskette (720 KB) containing 80x2 tracks, each with 9 sectors

  • 3.5-inch high-capacity diskette (2.88 MB) containing 80x2 tracks, each with 36 sectors

The sector size is 512 bytes for all diskette types.

Use the format command to format a diskette for high density unless the Device parameter specifies a different density.

Use the fdformat command to format a diskette for low density unless the -h flag is specified. The Device parameter specifies the device containing the diskette to be formatted (such as the /dev/rfd0 device for drive 0).

Before formatting a diskette, the format and fdformat commands prompt for verification. This allows you to end the operation cleanly if necessary.

See the following examples:

  • To format a diskette in the /dev/rfd0 device, type the following:
text
format -d /dev/rfd0
  • To format a diskette without checking for bad tracks, type the following:
text
format -f
  • To format a 360 KB diskette in a 5.25-inch, 1.2 MB diskette drive in the /dev/rfd1 device, type the following:
text
format -l -d /dev/rfd1
  • To force high-density formatting of a diskette when using the fdformat command, type the following:
text
fdformat -h

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

Checking the integrity of a file system (fsck command)

Use the fsck command to check and interactively repair inconsistent file systems.

It is important to run this command on every file system as part of system initialization. You must be able to read the device file on which the file system resides (for example, the /dev/hd0 device). Normally, the file system is consistent, and the fsck command merely reports on the number of files, used blocks, and free blocks in the file system. If the file system is inconsistent, the fsck command displays information about the inconsistencies found and prompts you for permission to repair them. The fsck command is conservative in its repair efforts and tries to avoid actions that might result in the loss of valid data. In certain cases, however, the fsck command recommends the destruction of a damaged file.

Attention: Always run the fsck command on file systems after a system malfunction. Corrective actions can result in some loss of data. The default action for each consistency correction is to wait for the operator to type yes or no. If you do not have write permission for an affected file, the fsck command will default to a no response.

See the following examples:

  • To check all the default file systems, type the following:
text
fsck

This form of the fsck command asks you for permission before making any changes to a file system.

  • To fix minor problems automatically with the default file systems, type the following:
text
fsck -p
  • To check the /dev/hd1 file system , type the following:
text
fsck /dev/hd1

This checks the unmounted file system located on the /dev/hd1 device.

Note: The fsck command does not make corrections to a mounted file system.

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

Copying to or from diskettes (flcopy command)

Use the flcopy command to copy a diskette (opened as /dev/rfd0) to a file named floppy created in the current directory.

The message Change floppy, hit return when done displays as needed. The flcopy command then copies the floppy file to the diskette.

See the following examples:

  • To copy /dev/rfd1 to the floppy file in the current directory, type the following:
text
flcopy -f /dev/rfd1 -r
  • To copy the first 100 tracks of the diskette, type the following:
text
flcopy -f /dev/rfd1 -t 100

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

Copying files to tape or disk (cpio -o command)

Use the cpio -o command to read file path names from standard input and copy these files to standard output, along with path names and status information.

Path names cannot exceed 128 characters. Avoid giving the cpio command path names made up of many uniquely linked files because it might not have enough memory to keep track of the path names and would lose linking information.

See the following examples:

  • To copy files in the current directory whose names end with .c onto diskette, type the following:
text
ls *.c | cpio -ov >/dev/rfd0

The -v flag displays the names of each file.

  • To copy the current directory and all subdirectories onto diskette, type the following:
text
find . -print | cpio -ov >/dev/rfd0

This saves the directory tree that starts with the current directory (.) and includes all of its subdirectories and files.

  • To use a shorter command string, type the following:
text
find . -cpio /dev/rfd0 -print

The -print entry displays the name of each file as it is copied.

See the cpio command in the Commands Reference, Volume 1 for the complete syntax.

Copying files from tape or disk (cpio -i command)

Use the cpio -i command to read from standard input an archive file created by the cpio -o command and copy from it the files with names that match the Pattern parameter.

These files are copied into the current directory tree. You can list more than one Pattern parameter by using the file name notation described in the ksh command. The default for the Pattern parameter is an asterisk (*), which selects all files in the current directory. In an expression such as [a-z], the hyphen (-) means through, according to the current collating sequence.

Note: The patterns "*.c" and "*.o" must be enclosed in quotation marks to prevent the shell from treating the asterisk (*) as a pattern-matching character. This is a special case in which the cpio command itself decodes the pattern-matching characters.

See the following examples:

  • To list the files that have been saved onto a diskette with the cpio command, type the following:
text
cpio -itv </dev/rfd0

This displays the table of contents of the data previously saved onto the /dev/rfd0 file in the cpio command format. The listing is similar to the long directory listing produced by the ls -l command.

  • To list only the file path names, use only the -it flags.

  • To copy the files previously saved with the cpio command from a diskette, type the following:

text
cpio -idmv </dev/rfd0

This copies the files previously saved onto the /dev/rfd0 file by the cpio command back into the file system (specify the -i flag). The -d flag allows the cpio command to create the appropriate directories if a directory tree is saved. The -m flag maintains the last modification time in effect when the files are saved. The -v flag causes the cpio command to display the name of each file as it is copied.

  • To copy selected files from diskette, type the following:
text
cpio -i "*.c" "*.o" </dev/rfd0

This copies the files that end with .c or .o from diskette.

See the cpio command in the Commands Reference, Volume 1 for the complete syntax.

Copying to or from tapes (tcopy command)

Use the tcopy command to copy magnetic tapes.

For example, to copy from one streaming tape to a 9-track tape, type the following:

text
tcopy /dev/rmt0 /dev/rmt8

See the tcopy command in the Commands Reference, Volume 5 for the complete syntax.

Checking the integrity of a tape (tapechk command)

Use the tapechk command to perform rudimentary consistency checking on an attached streaming tape device.

Some hardware malfunctions of a streaming tape drive can be detected by simply reading a tape. The tapechk command provides a way to perform tape reads at the file level.

For example, to check the first three files on a streaming tape device, type the following:

text
tapechk 3

See the tapechk command in the Commands Reference, Volume 3 for the complete syntax.

Archiving files (tar command)

The archive backup method is used for a copy of one or more files, or an entire database that is saved for future reference, historical purposes, or for recovery if the original data is damaged or lost.

Usually, an archive is used when that specific data is removed from the system.

Use the tar command to write files to or retrieve files from an archive storage. The tar command looks for archives on the default device (usually tape), unless you specify another device.

When writing to an archive, the tar command uses a temporary file (the /tmp/tar* file) and maintains in memory a table of files with several links. You receive an error message if the tar command cannot create the temporary file or if there is not enough memory available to hold the link tables.

See the following examples:

  • To write the file1 and file2 files to a new archive on the default tape drive, type the following:
text
tar -c file1 file2
  • To extract all files in the /tmp directory from the archive file on the /dev/rmt2 tape device and use the time of extraction as the modification time, type the following:
text
tar -xm -f/dev/rmt2 /tmp
  • To display the names of the files in the out.tar disk archive file from the current directory, type the following:
text
tar -vtf out.tar

See the tar command in the Commands Reference, Volume 5 for more information and the complete syntax.

파일 백업

backup 명령이나 smit 명령으로 자기 테이프나 디스켓 같은 백업 매체에 파일 사본을 만듭니다.

주의: 마운트된 파일 시스템을 백업하려 하면 메시지가 나옵니다. backup 명령은 계속되지만 파일 시스템에 불일치가 생길 수 있습니다. 이 상황은 루트(/) 파일 시스템에는 해당하지 않습니다.

backup 명령이나 smit 명령으로 만든 사본은 다음 백업 형식 가운데 하나입니다.

  • -i 플래그로 이름 기준으로 백업한 특정 파일
  • -Level과 FileSystem 매개변수로 i-node 번호 기준으로 백업한 파일 시스템 전체

주:

  • 시스템 백업 중에 파일이 바뀌면 언제나 데이터가 손상될 가능성이 있습니다. 그래서 시스템 백업 절차 동안 시스템 활동을 최소로 합니다.
  • 장치 블록 크기를 0으로 설정한 채 8 mm 테이프로 백업하면 테이프에서 데이터를 바로 복원할 수 없습니다. 0 설정으로 백업했으면 restore 명령에 설명된 특별 절차로 데이터를 복원할 수 있습니다.

주의: 지정하는 플래그가 백업 매체와 맞는지 확인합니다.

backup 명령으로 파일 백업

backup 명령으로 백업 매체에 파일 사본을 만듭니다.

예를 들어 $HOME 디렉터리에서 고른 파일을 이름 기준으로 백업하려면 다음을 입력합니다.

text
find $HOME -print | backup -i -v

-i 플래그는 백업할 파일 이름을 표준 입력에서 읽으라고 시스템에 알립니다. find 명령은 사용자 디렉터리의 파일 목록을 만듭니다. 이 목록은 표준 입력으로 backup 명령에 파이프로 넘어갑니다. -v 플래그는 파일을 복사할 때마다 진행 보고를 보여 줍니다. 파일은 로컬 시스템의 기본 백업 장치에 백업됩니다.

다음 예를 봅니다.

  • 루트 파일 시스템을 백업하려면 다음을 입력합니다.
text
backup -0 -u /

레벨 0과 /는 시스템에 /(root) 파일 시스템을 백업하라고 알립니다. 파일 시스템은 /dev/rfd0 파일로 백업됩니다. -u 플래그는 /etc/dumpdates 파일의 현재 백업 레벨 기록을 갱신하라고 알립니다.

  • 마지막 레벨 0 백업 뒤 바뀐 /(root) 파일 시스템의 모든 파일을 백업하려면 다음을 입력합니다.
text
backup -1 -u /

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

smit 명령으로 파일 백업

smit 명령으로 backup 명령을 실행해 백업 매체에 파일 사본을 만듭니다.

  1. 프롬프트에서 다음을 입력합니다.
text
smit backup
  1. DIRECTORY full pathname 필드에 파일 시스템이 보통 마운트되는 디렉터리의 경로 이름을 입력합니다.
text
/home/bill
  1. BACKUP device or FILE 필드에 출력 장치 이름을 입력합니다. raw 자기 테이프 장치의 예는 다음과 같습니다.
text
/dev/rmt0
  1. 오류 메시지를 화면에 출력하려면 Tab 키로 선택 필드 REPORT each phase of the backup을 바꿉니다.
  2. 시스템 관리 환경에서는 MAX number of blocks to write on backup medium 필드가 테이프 백업에 적용되지 않으므로 기본값을 씁니다.
  3. Enter를 눌러 이름을 지정한 디렉터리나 파일 시스템을 백업합니다.
  4. restore -t 명령을 실행합니다. 이 명령이 오류 메시지를 내면 백업 전체를 다시 해야 합니다.
영어 원문

File backup

Use either the backup command or the smit command to create copies of your files on backup media, such as a magnetic tape or diskette.

Attention: If you attempt to back up a mounted file system, a message displays. The backup command continues, but inconsistencies in the file system can occur. This situation does not apply to the root (/) file system.

The copies you created with the backup command or the smit command are in one of the following backup formats:

  • Specific files backed up by name, using the -i flag.

  • Entire file system backed up by i-node number, using the -Level and FileSystem parameters.

Note

– The possibility of data corruption always exists when a file is modified during system backup. Therefore, make sure that system activity is at a minimum during the system backup procedure. – If a backup is made to 8-mm tape with the device block size set to 0 (zero), it is not possible to directly restore data from the tape. If you have done backups with the 0 setting, you can restore data from them by using special procedures described under the restore command.

Attention: Be sure the flags you specify match the backup media.

Backing up files using the backup command

Use the backup command to create copies of your files on backup media.

For example, to back up selected files in your $HOME directory by name, type the following:

text
find $HOME -print | backup -i -v

The -i flag prompts the system to read from standard input the names of files to be backed up. The find command generates a list of files in the user's directory. This list is piped to the backup command as standard input. The -v flag displays a progress report as each file is copied. The files are backed up on the default backup device for the local system.

See the following examples:

  • To back up the root file system, type the following:
text
backup -0 -u /

The 0 level and the / tell the system to back up the / (root) file system. The file system is backed up to the /dev/rfd0 file. The -u flag tells the system to update the current backup level record in the /etc/dumpdates file.

  • To back up all files in the / (root) file system that were modified since the last 0 level backup, type the following:
text
backup -1 -u /

See the backup command in Commands Reference, Volume 4 for the complete syntax.

Backing up files using the smit command

Use the smit command to run the backup command, which creates copies of your files on backup media.

  1. At the prompt, type the following:
text
smit backup
  1. Type the path name of the directory on which the file system is normally mounted in the

DIRECTORY full pathname field

text
/home/bill
  1. In the BACKUP device or FILE fields, enter the output device name, as in the following example for a raw magnetic tape device:
text
/dev/rmt0
  1. Use the Tab key to toggle the optional REPORT each phase of the backup field if you want error messages printed to the screen.

  2. In a system management environment, use the default for the MAX number of blocks to write on backup medium field because this field does not apply to tape backups.

  3. Press Enter to back up the named directory or file system.

  4. Run the restore -t command. If this command generates an error message, you must repeat the entire backup.