Linux OS Backup 교육 자료 V1.1

Linux OS Backup 교육 자료 V1.1

Linux OS Backup 교육 자료 v1.1 2013. 12. 27. 이스턴네트웍스 기술지원팀 전흥수 목 차 1. Linux OS Backup & Cloning Layout 2. Solution Install & Configuration 3. Recovery Procedure 4. Reference Site - 1 - 1. Linux OS Backup / Cloning Layout 1) 테스트 환경 H/W S/W CPU Disk ODD TAPE OS Arch tool 구 분 ARCHIVE 외장 USB Intel CPU Python CentOS Mondorescue 36GB x 3 DS8A8SH X86_64 3.20GHz 06408-XXX 6.4 ( www.mondorescue.org/ ) ( DVD Writer) ( DDS4 ) - 2 - 1. Linux OS Backup / Cloning Layout 2) 목적 Linux OS 백업시 File Base 의 백업솔루션이 가지고 있는 한계를 극복하기 위한 솔루션 필요. Ex 1) RHEL 6.4 / RHCS / Oracle Client / Netbackup / SecureOS / Control-M / T-max (was) -> OS 의 버그, H/W 문제점 등으로 인해 문제발생시 재설치 필요. -> RHEL OS 설치+RHCS 재구성 / 기타 S/W 설치시 파트별 엔지니어 필요. ( 시간 / 인력비용 / 결과적 손해 ) Ex 2) Clonezilla / Ghost / DD 등 Live CD 를 이용한 솔루션 -> Clone Image 를 생성할때마다 시스템의 Reboot 이 필요. -> Down Time 이 허용되지 않는 경우 File Base 의 백업은 가능하나 device , driver 등의 OS 구성을 포함한 Image Backup은 매우 곤란함 - 3 - 1. Linux OS Backup / Cloning Layout 3) Solution ( Mondorescue ) ◐ Online Backup ( DR ) DAT / VTL ( tape device ) ◐ 다양한 백업디바이스 지원 ◐ GUI / CLI 지원 ( script 사용 가능 ) CD / DVD Writer HDD / USB RHEL / Ubuntu / Fedora / SuSe NAS ( NFS / CIFS / SSHFS ) - 4 - 2. Solution Install & Configuration 1) 설치하기 ① 레포지토리 설정파일 #/etc/yum.repos.d/mondorescue.repo [mondorescue] name=rhel 6 x86_64 - mondorescue Vanilla Packages baseurl=ftp://ftp.mondorescue.org/rhel/6/x86_64 enabled=1 gpgcheck=0 gpgkey=ftp://ftp.mondorescue.org/rhel/6/x86_64/mondorescue.pubkey ② yum 을 이용한 설치 #yum install mondo ③ rpm 을 이용한 설치 ( 아래의 URL 에서 rpmfile download ) http://www.mondorescue.org/downloads.shtml - 5 - 2. Solution Install & Configuration 2) 스크립트 2-1 백업 스크립트 ( ISO 이미지를 이용한 백업 스크립트 ) # cat /usr/local/sbin/mondobackup.sh #!/bin/sh DATE=`date +%Y%m%d` BACKUPDIR="/backup" mount /dev/sdb1 /backup wait mkdir -p $BACKUPDIR/$DATE mondoarchive -Oi -s 4880m -d $BACKUPDIR/$DATE -E '/mnt|/backup' -p "`date +%Y%m%d`-os-backup" wait cp /var/cache/mindi/mondorescue.iso $BACKUPDIR/$DATE/os-restore-boot-cd.iso wait sync umount /backup exit 0 - 6 - 2. Solution Install & Configuration 2) 스크립트 2-2 백업 스크립트 ( tape 를 이용한 백업 스크립트 ) #cat /usr/local/sbin/mondo_tape_bk.sh #!/bin/sh mt –f /dev/st0 rewind wait /usr/sbin/mondoarchive -Ot -d /dev/st0 -K 99 -E '/backup' -p "tapebackup“ wait exit 0 2-3 백업 스크립트 ( NAS 를 이용한 백업 스크립트 ) #!/bin/sh /usr/sbin/mondoarchive -On nfs://192.168.1.133:/nas -d /os-backup exit 0 - 7 - 2. Solution Install & Configuration 2) 스크립트 ( cron ) ① cron 설정파일 # cat /etc/cron.daily/os_backup.sh #!/bin/sh /usr/bin/rdate -s time.bora.net wait /usr/local/sbin/mondobackup.sh & exit 0 - 8 - 2. Solution Install & Configuration 3) Mondoarchive options ※ Mondoarchive options -O 파일시스템을 CD,tape,ISO image,NFS등으로 백업. 부트가능한 시디나 플로피가 만들어짐. -i 백업미디어로 ISO파일(시디이미지)를 사용 -L bzip2대신 lzo를 사용 ( 가급적 사용하지 말 것. ) -d dev/dir 백업 디바이스나 디렉토리를 지정 -E "path path ..." 백업에서 제외할 패스를 기록 -l GRUB/LILO 부트로더 지정 -f device 디바이스마스터부트레코드가 있는 드라이브를 지정 -s size 백업미디어의 용량을 지정 -F 3.5인치플로피에 boot+data 쓰지 않도록 지정 -p 백업이미지의 이름을 지정할 수 있다. -T temp 디렉토리 지정 ( 서버운용중인 Disk 외의 디스크에 지정가능 ) -S scratch 디렉토리 지정 ( 백업이미지 파일을 임시로 모아놓는 디렉토리 지정 ) - 9 - 3. Recovery Procedure 1) linux base boot cd buning CLI 1. wodim 패키지 설치 #yum install wodim 2. cdrom 디바이스 찾기 #wodim --devices wodim: Overview of accessible drives (1 found) : ------------------------------------------------------------------------- 0 dev='/dev/scd0' rwrw-- : 'Slimtype' 'DVD A DS8A8SH' ------------------------------------------------------------------------- 3. os-boot-backup CD 제작 #wodim -v dev=/dev/scd0 speed=4 -eject /path/to/mondorescue.iso. - 10 - 3. Recovery Procedure 2) Restore Screen Mondorescue.iso 를 cd writer 를 이용하여 cd 로 제작한 후 서버에서 cd boot 를 하고, 아래의 화면에서 nuke 입력 - 11 - 3. Recovery Procedure 3) Recovery Trouble shooting ① Mondo rescue 를 이용할 경우, /etc/fstab 파일을 기준으로 백업을 실행하므로 백업 대상 디렉토리는 반드시 /etc/fstab 에 등록이 되어 있어야 한다. Ex) /dev/sdb1 /data …… /dev/sdb1 /data ext4 defaults 0 0 …… ② swap 은 별도로 백업되지 않으므로 복구과정이 끝나고 나면, 반드시 rescue mode 로 진입하여 swap 을 생성해준다. boot : linux text rescue #chroot /mnt/sysimage #lvcreate –l 100%FREE –n /dev/Volgroup/lv_swap #mkswap –f /dev/Volgroup/lv_swap #ext #reboot - 12 - 4. Reference Site http://www.mondorescue.org/ http://en.wikipedia.org/wiki/Comparison_of_disk_cloning_software http://www.tecmint.com/how-to-clone-linux-systems/ http://comptia.idglabs.net/?p=4079 - 13 - Q & A 감사합니다. - 14 - .

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    15 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us