Red Hat Training

A Red Hat training course is available for RHEL 8

23.3. 테이프 장치 다시 사용하기 위한 쓰기

테이프 장치가 모든 작업 후에 다시 멈춘다. 데이터를 백업하려면 tar 명령을 사용할 수 있습니다. 기본적으로 테이프 장치에서 블록 크기는 10KB(bs=10k)입니다. export TAPE =/dev/st0 특성을 사용하여 TAPE 환경 변수를 설정할 수 있습니다. 대신 -f 장치 옵션을 사용하여 테이프 장치 파일을 지정합니다. 이 옵션은 두 개 이상의 테이프 장치를 사용할 때 유용합니다.

사전 요구 사항

  1. mt-st 패키지가 설치되어 있어야 합니다. 자세한 내용은 저하 드라이브 관리 도구 설치를 참조하십시오.For more information, see Installing tape drive management tool.
  2. 테이프 드라이브를 로드합니다.

    # mt -f /dev/st0 load

절차

  1. 테이프 헤드를 확인합니다.

    # mt -f /dev/st0 status
    
    SCSI 2 tape drive:
    File number=-1, block number=-1, partition=0.
    Tape block size 0 bytes. Density code 0x0 (default).
    Soft error count since last status=0
    General status bits on (50000):
     DR_OPEN IM_REP_EN

    여기:

    • 현재 파일 번호는 -1입니다.
    • 블록 번호는 테이프 헤드를 정의합니다. 기본적으로 -1로 설정됩니다.
    • 블록 크기 0은 테이프 장치에 고정 블록 크기가 없음을 나타냅니다.
    • 소프트 오류 수는 mt status 명령을 실행한 후 발생한 오류 수를 나타냅니다.
    • 일반 상태 비트는 테이프 장치의 통계를 설명합니다.
    • DR_OPEN 은 문이 열리고 테이프 장치가 비어 있음을 나타냅니다. IM_REP_EN 은 즉시 보고 모드입니다.
  2. 테이프 장치가 비어 있지 않으면 덮어씁니다.If the tape device is not empty, overwrite it:

    # tar -czf /dev/st0 _/source/directory

    이 명령은 테이프 장치의 데이터를 /source/directory 의 콘텐츠로 덮어씁니다.

  3. /source/directory 를 테이프 장치로 백업합니다.

    # tar -czf /dev/st0 _/source/directory
    tar: Removing leading `/' from member names
    /source/directory
    /source/directory/man_db.conf
    /source/directory/DIR_COLORS
    /source/directory/rsyslog.conf
    [...]
  4. 테이프 장치의 상태를 확인합니다.

    # mt -f /dev/st0  status

검증 단계

  • 테이프 장치의 모든 파일 목록을 확인합니다.

    # tar -tzf /dev/st0
    /source/directory/
    /source/directory/man_db.conf
    /source/directory/DIR_COLORS
    /source/directory/rsyslog.conf
    [...]