savevg 명령어 (AIX 5.3·6.1)
https://archive.horanglab.com/posts/aix-cmd-savevg
핵심 정리
- 볼륨 그룹에 속한 파일을 찾아 백업합니다. rootvg가 아닌 데이터 볼륨 그룹 백업에 씁니다:
savevg -if /backup/datavg.savevg datavg. -i로/tmp/vgdata/vgname/vgname.data(볼륨 그룹·LV·파일 시스템 구조)를 새로 만들어 함께 넣습니다. 복원은restvg로 구조와 파일을 한꺼번에 되살립니다.- 볼륨 그룹이 varyon되어 있고 파일 시스템이 마운트되어 있어야 합니다. raw LV는 들어가지 않습니다.
-e는/etc/exclude.vgname의 패턴을 빼고,-r은 파일 없이 구조 정보만 백업합니다.savevg는mksysb의 링크이며, rootvg를savevg로 백업하면 부팅할 수 없는 테이프가 됩니다.
| 항목 | 내용 |
|---|---|
| 버전 | AIX 5.3, AIX 6.1 (6.1에서 -Z(EFS 정보 제외)가 더해짐) |
| 원문 | IBM Commands Reference — 5.3 Volume 5, 6.1 Volume 5 |
| 파일 | /usr/bin/savevg, /tmp/vgdata/vgname/vgname.data, /etc/exclude.vgname |
| 관련 명령어 | restvg, mksysb, mkvgdata, lsmksysb, restorevgfiles |
목적
지정한 볼륨 그룹에 속한 파일을 모두 찾아 백업합니다.
영어 원문
Finds and backs up all files belonging to a specified volume group.
구문
savevg [ -a ] [ -A ] [ -b Blocks ] [ -e ] [ -f Device ] [ -i | -m ] [ -p ] [ -r ] [ -v ] [ -V ] [ -X ] VGName [ -Z ]
설명
savevg 명령은 지정한 볼륨 그룹에 속한 파일을 모두 찾아 백업합니다. 볼륨 그룹은 varyon되어 있고 파일 시스템은 마운트되어 있어야 합니다. mkvgdata 명령이 만든 데이터 파일을 쓰며, 다음 가운데 하나입니다.
| 파일 | 설명 |
|---|---|
/image.data |
루트 볼륨 그룹(rootvg) 정보. 이것으로 만든 백업 이미지는 NIM이 지금 시스템이나 새 시스템에 볼륨 그룹을 다시 설치하는 데 씀 |
/tmp/vgdata/vgname/vgname.data |
사용자 볼륨 그룹 정보(vgname은 볼륨 그룹 이름). 이것으로 만든 백업 이미지는 restvg가 사용자 볼륨 그룹을 다시 만드는 데 씀 |
운영 체제를 CD로 백업하려면 mkcd 명령을 씁니다.
참고: 루트 볼륨 그룹을 savevg로 백업하면 부팅할 수 있는 테이프가 만들어지지 않습니다. 테이프는 부팅할 수 없지만 처음 세 이미지는 부팅 테이프에 보통 들어가는 이미지 자리를 채우는 가짜이고, 실제 시스템 백업은 네 번째 이미지입니다.
영어 원문
The savevg command finds and backs up all files belonging to a specified volume group. The volume group must be varied-on, and the file systems must be mounted. The savevg command uses the data file created by the mkvgdata command. This data file can be one of the following:
/image.data Contains information about the root volume group (rootvg). The savevg command uses this file to create a backup image that can be used by Network Installation Management (NIM) to reinstall the volume group to the current system or to a new system.
/tmp/vgdata/vgname/vgname.data Contains information about a user volume group. The VGName variable reflects the name of the volume group. The savevg command uses this file to create a backup image that can be used by the restvg command to remake the user volume group.
To create a backup of the operating system to CD, use the mkcd command.
Note: The savevg command will not generate a bootable tape if the volume group is the root volume group. Although the tape is not bootable, the first three images on the tape are dummy replacements for the images normally found on a bootable tape. The actual system backup is the fourth image.
플래그
| 플래그 | 설명 |
|---|---|
-a |
확장 속성이나 NFS4 ACL을 백업하지 않습니다. |
-A |
DMAPI 파일 시스템 파일을 백업합니다. |
-b Blocks |
한 번에 쓸 512바이트 블록 수. 없으면 backup이 장치에 맞는 기본값을 씁니다. 크면 테이프 장치로의 물리 전송이 커집니다. 장치 물리 블록 크기의 배수여야 합니다. |
-e |
/etc/exclude.vgname에 적힌 파일을 백업에서 뺍니다. 아래 "제외 목록"을 봅니다. |
-f Device |
이미지를 저장할 장치나 파일 이름. 기본 /dev/rmt0. |
-i |
mkvgdata를 불러 데이터 파일을 만듭니다. |
-m |
mkvgdata -m을 불러 맵 파일을 포함한 데이터 파일을 만듭니다. |
-p |
백업하는 파일을 소프트웨어로 압축하지 않습니다. 자체 압축을 하는 테이프 드라이브가 있습니다. |
-r |
사용자 볼륨 그룹 정보와 관리 데이터 파일(/tmp/vgdata/vgname/vgname.data, 있으면 맵 파일)만 백업하고 사용자 데이터 파일은 백업하지 않습니다. 데이터 없이 볼륨 그룹을 다시 만들 때 씁니다. rootvg에는 쓸 수 없습니다. |
-v |
자세한 모드. 백업하는 파일을 나열합니다. |
-V |
테이프 백업을 검증합니다. 각 파일 머리글을 확인하고 읽기 오류를 바로 알려 줍니다. |
-X |
필요하면 /tmp 파일 시스템을 자동으로 늘립니다. |
-Z |
(6.1) 모든 파일, 디렉터리, 파일 시스템의 EFS(암호화 파일 시스템) 정보를 백업하지 않습니다. |
제외 목록(-e)
빼려는 파일 이름 패턴을 ASCII 편집기로 제외 파일에 적습니다. 패턴은 grep의 패턴 일치 규칙으로 해석합니다. SMIT에서는 Exclude Files 필드에서 Tab을 한 번 눌러 yes로 바꿉니다. 모든 파일은 .(현재 작업 디렉터리) 기준 상대 경로로 백업됩니다.
scratch디렉터리의 내용을 모두 빼려면/scratch/를 적습니다.- 경로에
/tmp가 든 다른 디렉터리는 빼지 않고/tmp의 내용만 빼려면^./tmp/를 적습니다. - 줄의 처음부터 일치해야 하면
^,., 이름 순으로 적고, 다른 이름의 일부이면^.로 처음을,$로 끝을 지정합니다.
영어 원문
-a— Does not back up extended attributes or NFS4 ACLs.-A— Backs up DMAPI file system files.-bBlocks — Specifies the number of 512-byte blocks to write in a single output operation. If this parameter is not specified, the backup command uses a default value appropriate for the physical device selected. Larger values result in larger physical transfers to tape devices. The value specified must be a multiple of the physical block size of the device being used.-e— Excludes files specified in the /etc/exclude.vgname file from being backed up by this command. Note: If you want to exclude certain files from the backup, create the /etc/exclude.rootvg file, with an ASCII editor, and enter the patterns of file names that you do not want included in your system backup image. The patterns in this file are input to the pattern matching conventions of the grep command to determine which files will be excluded from the backup. If you want to exclude files listed in the /etc/exclude.rootvg file, select the Exclude Files field and press the Tab key once to change the default value to yes. For example, to exclude all the contents of the directory called scratch, edit the exclude file to read as follows:/scratch/For example, to exclude the contents of the directory called /tmp, and avoid excluding any other directories that have /tmp in the pathname, edit the exclude file to read as follows:^./tmp/All files are backed up relative to . (current working directory). To exclude any file or directory for which it is important to have the search match the string at the beginning of the line, use ^ (caret character) as the first character in the search string, followed by . (dot character), followed by the filename or directory to be excluded. If the filename or directory being excluded is a substring of another filename or directory, use ^. (caret character followed by dot character) to indicate that the search should begin at the beginning of the line and/or use$(dollar sign character) to indicate that the search should end at the end of the line.-fDevice — Specifies the device or file name on which the image is to be stored. The default is the /dev/rmt0 device.-i— Creates the data file by calling the mkvgdata command.-m— Creates the data file with map files by calling the mkvgdata command with the-mflag.-p— Disables software packing of the files as they are backed up. Some tape drives use their own packing or compression algorithms.-r— Backs up user volume group information and administration data files. This backs up files such as /tmp/vgdata/vgname/vgname.data and map files if any exist. This does not back up user data files. This backup can be used to create a user volume group without restoring user data files. This cannot be done to rootvg.-v— Verbose mode. Lists files as they are backed up.-V— Verifies a tape backup. This flag causes savevg to verify the file header of each file on the backup tape and report any read errors as they occur.-X— Specifies to automatically expand the /tmp file system if necessary. The /tmp file system may need to be extended to make room for the boot image when creating a bootable backup to tape.-Z— Specifies that the Encrypted File System (EFS) information for all the files, directories, and file systems is not backed up. The flag runs the backup command without the-Zflag.
매개변수
| 매개변수 | 설명 |
|---|---|
| VGName | 백업할 볼륨 그룹 이름 |
영어 원문
- VGName — Specifies the name of the volume group to be backed up.
SMIT Fast Paths
| 빠른 경로 | 하는 일 |
|---|---|
smit lsmksysb |
savevg로 만든 루트 볼륨 그룹 백업의 내용 나열 |
smit lsbackvg |
savevg로 만든 사용자 볼륨 그룹 백업의 내용 나열 |
smit restmksysb |
루트 볼륨 그룹 백업에서 개별 파일 복원 |
smit restsavevg |
사용자 볼륨 그룹 백업에서 개별 파일 복원 |
영어 원문
- To list the contents of a root volume group backup that is created with the savevg command, enter the following SMIT fast path:
smit lsmksysb
- To list the contents of a user volume group backup that is created with the savevg command, enter the following SMIT fast path:
smit lsbackvg
- To restore individual files from a root volume group backup, enter the following SMIT fast path:
smit restmksysb
- To restore individual files from a user volume group backup, enter the following SMIT fast path:
smit restsavevg
예제
| 명령 | 하는 일 |
|---|---|
savevg -i -f/mysys/myvg/myroot rootvg |
rootvg(운영 체제 이미지)를 백업 파일 /mysys/myvg/myroot에 백업하고 /image.data를 만듦 |
savevg -i uservg |
uservg를 기본 테이프(/dev/rmt0)에 백업하고 새 uservg.data를 만듦 |
savevg -mf/dev/rmt1 data2 |
data2를 rmt1에 백업하고 맵 파일과 새 data2.data를 만듦 |
savevg -ief/dev/rmt1 data2 |
/etc/exclude.data2에 적힌 파일을 빼고 data2를 백업 |
savevg -f /dev/rmt0 -V my_vg |
my_vg를 /dev/rmt0 테이프에 백업하고 파일 머리글을 읽을 수 있는지 검증 |
savevg -i -f /dev/usbms0 |
UDFS 장치 /dev/usbms0에 uservg를 백업 |
자주 쓰는 형태:
savevg -i -X -f /backup/datavg.savevg datavg
listvgbackup -f /backup/datavg.savevg # 내용 확인
savevg -r -f /backup/datavg.struct datavg # 구조만
영어 원문
- To back up the root volume group (operating system image) to the /mysys/myvg/myroot backup file and create an /image.data file, enter:
savevg -i -f/mysys/myvg/myroot rootvg
- To back up the uservg volume group to the default tape drive (dev/rmt0) and create a new uservg.data file, enter:
savevg -i uservg
- To back up the data2 volume group and create map files along with a new data2.data file on rmt1 device, enter:
savevg -mf/dev/rmt1 data2
- To back up the data2 volume group, excluding the files listed in the /etc/exclude.data2 file, enter:
savevg -ief/dev/rmt1 data2
- To back up the volume group
my_vgto the tape in /dev/rmt0 and then verify the readability of file headers, enter:
savevg -f /dev/rmt0 -V my_vg
- To back up the uservg volume group to the UDFS capable device/dev/usbms0, enter the following command:
savevg -i -f /dev/usbms0
파일
| 파일 | 설명 |
|---|---|
/image.data |
볼륨 그룹이 rootvg일 때 씀 |
/tmp/vgdata/vgname/vgname.data |
볼륨 그룹이 rootvg가 아닐 때 씀(vgname은 볼륨 그룹 이름) |
영어 원문
- /image.data — Used when the volume group is rootvg.
- /tmp/vgdata/vgname /vgname.data — Used when the volume group is not rootvg and where vgname is the name of the volume group.
Related information:
- backup command
- bosboot command
- mkcd command
- mkszfile command
리눅스(GNU)와 다른 점
리눅스에는 mksysb처럼 부팅 가능한 시스템 이미지를 만드는 표준 명령이 없어 ReaR(Relax-and-Recover)나 Clonezilla 같은 도구를 쓰고, 볼륨 그룹 구조는 vgcfgbackup·vgcfgrestore로 저장·복원합니다. 파일 백업은 tar, rsync, ext 계열의 dump·restore, XFS의 xfsdump·xfsrestore를 씁니다. 백업 목록 보기는 tar -tvf, 일부 파일 복원은 tar -xvf 백업 경로입니다.