DAT 를이용한 backup 2016. 03 - C&Thoth H/W Team -
목차 1. DAT의정의와종류 1) DAT의정의 2) DAT의종류 2. DAT backup (ufsdaump / ufsrestore) 1) mt 명령어확인 2) Restore 명령어확인 3) Ufsrestore 명령을이용한 backup 4) TAPE 에서 Ufsrestore 로백업한내용확인 5) TAPE 에서 backup 한내용을특정폴더로 restore 3. DAT backup (tar / restore) 1) tar 명령을이용한 backup 2) backup 한 Tape 내용확인 3) TAPE에서파일시스템내용 backup 받기 4. TAPE 내용중특정파일만 restore 5. TAPE 내용삭제및 TAPE 빼기 1) TAPE 내용삭제 2) TAPE 빼기
1. DAT 의정의와종류 1) DAT 의정의 DDS 는소니와 HP 가공동으로발표한백업장치기술로서백업매체는 DAT(Digital Audio Tape) 를사용한다. DDS(Digital Data Storage) 백업장치기술은특이하게 DDS 드라이브에관련된사항은 HP 에서관리하며 DAT 테이프에관련된사항은소니가관리한다. 2) DAT 의종류 DDS 백업장치종류이다. ( ) 안에명시한내용은 2:1 의압축을사용한경우이다. 기술최대저장용량초당전송속도 DDS1 1.3GB (2.6GB) 183kb(366kb) DDS-DC 2GB (4GB) 183kb(366kb) DDS-2 4GB (8GB) 750kb(1.5MB) DDS-3 12GB (24GB) 1.5MB(3MB) DDS-4 20GB (40GB) 3MB(6MB) DDS-5 40GB (80GB) 6MB(12MB) 2. DAT backup (ufsdump / ufsrestore) 1) mt 명령어확인 # mt -f /dev/rmt/0 stat <- mt 상태확인 (backup 을받은경우 ) HP DDS-4 DAT (Sun) tape drive: sense key(0x0)= No Additional Sense residual= 0 retries= 0 file no= 1 block no= 0 <- file 1 번에위치해있다. # mt rewind <- 맨처음으로되돌린다. # mt stat HP DDS-4 DAT (Sun) tape drive: sense key(0x6)= Unit Attention residual= 0 retries= 0 file no= 0 block no= 0 <- 파일위치 0 처음으로되감긴상태 # mt fsf (1) <- 앞으로감는다. () 의숫자까지감는다.(bsf는 back) 2) Restore 명령어확인 Ufsrestore 옵션 t : 백업의목록테이블출력 x : 명령어라인에명명된파일만출력 r : 모든백업을 restore 함 a : archive_file tape 보다 archive 파일로명명된것으로부터의정보테이블을가진다. f dump_file : restore 할디바이스로덤프파일을사용 v : restore 되는것들의패스명을출력
3) Ufsrestore 명령을이용한 backup # mkdir /opttest <- /opt 파일을 copy 한후 /opttest 에옮긴다. # cp -r /opt /opttest # cd /opttest # ufsdump 0uf /dev/rmt/0n. <- /opttest 파일을 tape 에 backup 한다. /dev/rmt/0 로명령어를줄수도있지만 ufsdump 는 [n] 옵션을주지않을경우자동으로 rewind 하게된다. 만일작은용량의데이터를연속해서백업받는경우라면반드시 [n] 옵션을주어야한다. DUMP: Date of this level 0 dump: Sun Jun 29 18:15:07 2008 DUMP: Date of last level 0 dump: the epoch DUMP: Dumping /dev/md/rdsk/d0 to /dev/rmt/0n. DUMP: Mapping (Pass I) [regular files] DUMP: Mapping (Pass II) [directories] DUMP: Estimated 8545926 blocks (4172.82MB). DUMP: Dumping (Pass III) [directories] DUMP: Dumping (Pass IV) [regular files] DUMP: 61.44% done, finished in 0:06 DUMP: DUMP IS DONE 4) TAPE 에서 Ufsrestore 로백업한내용확인 # ufsrestore tvf /dev/rmt/0 more Verify volume and initialize maps Media block size is 64 Extract directories from tape Initialize symbol table. Dump date: Sun Jun 29 18:15:07 2008 Dumped from: the epoch Level 0 dump of an unlisted file system on iwtweb:. Label: none dir 2. dir 279779./opttest dir 279792./opttest/opt/SUNWmlib dir 279794./opttest/opt/SUNWmlib/example dir 279796./opttest/opt/SUNWmlib/example/algebra leaf 279798./opttest/opt/SUNWmlib/example/algebra/Makefile.a1 5) TAPE 에서 backup 한내용을특정폴더로 restore # rm -r /optest <- 기존가지고있는내용을지운다 # mkdir /opttest # cd /opttest # ufsrestore -rvf /dev/rmt/0n <- /opttest 로 restore Verify volume and initialize maps Media block size is 64 Dump date: Sun Jun 29 18:15:07 2008 Dumped from: the epoch Level 0 dump of an unlisted file system on iwtweb:.
Label: none Extract directories from tape Initialize symbol table. Warning:./opttest: File exists Make node./opttest/opt Make node./opttest/opt/sunwits Make node./opttest/opt/mysql/mysql/tests Extract requested files You have not read any volumes yet. Unless you know which volume your file(s) are on you should start with the last volume and work towards the first. Specify next volume #: 1 extract file./opttest/opt/sunwits/graphics-sw/xil/lib/libxil.so extract file./opttest/opt/sunwits/graphics-sw/xil/lib/libxil.so.1 extract file./opttest/opt/mysql/mysql/tests/pmail.pl extract file./opttest/opt/mysql/mysql/tests/table_types.pl extract file./opttest/opt/mysql/mysql/tests/test_delayed_insert.pl Add links Set directory mode, owner, and times. set owner/mode for '.'? [yn] y Directories already exist, set modes anyway? [yn] y 3. DAT backup (tar / restore) 1) tar 명령을이용한 backup # mkdir exportest # cp -r /export /exporttest # cd /exporttest # tar cvf /dev/rmt/0n. <- tar 명령을이용하여 backup a./config/jumpstart_sample/x86-begin.conf/owconfig 1 tape blocks a./config/jumpstart_sample/x86-class 1 tape blocks a./config/sysidcfg 1 tape blocks a./config/happy-class 1 tape blocks a./config/rules 1 tape blocks a./config/begin1 1 tape blocks a./config/finish1 1 tape blocks a./config/check 118 tape blocks a./config/rules.org 1 tape blocks 2) backup 한 Tape 내용확인 # tar tvf /dev/rmt/0 drwxr-xr-x 0/0 0 Jun 29 21:39 2008./ -rwxr-xr-x 0/0 17375 Jun 29 21:39 2008./analyze_patches drwxr-xr-x 0/0 0 Jun 29 21:39 2008./database/ drwxr-xr-x 0/0 0 Jun 29 21:39 2008./jumpstart_sample/
-rw-r--r-- 0/0 182 Jun 29 21:39 2008./jumpstart_sample/any_machine -rwxr-xr-x 0/0 59946 Jun 29 21:39 2008./jumpstart_sample/check -rw-r--r-- 0/0 243 Jun 29 21:39 2008./jumpstart_sample/host_class -rw-r--r-- 0/0 227 Jun 29 21:39 2008./jumpstart_sample/net924_sun4c -rw-r--r-- 0/0 4738 Jun 29 21:39 2008./jumpstart_sample/rules -rw-r--r-- 0/0 24 Jun 29 21:39 2008./jumpstart_sample/upgrade -rw-r--r-- 0/0 685 Jun 29 21:39 2008./jumpstart_sample/x86-begin drwxr-xr-x 0/0 0 Jun 29 21:39 2008./jumpstart_sample/x86-begin.conf/ 3) TAPE 에서파일시스템내용 backup 받기 # cd /test # tar xvf /dev/rmt/0. <- TAPE 에있는내용을 /test 에 restore 한다. x., 0 bytes, 0 tape blocks x./analyze_patches, 17375 bytes, 34 tape blocks x./database, 0 bytes, 0 tape blocks x./jumpstart_sample, 0 bytes, 0 tape blocks x./jumpstart_sample/any_machine, 182 bytes, 1 tape blocks x./jumpstart_sample/check, 59946 bytes, 118 tape blocks x./jumpstart_sample/x86-begin.conf, 0 bytes, 0 tape blocks x./jumpstart_sample/x86-begin.conf/msm.conf, 102 bytes, 1 tape blocks x./begin1, 58 bytes, 1 tape blocks x./finish1, 156 bytes, 1 tape blocks x./check, 59946 bytes, 118 tape blocks x./rules.org, 60 bytes, 1 tape blocks 4. TAPE 내용중특정파일만 restore # ufsrestore ivf /dev/rmt/0 <-TAPE 의내용을확인 Verify volume and initialize maps Media block size is 64 Dump date: Wed Jul 02 16:56:23 2008 Dumped from: the epoch Level 0 dump of an unlisted file system on iwtweb:. Label: none Extract directories from tape Initialize symbol table. ufsrestore > ls.: 2 *./ 2 *../ 279858 iwsc/ ufsrestore > cd iwsc ufsrestore > ls./iwsc: 279858./ 279860 iwsc1 279864 iwsc3 279868 iwsc5 2 *../ 279862 iwsc2 279866 iwsc4 ufsrestore > help Available commands are: ls [arg] - list directory <- 사용할수있는명령확인
marked [arg] - list items marked for extraction from directory cd arg - change directory pwd - print current directory add [arg] - add `arg' to list of files to be extracted delete [arg] - delete `arg' from list of files to be extracted extract - extract requested files setmodes - set modes of requested directories quit - immediately exit program what - list dump header information verbose - toggle verbose flag (useful with ``ls'') paginate - toggle pagination flag (affects ``ls'' and ``marked'') setpager - set pagination command and arguments help or `?' - print this list If no `arg' is supplied, the current directory is used ufsrestore > ls./iwsc: 279858./ 279860 iwsc1 279864 iwsc3 279868 iwsc5 2 *../ 279862 iwsc2 279866 iwsc4 ufsrestore > verbose verbose mode off ufsrestore > verbose <-진행하는과정을자세하게볼려고할때 verbose mode on./iwsc: 279858./ 279860 iwsc1 279864 iwsc3 279868 iwsc5 2 *../ 279862 iwsc2 279866 iwsc4 ufsrestore > what <- back 받은파일정보 Dump date: Wed Jul 02 16:56:23 2008 Dumped from: the epoch Level 0 dump of an unlisted file system on iwtweb:. Label: none ufsrestore > add iwsc1 <- restore 할려는파일을선택한다. Make node./iwsc ufsrestore > ls./iwsc: 279858 *./ 279860 *iwsc1 279864 iwsc3 279868 iwsc5 2 *../ 279862 iwsc2 279866 iwsc4 ufsrestore > add iwsc2 ufsrestore > add iwsc3 ufsrestore > add iwsc4 ufsrestore > extract <- 선택한파일을 restore한다. Extract requested files You have not read any volumes yet. Unless you know which volume your file(s) are on you should start with the last volume and work towards the first. Specify next volume #: 1 extract file./iwsc/iwsc1 extract file./iwsc/iwsc2 extract file./iwsc/iwsc3 extract file./iwsc/iwsc4 Add links
Set directory mode, owner, and times. set owner/mode for '.'? [yn] y ufsrestore > quit # cd iwsc # ls iwsc1 iwsc2 iwsc3 iwsc4 5. TAPE 내용삭제및 TAPE 빼기 1) TAPE 내용삭제 # mt -f /dev/rmt/0 retension 테이프를앞으로감았다가뒤로완전히되감아서테이프를부드럽게해주는것처음테이프를백업받기전에해두는것이좋다. # mt -f /dev/rmt/0 erase <- tape 안의내용을지운다. 2) TAPE 빼기 # mt -f /dev/rmt/0 offline <- TAPE 를뺀다