lsmksysb 명령어 (AIX 5.3·6.1)

핵심 정리

  • 볼륨 그룹 백업(테이프, 파일, CD 등)의 내용을 나열하거나 파일을 복원합니다. 여러 CD·DVD·USB·테이프에 걸친 백업도 됩니다.
  • lsmksysb -lf /backup/hostA.mksysb는 백업 정보(볼륨 그룹, 날짜, uname, oslevel, 크기, LV 목록)를, -L은 백업에 든 파일셋(lslpp -l과 같음)을 보여 줍니다.
  • 파일 목록은 lsmksysb -f 파일, 파일 복원은 lsmksysb -f 파일 -r -d /tmp/restore ./etc/filesystems처럼 ./로 시작하는 상대 경로로 줍니다. 루트로 바로 복원하지 말고 임시 디렉터리를 씁니다.
  • rootvg가 아닌 savevg 백업은 -s를 붙입니다. lsmksysb -r과 restorevgfiles는 같은 일을 합니다.
  • lsmksysb -B는 볼륨 그룹 백업 기록(약 256건)을 보여 줍니다.
항목 내용
버전 AIX 5.3, AIX 6.1 (두 버전의 내용이 같음)
원문 IBM Commands Reference — 5.3 Volume 3, 6.1 Volume 3
파일 /usr/bin/lsmksysb, /var/adm/ras/vgbackuplog
관련 명령어 mksysb, savevg, restorevgfiles, listvgbackup, restore

목적

지정한 매체에 있는 볼륨 그룹 백업의 내용을 나열하거나 복원합니다.

영어 원문

Lists or restores the contents of a volume group backup on a specified media.

구문

text
lsmksysb [ -b blocks ] [ -f device ] [ -a ] [ -c ] [ -l ] [ -n ] [ -r ] [ -s ] [ -d path ] [ -B ] [ -D ] [ -L ] [ -V ] [ file_list ]

설명

lsmksysb 명령은 테이프, 파일, CD-ROM 같은 곳에 있는 볼륨 그룹 백업의 내용을 나열하며, 올바른 백업에서 파일을 복원하는 데도 씁니다. 여러 CD, DVD, USB 디스크, 테이프에 걸친 다중 볼륨 백업에도 씁니다.

lsmksysb -r과 restorevgfiles 명령은 같은 작업을 하므로 서로 바꿔 써도 됩니다.

영어 원문

The lsmksysb command lists the contents of a volume group backup from tape, file, CD-ROM, or other source and can be used to restore files from a valid backup source. The lsmksysb command also works for multi-volume backups such as multiple CDs, DVDs, USB disks, or tapes.

The lsmksysb -r and restorevgfiles commands perform identical operations and must be considered interchangeable.

플래그

플래그 설명
-a -b로 지정한 테이프 백업의 물리 블록 크기를 검증합니다. 백업을 읽으려면 블록 크기를 바꿔야 할 수 있습니다. 테이프 백업에만 씁니다.
-b blocks 한 번에 읽을 512바이트 블록 수. 기본 100.
-B 볼륨 그룹 백업 기록을 표준 출력으로 보여 줍니다. 최근 약 256건이며, alog 형식으로 /var/adm/ras/vgbackuplog에 있습니다. 각 줄은 세미콜론으로 구분한 파일·장치 이름, 백업에 쓴 명령, 날짜, 축소 크기, 전체 크기, 권장 유지 보수·기술 수준(있으면)입니다. 축소 크기는 모든 파일 시스템의 데이터 크기, 전체 크기는 각 파일 시스템의 전체 크기(빈 공간 + 데이터)입니다.
-c 콜론으로 구분해 출력합니다. -l, -L과 함께만 씁니다.
-d path 파일을 복원할 디렉터리. 없으면 현재 작업 디렉터리에 복원하며, 현재 디렉터리가 루트면 문제가 될 수 있으므로 임시 디렉터리를 쓰는 것이 좋습니다.
-D 디버그 출력을 냅니다.
-f device 백업이 있는 장치(파일, 테이프, CD-ROM 등). 기본 /dev/rmt0.
-l 볼륨 그룹 백업의 유용한 정보를 보여 줍니다. -f가 필요합니다. 볼륨 그룹, 백업 날짜와 시각, 백업한 시스템의 uname 출력, oslevel, 권장 유지 보수·기술 수준, 백업 크기(MB), 축소 크기(MB)와 백업한 볼륨 그룹의 LV·파일 시스템 정보(lsvg -l vgname과 같음)를 보여 줍니다.
-L mksysb 백업의 파일셋 정보만 보여 줍니다. -f가 필요하며, 백업한 시스템에서 lslpp -l을 실행한 것과 같은 정보입니다. mksysb가 아닌 볼륨 그룹 백업에는 출력이 없습니다.
-n ACL, PCL, 확장 속성을 복원하지 않습니다.
-r file_list에 지정한 파일을 복원합니다. file_list가 없으면 백업의 모든 파일을 복원합니다. -r이 없으면 파일 목록만 보여 줍니다.
-s 백업이 rootvg가 아닌 사용자 볼륨 그룹임을 지정합니다.
-V 테이프 백업을 검증합니다. -f가 필요하고 테이프에만 씁니다. 각 파일 머리글을 읽을 수 있는지 확인하고 오류를 표준 오류로 보여 줍니다.
영어 원문
  • -a — Verifies the physical block size of the tape backup, as specified by the -b block flag. You might need to alter the block size if necessary to read the backup. The -a flag is valid only when a tape backup is used.
  • -b blocks — Specifies the number of 512-byte blocks to read in a single input operation, as defined by the blocks parameter. If the blocks parameter is not specified, the number of blocks read defaults to 100.
  • -B — Prints the volume group backup log to stdout. This flag displays the past 256 backups (roughly). The log is in alog format and is kept in /var/adm/ras/vgbackuplog. Each line of the log is a semicolon-separated list of the file or device name, the command that is used to make backup, date, shrink size, full size of the backup, and recommended maintenance or technology level (if any). Note: The shrink size is the size of the data on all file systems. The full size is total size of each file system (unused + data).
  • -c — Produces colon-separated output. This flag works only with the -l and -L flags.
  • -d path — Specifies the directory path to which the files are restored, as defined by the path parameter. If the -d parameter is not used, the current working directory is used. This can be a problem if the current working directory is root. We recommend writing to a temporary folder instead of to root.
  • -D — Produces debug output.
  • -f device — Specifies the type of device containing the backup (file, tape, CD-ROM, or other source) as defined by the device parameter. When -f is not specified, device defaults to /dev/rmt0.
  • -l — Displays useful information about a volume group backup. This flag requires the -f device flag. This flag causes lsmksysb to display information such as volume group, date and time backup was made, uname output from backed up system, oslevel, recommended maintenance or technology level, backup size in megabytes, and backup shrink size in megabytes. The shrink size is the size of the data on all file systems. The full size is the total size of each file system (unused + data). The -l flag also displays the logical volume and file system information of the backed up volume group, equivalent to running "lsvg -l vgname".
  • -L — Displays lpp fileset information about a mksysb backup only. This flag requires the -f device flag and displays the equivalent information to that produced by invoking "lslpp -l" on the running backed up system. This flag does not produce output about any volume group backup other than that produced by mksysb.
  • -n — Does not restore ACLs, PCLs, or extended attributes
  • -r — Specifies to restore the backup files, as defined by the file-list parameter. If the file-list parameter is not specified, then all files in the backup are restored. If the -r flag is not used, then executing the lsmksysb command lists only the files in the specified backup.
  • -s — Specifies that the backup source is a user volume group and not rootvg.
  • -V — Verifies a tape backup. This flag requires the -f device flag and works for tape devices only. The -V flag causes lsmksysb to verify the readability of the header of each file on the volume group backup and print any errors that occur to stderr.

매개변수

매개변수 설명
file_list 복원할 파일 목록. -r과 함께만 씁니다. 현재 디렉터리 기준 전체 경로를 공백으로 구분해 적습니다. 디렉터리를 주면 그 안의 파일을 모두 복원하며, 이때는 루트 대신 임시 디렉터리에 쓰는 것이 좋습니다.
영어 원문
  • file_list — Identifies the list of files to be restored. This parameter is used only when the -r flag is specified. The full path of the files relative to the current directory must be specified in the space-separated list. All files in the specified directory are restored unless otherwise directed. If you are restoring all files in a directory, we recommend writing to a temporary folder instead of to root.

예제

명령 하는 일
lsmksysb 기본 장치 /dev/rmt0의 시스템 백업 내용 나열
lsmksysb -f /dev/cd1 /dev/cd1의 시스템 백업 내용 나열
lsmksysb -f /dev/cd1 -s /dev/cd1의 rootvg가 아닌 사용자 볼륨 그룹 백업 내용 나열
lsmksysb -f /dev/cd1 -r ./etc/filesystems /dev/cd1의 백업에서 /etc/filesystems를 복원
lsmksysb -f /dev/cd1 -r -s -d /data/myfiles ./myfs/test /dev/cd1의 rootvg가 아닌 백업에서 /myfs/test 디렉터리의 파일을 모두 /data/myfiles에 복원
lsmksysb -Lc -f /dev/rmt0 /dev/rmt0 mksysb 테이프의 파일셋 정보를 콜론으로 구분해 보여 줌
lsmksysb -B 볼륨 그룹 백업 기록을 보여 줌
lsmksysb -l -f /tmp/mybackup /tmp/mybackup 백업의 볼륨 그룹과 일반 백업 정보
lsmksysb -V -f /dev/rmt0 /dev/rmt0 볼륨 그룹 백업 테이프의 각 머리글을 읽을 수 있는지 검증
lsmksysb -f /dev/usbms0 /dev/usbms0의 시스템 백업 내용 나열

자주 쓰는 형태:

bash
lsmksysb -lf /backup/hostA.mksysb
lsmksysb -f /backup/hostA.mksysb | grep etc/hosts
mkdir /tmp/rst; lsmksysb -f /backup/hostA.mksysb -r -d /tmp/rst ./etc/hosts
영어 원문
  1. To list the contents of the system backup that is on the default device /dev/rmt0, enter the following command:
lsmksysb
  1. To list the contents of the system backup that is on device /dev/cd1, enter the following command:
lsmksysb -f /dev/cd1
  1. To list the contents of the system backup that is on device /dev/cd1, which is a user volume group that is not rootvg, enter the following command:
lsmksysb -f /dev/cd1 -s
  1. To restore /etc/filesystems from the system backup that is on device /dev/cd1, enter the following command:
lsmksysb -f /dev/cd1 -r ./etc/filesystems
  1. To restore all files in the /myfs/test directory of the non-rootvg backup, which is on device /dev/cd1, and write the restored files to /data/myfiles, enter the following command:
lsmksysb -f /dev/cd1 -r -s -d /data/myfiles ./myfs/test
  1. To display colon separated lpp information about a mksysb backup tape that is on /dev/rmt0, enter the following command:
lsmksysb -Lc -f /dev/rmt0
  1. To display the backup log of the volume group to stdout, enter the following command:
lsmksysb -B
  1. To list volume group and general backup data about a backup that is on /tmp/mybackup, enter the following command:
lsmksysb -l -f /tmp/mybackup
  1. To verify the readability of each header on a volume group backup tape in /dev/rmt0, enter the following command:
lsmksysb -V -f /dev/rmt0
  1. To list the contents of the system backup that is on device /dev/usbms0, enter the following command:
lsmksysb -f /dev/usbms0

파일

파일 설명
/usr/bin/lsmksysb lsmksysb 명령
영어 원문
  • /usr/bin/lsmksysb — Contains the lsmksysb command

Related information:

  • restorevgfiles command

리눅스(GNU)와 다른 점

리눅스에는 mksysb처럼 부팅 가능한 시스템 이미지를 만드는 표준 명령이 없어 ReaR(Relax-and-Recover)나 Clonezilla 같은 도구를 쓰고, 볼륨 그룹 구조는 vgcfgbackup·vgcfgrestore로 저장·복원합니다. 파일 백업은 tar, rsync, ext 계열의 dump·restore, XFS의 xfsdump·xfsrestore를 씁니다. 백업 목록 보기는 tar -tvf, 일부 파일 복원은 tar -xvf 백업 경로입니다.