Outline (Day 1) Time: 09:30 16:30 Clonezilla 簡介 / 備份原理 Clonezilla 系統流程架構 / 映像檔介紹 Clonezilla unicast, multicast, broadcast clone 介紹與 注意事項 實務探討 硬碟 / 磁區差

Similar documents
Outline (Day 1) Time: 09:30 ~ 16:30 Clonezilla 簡介 / 備份原理 Clonezilla 系統流程架構 / 映像檔介紹 Clonezilla unicast, multicast, broadcast clone 介紹與注意事項 Clonezilla O

Outline (Day 1) Time: 09:30 ~ 16:30 Clonezilla 簡介 / 備份原理 Clonezilla 系統流程架構 / 映像檔介紹 Clonezilla unicast, multicast, broadcast clone 介紹與注意事項 Clonezilla O

DRBL/Clonezilla 進階課程 蕭志榥孫振凱 國家高速網路與計算中心 N

彰化縣教育網路中心 Clonezilla 再生龍實務課程 孫振凱 國家高速網路與計算中心

Clonezilla 研習課程 基隆市網中心 孫振凱 國家高速網路與計算中心 National Center f

自由軟體社群發展經驗與 Linux認證介紹

Free Software Lab, NCHC, Taiwan 2 Polling 是電腦教室或網路管理員? 曾經使用 Linux 經驗? 桌面使用? 伺服器使用? 曾經使用過無碟系統? 曾經安裝 使用 DRBL? 曾經使用過硬碟備份工具? 曾經安裝使用 Clonezilla SE? Clonezi

Free Software Lab, NCHC, Taiwan 2 Polling 是電腦教室或網路管理員? 曾經使用 Linux 經驗? 桌面使用? 伺服器使用? 曾經使用過無碟系統? 曾經安裝 使用 DRBL? 曾經使用過硬碟備份工具? 曾經安裝使用 Clonezilla SE? Clonezi

Polling 是電腦教室或網路管理員 曾經使用 Linux 經驗 桌面使用 伺服器使用 曾經使用過無碟系統 曾經安裝 使用 DRBL? 曾經使用過硬碟備份工具 曾經安裝使用 Clonezilla SE? Clonezilla Live? 2

2 Polling 是電腦教室或網路管理員? 曾經使用 Linux 經驗? 桌面使用? 伺服器使用? 曾經使用過無碟系統? 曾經安裝 使用 DRBL? 曾經使用過硬碟備份工具? 曾經安裝使用 Clonezilla SE? Clonezilla Live?

自由軟體教學平台

Windows 2000 Server for T100

Red Flag Linux Desktop 4.0 Red Flag Linux Desktop 4.0 1

DRBL/Clonezilla 實務與應用 孫振凱 國家高速網路與計算中心 Nation

ebook140-9

ebook140-8

Acronis True Image 2014

untitled

Microsoft Word - PS2_linux_guide_cn.doc

TPM BIOS Infineon TPM Smart TPM Infineon TPM Smart TPM TPM Smart TPM TPM Advanced Mode...8

Abstract arm linux tool-chain root NET-Start! 2

DRBL/Clonezilla 研習課程 蕭志榥 孫振凱 國家高速網路與計算中心 Nat

AL-M200 Series

Guide to Install SATA Hard Disks

RAID RAID 0 RAID 1 RAID 5 RAID * ( -1)* ( /2)* No Yes Yes Yes A. B. BIOS SATA C. RAID BIOS RAID ( ) D. SATA RAID/AHCI ( ) SATA M.2 SSD ( )

目 录 Linux Mint 简介... 3 Linux Mint 安装... 6 Linux Mint 桌面初识 软件管理...30 小技巧...40 总结...42

Acronis True Image 2015

HP StorageWorks Automated Storage Manager 用户指南

Ác Åé å Serial ATA ( Sil3132) S A T A (1) SATA (2) BIOS SATA (3)* RAID BIOS RAID (4) SATA (5) SATA (a) S A T A ( S A T A R A I D ) (b) (c) Windows XP

Symantec™ Sygate Enterprise Protection 防护代理安装使用指南

1 SQL Server 2005 SQL Server Microsoft Windows Server 2003NTFS NTFS SQL Server 2000 Randy Dyess DBA SQL Server SQL Server DBA SQL Server SQL Se

1 IT IT IT IT Virtual Machine, VM VM VM VM Operating Systems, OS IT

IP505SM_manual_cn.doc

Desktop Management Guide

IC-900W Wireless Pan & Tilt Wireless Pan & Tilt Remote Control / Night Vision FCC ID:RUJ-LR802UWG

ATI-2019安裝手冊-v

epub 61-2

K7VT2_QIG_v3

Norton Ghost 15.0 安裝操作指南

RAID RAID 0 RAID 1 RAID 5 RAID * (-1)* (/ 2)* No Yes Yes Yes SATA A. B. BIOS SATA C. RAID BIOS RAID ( ) D. RAID/AHCI ( ) S ATA S S D ( ) (

基隆市教網中心 Clonezilla SE 研習課程 孫振凱 國家高速網路與計算中


(Load Project) (Save Project) (OffLine Mode) (Help) Intel Hex Motor

audiogram3 Owners Manual

CH01.indd

BYOD IP+Optical (IP NGN) API 4. End-to-End (Service Aware) 5. IP NGN (IP Next Generation Network) ( ) Prime Carrier Management Access Edge Co

Acronis P.1 Acronis Anydata Engine P.2 P.4 Acronis Backup Advanced P.5 Acronis Backup Advanced for AP P.6 Vmware P.7 Acronis Backup P.8 IDC 80 % $20,0

Clonezilla 研習課程 新竹市網中心 孫振凱 蔡育欽 國家高速網路與計算中心 National Cent

Simulator By SunLingxi 2003

P4VM800_BIOS_CN.p65

C10_ppt.PDF

Chapter 2

投影片 1

講師簡介 - 蕭志榥 現職 國家高速網路與計算中心 研究員 學歷 經歷 國家高速網路與計算中心 軟體發展組組副組長 2013 ~ 至今 國家高速網路與計算中心 軟體技術組組長 2010 ~2013 中華民國軟體自由協會理事長 2011 ~ 2015 中華民國開放系統協會理事 2005 ~2015 法

LSI U320 SCSI卡用户手册.doc

Serial ATA ( Nvidia nforce430)...2 (1) SATA... 2 (2) B I O S S A T A... 3 (3) RAID BIOS RAID... 6 (4) S A T A... 9 (5) S A T A (6) Microsoft Win

Windows XP

Microsoft Word - template.doc

IP TCP/IP PC OS µclinux MPEG4 Blackfin DSP MPEG4 IP UDP Winsock I/O DirectShow Filter DirectShow MPEG4 µclinux TCP/IP IP COM, DirectShow I

Dell Vostro 14–3459 用户手册

<55342D323637CBB5C3F7CAE92E786C73>

ebook62-1

網路安全:理論與實務 第二版

企鵝龍 (DRBL)/ 再生龍 (Clonezilla) 簡介與應用 孫振凱 ceasa

Microsoft PowerPoint - lect01.ppt

HighPoint产品的FAQ手册

CANVIO_AEROCAST_CS_EN.indd

(Quad-Core Intel Xeon 2.0GHz) ()(SAS) (Quad-Core Intel Xeon 2.0GHz) (Windows )(Serial ATA) (Quad-Core Intel Xeon 2.0GHz) (Linux)(Serial ATA)

Clonezilla 研習課程 基隆市教育網路中心 孫振凱 蔡育欽 國家高速網路與計算中心 National C

Basic System Administration

A9RF716.tmp

说明书

V A. 1 Hyper-V R2 V C. A. Hyper-V B. Microsoft SCOM 20 V C. MAP D. Microsoft SCVMM 2008 V B. V D. 2. IT IT 2

P4V88+_BIOS_CN.p65

PowerPoint 演示文稿

Cadence SPB 15.2 VOICE Cadence SPB 15.2 PC Cadence 3 (1) CD1 1of 2 (2) CD2 2of 2 (3) CD3 Concept HDL 1of 1

PL600 IPPBX 用户手册_V2.0_.doc

TCA Linux 相容性認證測試流程步驟

WebSphere Studio Application Developer IBM Portal Toolkit... 2/21 1. WebSphere Portal Portal WebSphere Application Server stopserver.bat -configfile..

HOL-CHG-1695

Panaboard Overlayer help

1.ai

BYOD Http Redirect convergence Client (1) 2008R2 NLB( ) (2) NLB Unicast mode switch flooding (arp ) NLB DNS Redirect 1. Round-Robin DNS DNS IP/DNS Cli

Bus Hound 5

Transcription:

Clonezilla 實務課程 孫振凱 http://drbl.nchc.org.tw, http://drbl.sourceforge.net http://clonezilla.nchc.org.tw, http://clonezilla.org 國家高速網路與計算中心 National Center for High-Performance Computing (NCHC) Q2, 2016

Outline (Day 1) Time: 09:30 16:30 Clonezilla 簡介 / 備份原理 Clonezilla 系統流程架構 / 映像檔介紹 Clonezilla unicast, multicast, broadcast clone 介紹與 注意事項 實務探討 硬碟 / 磁區差異性性問題與實務處理 使用多重開機硬像檔佈署實務操作 大量佈署 Windows/Linux 相關問題與解決 uefi+gpt vs. legacy boot+ MBR 備份 2

Outline (Day 2) Time: 09:30 16:30 製作 Clonezilla Live 可開機隨身碟 ( 學員具自備 USB 隨身碟, 建議 512 MB 以上 ) 使用 Clonezilla Live 作為緊急救援工具 客制化 Clonezilla Live 開機碟與進階使用 3

孫振凱 (Ceasar Sun) 現職 國家高速網路與計算中心 副研究員 學歷 中山大學資訊管理研究所 彰化師大數學系 經歷 DRBL/Clonezilla 課程講師 / 叢集環境計算課程講師 K12 自由軟體課程講師 2008 年行政院傑出科技貢獻獎得主 2008 年黃金企鵝獎得主 2009 年開放原始碼創新應用開發大賽得主 參與專案 DRBL/Clonezilla/DRBL-winroll/Tux2live/Tuxboot/Clz-BD 其他 Red Hat Certified Engineer (RHCE): Red Hat Enterprise Linux 4. October 15, 2006 Network Security Packet Analysis Class C, 網路封包互動判讀, 1-14, August 2006 Principles of Project Management (36PDU) 專案管理法則, November 24-December 3, 2008 4

NCHC 簡介 Vision成為國際級高速計算中心 促成科學發現與技術創新 建置高速計算與網路應用優良研 究環境 提供各領域所需之專業服務 服 務 研 發 致力高速計算與網 路應用研究 提高服務品質 促 成科技發現與創新 NCHC Vision 育 才 培育高速計算與 網路應用專業人才 5

自由軟體實驗室 (Free Software Lab) From Taiwan, working for the NPO NCHC (National Center for High-Performance Computing) Developers of the free software DRBL, Clonezilla and more... Maintenance of mirror sites: Linux/packages mirror http://free.nchc.org.tw OSM cache server, OSDN,.. Taiwan image source: wikipedia.org 6

Exercise Index 安裝 Clonezilla SE 各種 Clonezilla SE 模式之轉換 Save/Restore image via Clonezilla SE 使用 DRBL Live 佈署 Clonezilla SE 環境 Run Clonezilla live via PXE On-the-fly:disk to disk, disk to remove disk 硬碟大小差異問題 Bigger size hard-drive restore Bigger size harddrive restore 大量佈署 Windows/Linux 相關問題 Toolkit DRBL-winroll 其他議題 開機載入 Advanced restore for dualboot 還原 uefi+gpt 於 legcy boot 處理 GPT vs. MBR 分割表差異備份問題 Clonezilla Live 應用 7

Polling 是電腦教室或網路管理員 曾經使用 Linux 經驗 桌面使用 伺服器使用 曾經使用過硬碟備份工具 曾經安裝使用 Clonezilla SE? Clonezilla Live? 8

參考文件 DRBL/Clonezilla 進階使用 Clonezilla Live 文件集 http://drbl.nchc.org.tw/advanced http://clonezilla.nchc.org.tw/clonezilla-live/doc/ Clonezilla 相關文章與報導 http://clonezilla.nchc.org.tw/related_article/ 9

Clonezilla 簡介 / 備份原理

需求 系統備援 / 備份 image source: maggiesfarm.anotherdotcom.com www.compsults.com, and jervisdabreo.com 11

需求 大量系統佈署 12

再生龍 (Clonezilla) 使用映像檔模式的硬碟或分割區備份 / 再生工具 類似於 True image 或 Ghost 適用於裸機還原與系統備份 VMF VMware S ESX/ESXi *1 *2 *3 *4 *5 *6 Logo source: (1) Larry Ewing, Simon Budig and Anja Gerwinski (2) Apple (3) Microsoft (4) Marshall Kirk McKusick (5) VMWare (6) Distrowatch.com 13

再生龍 Clonezilla Clonezilla [OCS (Opensource Clone System)] Clonezilla 是一完整的硬碟資料複製的工具 類似 Ghost (Symantec) 或是 Rembo(Acquired by IBM Tivoli software)/ Acronis (True Image) 整合 partclone(http://partclone.org/),partimage (http://www.partimage.org), ntfsclone 與 udpcast1 (http://udpcast.linux.lu/) 處理元件包含 實體資料 : 分割區資料 LVM2 開機載入 (BIOS + MBR:446+64+2 EFI+GPT) 隱藏磁區 註 1: 使用在 Server edition 用於裸機 (bare material) 還原 不同於 與以檔案為基礎的備份方式 差異備份 增異備份 還原卡模式 兩種釋出版本 Live edition 合單機 個人使用 作為備份 還原單一機器使用 Server edition (SE) 適合大量批次還原 集中式管理 如 電腦教室管理 大量出機生 產線... 14

特點 Free (GPL) Software 支援儲存與還原不同作業系統 [ 檔案系統 ] GNU/Linux [ext2/3/4, reiserfs3/4, xfs, jfs, btrfs], MS Windows [FAT, NTFS, exfat], Mac OS [HFS+], Free BSD [UFS], VMWare ESX(i) [VMFS(v3,v5)], Minix [Minix] Supports LVM2 支援部分 hardware RAID chips (by kernel) Block base 備份方式 支援的檔案系統以 smart copying 方式 無法辨識之檔案系統 (ex: zfs..,) 使用 dd 開機載入處理 : syslinux, Grub 1/2 ; MBR and hidden data (if exist) 支援 serial console/ 支援全自動模式 支援單一映像檔同時佈署至多個本機裝置 檔案式架構之印象檔 格式通透 公開 標準格式 易於彈性調整 於伺服器版本 (Clonezilla SE) 支援群播 (Multicast): 適合大量佈署 能結合使用 Live edition1 註 1: 使用在 Server edition 15

模式 1 伺服器 (Server) 模式 DRBL live i.e. Clonezilla Server Edition 適用 大量佈署 產線自動化 電腦教室 叢 集計算 16

模式 2 單機 (Live) 模式 Clonezilla live 適用 單機或個人使用 即插即用 搭配伺服器版本 17

使用者分佈 >>13,000,000 downloads 13,000,000 downloads 18

Terminology 技術用詞 Raw copying* Smart copying* A possibility to distinguish which portions of the partition really contain data and to copy these only Live copying* A possibility to perform sector-by-sector copying of a whole partition A drive or volume can be copied/imaged while it is in use, avoiding the need for booting into a separate operating system or Live CD. Smart copy full disk A possibility to distinguish which portions of the disk really contain data and to copy these only Possible to skip swap, pagefile... * The descriptions are from http://en.wikipedia.org/wiki/comparison_of_disk_cloning_software 19

新增功能 支援多種儲存裝置 Multipath devices, e.g. /dev/cciss/c0d0, are now supported natively. No more linking them to /dev/sd[a-z]. Therefore now LVM on cciss device are supported. Xen disk (/dev/xvd[a-z]) was added as a supported device. NVMe (Non-Volatile Memory Express) device e.g. /dev/nvme0n1 /dev/sda 新增支援檔案系統 NILFS2 (Log-Structure) 支援傳統開機裝置中 bios_boot with GPT 混合模式 預設還原前先檢查映像檔 還原後支援使用 md5sum/sha1sum/sha256sum/sha512sum 演算法對 檔案進行檢查 (testing release, i.e. >= Clonezilla live 2.4.5-26) 20

再生龍 Clonezilla 限制 目的硬碟 ( 分割區 ) 大小至少需等於 ( 或大於 ) 來源硬碟 ( 分割區 ) 不支援差異 (Differential1) 備份 / 增異 (Incremental1) 備份 不支援線上 (Online) 備份 / 回覆 不完全支援 Software RAID/Firmware(Fake) RAID 2 需額外手動步驟調整 印象檔無法支援分片回存 需先將分片檔案集合在同一儲藏空間 註 1: http://en.wikipedia.org/wiki/incremental_backup 註 2:http://en.wikipedia.org/wiki/RAID 21

相關工具 GParted Free partition editor for graphically managing disk and partition http://gparted.sourceforge.net Tuxboot 幫助你建立可開機的 USB 隨身碟 它支援 Clonezilla live, DRBL live, GParted live 與 Tux2live http://tuxboot.nchc.org.tw/ DRBL-winroll 大量佈署 M$ windows 系統的自動設定輔助工具 (1) 還原後自動修改 M$ Windows 的機器名稱, 群組,(SID)(2) 接受來至 DRBL server 的指令 server 的 指令 http://drbl-winroll.nchc.org.tw/ 22

實做環境 Server site Client site Ubuntu Clonezilla SE enable Virtualbox Clonezilla SE Linux/Windows Virtual machine(maybe) Gateway-> Internet Clonzilla client eth0 dhcp Eth1/vboxnet0 192.168.56.254 OS-installed/PXE booting/cd/usb drive Network/VM Net link eth0 192.168.56.x 23

Task 安裝 Clonezilla SE 佈署 Clonezilla SE 環境以服務 vboxnet0 用戶端 Scenario DRBL SSI/Clonezilla full mode 使用 server 核心 DHCP use range mode Exercise $ sudo drblsrv -i $ sudo drbl4imp -r 1 -z 0 -p 12 Check point 確認 client 能以 Clonezilla select-in-client 模式開 Hint: use dcs 24

再生龍伺服器版上的三種模式 Clonezilla SE: Full/Box/Live mode Full Clonezilla /etc, /var, /root of client Files in /etc and /var of client after reboot Extra space in server/client Max client #/ethernet card in server Adv./Dis Clonezilla Box Clonezilla Live NFS-based Tmpfs-based Use squashfs Kept Gone Gone ~ 50-100 MB* 0 0 253 253 253 可個別設定 client 組態 / Server 負載 較重 Server 負載較 Server 負載最輕, 較 輕 / 無法個別設 易相容於異質 client 定 client 組態 硬體環境 / udpcast 套件版本可能不同 * depends on the packages installed in the server 25

Exercise Task 各種 Clonezilla SE 模式之轉換 Scenario 以 dcs 切換 Clonezilla SE 模式 切換為 Full Clonezilla 模式 切換為 Clonezilla box 模式 $ sudo dcs more clonezilla-mode 檢查 /etc, /var, /root 等檔案系統格式 切換以 Clonezilla Live 模式 $ sudo drbl-ocs-live-prep -i <Clonezilla Live ISO 檔案 > Check point 確認 client 能以 Clonezilla select-in-client 模式開 啟 26

Clonezilla 原理架構 / 硬像檔介紹

Clonezilla 備份流程 Start Parse partition table Save MBR/GPT data YES Save partition table Find the file system of device Smart copying? Find the Device (partition/lv ) NO Save hardware info YES Decide device imaging engine partclone partimage ntfsclone Use dd to save image to stdout Save device image to stdout Decide compressing engine End NO gzip bzip2 lzma lzip xz Save stdin as file in the image dir 28

Exercise Task Save/Restore image via Clonezilla SE Select-in-client/Multicast 29

Clonezilla 映像檔說明 MBR-type root@debian:~# ls -alfh /home/partimag/trusty-img/ image name -rw-r--r-- 1 root root 583 7 月 4 04:35 blkdev.list -rw-r--r-- 1 root root 214 7 月 4 04:35 blkid.list -rw-r--r-- 1 root root 4412 7 月 4 04:50 clonezilla-img Hardware/software -rw-r--r-- 1 root root 4 7 月 4 04:46 disk information -rw-r--r-- 1 root root 1845 7 月 4 04:46 Info-dmi.txt -rw-r--r-- 1 root root 9656 7 月 4 04:46 Info-lshw.txt -rw-r--r-- 1 root root 1509 7 月 4 04:46 Info-lspci.txt -rw-r--r-- 1 root root 172 7 月 4 04:46 Info-packages.txt real data of -rw-r--r-- 1 root root 82 7 月 4 04:50 Info-saved-by-cmd.txt partition sda1 -rw-r--r-- 1 root root 5 7 月 4 04:46 parts -rw------- 1 root root 1.7G 5 月 27 02:42 sda1.ext4-ptcl-img.gz.aa disk C.H.S. value -rw-r--r-- 1 root root 36 7 月 4 04:35 sda-chs.sf Use dd to save -rw-r--r-- 1 root root 1048064 7 月 4 04:35 sda-hidden-data-after-mbr MBR and other -rw-r--r-- 1 root root 512 7 月 4 04:35 sda-mbr hidden data -rw-r--r-- 1 root root 385 7 月 4 04:35 sda-pt.parted partition info from parted and sfdisk -rw-r--r-- 1 root root 346 7 月 4 04:35 sda-pt.parted.compact -rw-r--r-- 1 root root 310 7 月 4 04:35 sda-pt.sf UUID and label info of -rw-r--r-- 1 root ceasar 53 7 月 4 04:46 swappt-sda5.info sda2 (swap partition) 30

Clonezilla 映像檔說明 GPT-type # ls -al 2014-06-10-Acer.P645/... -rw------- 1 root root 30 Jun 10 20:37 parts GPT partition info -rw------- 1 root root 37 Jun 10 20:09 sda-chs.sf from gdisk -rw------- 1 root root 17408 Jun 10 20:09 sda-gpt-1st -rw------- 1 root root 16384 Jun 10 20:09 sda-gpt-2nd -rw------- 1 root root 17920 Jun 10 20:09 sda-gpt.gdisk -rw------- 1 root root 868 Jun 10 20:09 sda-gpt.sgdisk -rw------- 1 root root 512 Jun 10 20:09 sda-mbr -rw------- 1 root root 799 Jun 10 20:09 sda-pt.parted -rw------- 1 root root 703 Jun 10 20:09 sda-pt.parted.compact -rw------- 1 root root 250 Jun 10 20:09 sda-pt.sf -rw------- 1 root root 279710177 Jun 10 20:09 sda1.ntfs-ptcl-img.gz.aa -rw------- 1 root root 23508776 Jun 10 20:09 sda2.vfat-ptcl-img.gz.aa -rw------- 1 root root 54450946 Jun 10 20:09 sda3.dd-img.aa... 31

Clonezilla 映像檔說明 LVM image name $ ls -l centos6.5.x64/ -rw-r--r-- 1 root root 79 5 月 2 00:31 Info-saved-by-cmd.txt LVM information -rw-r--r-- 1 root root 288 5 月 2 00:29 lvm_logv.list -rw-r--r-- 1 root root 58 5 月 2 00:29 lvm_vg_dev.list -rw------- 1 root root 1704 5 月 2 00:29 lvm_volgroup.conf -rw-r--r-- 1 root root 10 5 月 2 00:30 parts -rw------- 1 root root 21549758 5 月 2 00:29 sda1.ext4-ptcl-img.gz.aa -rw-r--r-- 1 root root 36 5 月 2 00:29 sda-chs.sf -rw-r--r-- 1 root root 1048064 5 月 2 00:29 sda-hidden-data-after-mbr -rw-r--r-- 1 root root 512 5 月 2 00:29 sda-mbr -rw-r--r-- 1 root root 325 5 月 2 00:29 sda-pt.parted -rw-r--r-- 1 root root 298 5 月 2 00:29 sda-pt.parted.compact -rw-r--r-- 1 root root 259 5 月 2 00:29 sda-pt.sf -rw-r--r-- 1 root root 53 5 月 2 00:30 swappt-volgroup-lv_swap.info -rw------- 1 root root 229987196 5 月 2 00:30 VolGroup-lv_root.ext4-ptcl-img.gz.aa... real data of LV 32

Clonezilla 還原流程 Start Read image Create partition table Create LV if LV image found in image dir Find the image of device NO Tune the file file system size to fit partition size Reinstall grub if assigned End YES Decide device imaging engine partclone partimage ntfsclone Restore the image of device to device 33

Exercise Task Save/Restore image via Clonezilla SE Select-in-client/Multicast 34

Clone without image Use clone on-the-fly Server : OCS -> select in client Client : select Device-device 兩種 device to device 方式 Device to local device 確認 source/destination device Device to remote device 1. 設定好來源端 2. 目的端進入 console 確認網路 $ ocs-onthefly -s [source ip] -t [device id] $ ocs-onthefly -s 192.168.1.1 -t sda 35

Exercise Task Use Clonezilla live via PXE server On-the-fly:disk to disk, disk to remove disk Scenario Check point: 36

Clonezilla SE via DRBL Live 使用 DRBL Live 建置再生龍伺服器 不需要安裝 只需要配置定後即可使用再生龍伺服器版本功能 Download: http://drbl.nchc.org.tw 下載 DRBL live ISO 檔 (CD/DVD 用 ) 或者 zip 檔 (USB 隨身碟或 硬碟用 ) 使用 Live CD 開機 執行 再生龍伺服器 掛載印像檔儲存空間 佈署並啟動再生龍 SE 37

Task 使用 DRBL Scenario Exercise Live 佈署 Clonezilla SE 環境 Version: drbl-live-xfce-2.4.5-23-amd64 Server NAT+ 內部網路 / 8G storage Client 內部網路 / 有 local OS Check point: 使用 DRBL live 的 Clonezilla SE 環境備份 / 還原 client 硬 碟 38

硬碟大小不同的處理方式 原則 目的分割區必須等於或大於來源分割區 小硬碟 -> 大硬碟 與原始硬碟分割區規劃相同 自行處理後段未始用空間 按比例放大 只適用於 MBR 分割格式 不適用 GPT 大硬碟 -> 小硬碟 整顆硬碟 restore 標準做法 事先調整來源分割區大小 GParted, Partition magic, EASEUS Partition Master, with [*] -icds 等比例縮小 [*] -icds, -k1 部份分割區 restore : Image hacking : 調整映像檔分割表決定以部份分割區 restore 與否 with [*] -icds Restore disk 39

Exercise Task 硬碟大小差異還原 Small to bigger:manually/ proportionally Big to smaller: GParted resize/create partition 40

MBR vs GPT 比較 MBR GPT 名稱 Master Boot Record GUID Partition Table 可切割數量 4(3+1) 128 (unlimited, base on OS ) 單一分割區最大容量 2T 18 EB 最大規劃硬碟 <4T 9.4ZB Master Boot Record 儲存容量單位 b,b,k,m,g,t,p,e,z,y 41

UEFI + Secure Boot UEFI 統一可延伸韌體介面 Unified Extensible Firmware Interface, UEFI 是一種個人電腦系統規 格 用來定義作業系統與系統韌體之間的軟體介面 作為 BIOS 的替代方案 可延伸韌體介面 負責加電自檢 POST 連繫作業系統以及提供連接作業系統與硬體的介面 Secure Boot Secure boot 是 UEFI 規格的一部份 這項由 Intel 主導的規格 早就在伺服器平台上存在 了 Secure boot 最主要目的 在於防止惡意軟體 為避免非法的操作在作業系統載入之前就 被執行 因此必須對載入的程式甚至是作業系統詳加檢查 所謂相容於 UEFI 的韌體 主要是利用公開金鑰系統來辨識誰才是合法的作業系統 它包含 一個平台金鑰 platform key 簡稱 PK 以及一個交換金鑰 exchange key 簡稱 KE K 辨識的方法是在作業系統執行之前 比對由設備廠商 或委由金鑰管理公司處理 提供 的二個認證簽署過的金鑰資料庫 只有檢核通過的作業系統才會被 Secure boot 確認為合法 42

Secure Boot 程序 & Solution Solution S0: Disable Secure Boot in BIOS/UEFI S1: Use Ubuntu based amd64 version Clonezilla-live 1.http://en.wikipedia.org/wiki/Unified_Extensible_Firmware_Interface 2.http://freesf.tw/?p=61 3.http://www.arthurtoday.com/2011/10/secure-boot.html#.U8VekFHxBeM 4.http://msdn.microsoft.com/en-us/windows/hardware/br259114.aspx 43

先進格式硬碟 Advanced Format Technology 44

先進格式硬碟 儲存密度的上升會明顯降低磁頭讀取磁碟的信噪比 雖然可 以用 ECC 校驗保證資料可靠性 但消耗的空間會抵消儲存密 度上升帶來的多餘空間 在 x86 架構下 通常內部記憶體分頁容量為 4KB 許多磁碟檔案系統 如 NTFS ext3 HFS+ 等 的簇容量 也為 4KB 早期 512byte 磁區需要另外 40byte 作為 ECC 校驗空間 而 4kbyte 磁區只需要 100byte 減少 ECC 的佔用和提升 ECC 校驗效率 同樣提供 4kbyte 磁區空間 使用先進格式化能節約出 220byte http://zh.wikipedia.org/wiki/%e5%85%88%e9%80%b2%e6%a0%bc%e5%bc%8f%e5%8c%96 45

與 WD 先進格式化 (WD Advanced Format) 硬碟相容性 Advanced Format 互相 clone 不會有問題 Advanced Format 硬碟 clone 到沒有 Advanced Format 的硬 碟也沒有問題 會有問題的方式 在舊硬碟 (160G) 安裝 XP, clone 起來 還原到新硬碟 1.5T(WD15EARS) 用 wd align 工具去修復 用 clonezilla + 手動調整 http://drbl.nchc.org.tw/fine-print.php? path=./faq/1_drbl_common/53_wd_advanced_format_disk.faq#53_wd_adv anced_format_disk.faq 46

多重開機環境探討 Boot loader 運作模式 : Windows XP, Win7 : ntldr/bootmgr Linux : Grub1/2 Restore 可能問題探討 47

Restore single partition Restore partition : sda1 Use 8G hard drive, use source partition table How to : Modify partition table Add advanced parameters : -idcs Restore done but boot failed!! 48

Task 其他議題 開機載入 Advanced restore for dualboot 還原 uefi+gpt 於 legcy boot 處理 利用 dual-boot 印象檔 將其中的 Linux (sda5) 部份 restore 到實體機器中 利用 dual-boot 印象檔 將其中的 XP (sda1) 部份 restore 到虛擬機器中 條件 目的硬碟分割表只留下 sda1 分割區 並確定能夠正確啟動 Windows XP GPT-MBR 分割表差異備份問題 Exercise $ sudo sgdisk -v /dev/sda GPT 硬像檔回覆至 Legacy boot 環境中啟動處理 Required package:grub-pc Step: Chroot into target OS Installl grub into MBR 49

佈署 Linux 之探討 硬體差異度 範本機處理 驅動程式預載 硬體設定檔 網路 顯示卡 硬碟 分割區代號影響... 系統安全與軟體 非必要之紀錄檔 (log, root history) 個人相關安全紀錄檔 (web account/passwd) 集中式管理 50

佈署 Windows 之探討 硬體差異度 範本機處理 驅動程式預載 Sysprep 硬體設定檔 網路... 系統安全與軟體 非必要之紀錄檔 (log) 個人相關安全紀錄檔 (web account/passwd) 集中式管理 輔助工具 DRBL-winroll 51

Exercise Task 大量佈署 Linux/Unix : use pre-run/post-run 大量佈署 Windows: DRBL-winroll 52

Clonezilla Live 發行版 (Debian based) 穩定版 / 測試版 替代版 (Ubuntu based) 穩 定版 / 測試版 光碟版 (iso 檔案 ) USB 隨身碟或隨身硬碟版 (zip 檔案 ) 硬碟版 將 Clonezilla live 放在一個已經有作業系統存在的硬碟中 PXE 版 下載後 把該 ISO 檔案燒到光碟片上 ( 記得要選用燒錄映象檔的方式 舉例而言 在 MS Windows 下 以 Nero Burning ROM 為例 你要選 ' 燒錄映像檔 " 來燒這個 iso 檔 ) 就可以用它來開機 將 Clonezilla live 放在 PXE 伺服器上來讓用戶端電腦透過 PXE 網路開機使用 Clonezilla live 詳情參考 http://clonezilla.nchc.org.tw/clonezilla-live/ 53

Clonezilla Live 版本差異 差異 穩定版 / 測試版 替代版 OS baesd Debian-based Ubuntu-based iso/zip 檔案大 小 大約小 10 MB 大約大 10 MB 是否包含不自由 的軟體 ( 例如 否 firmware) 是 對 486 CPU 的 支援 不支援 (CONFIG_M586=y and CONFIG_X86_GENERIC=y) 486 版的 iso/zip 有支援 (CONFIG_M486=y) 多核心 / 多處理 686 版有支援, 486 版不支 器的支援 援 有 54

Exercise Clonezilla Live 應用 1.Save/restore disk via network fs: sshfs, samba 2.Save/restore partitions from local disk 3.Create Clonezilla recover CD/DVD 4.install live into usb, hd 5.Customize Clonezilla live 6.Insert customized Clnezilla live into hd 55

測驗練習

DRBL-winroll 架構與功能簡介 http://drbl-winroll.nchc.org.tw/ http://www.drbl-winroll.org/

附錄 Clonezilla 進階使用

附錄 進階使用 Clonezilla SE /Clonezilla Live Clonezilla live 與 Clonezilla SE (Server Edition) 原理與架構介紹 Clonezilla box mode 介紹 Unicast, multicast, broadcast clone 介紹與注意事項 如何轉換印象檔中的硬碟代號 PXE 開啟 Clonezilla live 作法 如何製作 clonezilla live 開機 usb 隨身碟或硬碟 我要怎麼自己從無到有做一個 Clonezilla live? 客製化 Clonezilla live 製作 有沒有可能把 Clonezilla Live 放到硬碟中來執行? 利用 virtualbox 來做 Clonezilla 開發與測試環境 59

Note 至 text console 端以 root 登入 drbladm/ilovedrbl 如果要新增帳號 加入 admin 群組 export LC_ALL=C adduser [your acount] adduser [your account] admin 至 GDM 使用一般使用者登入 確認網路線連接至學生機 auto eth1 iface eth1 inet static address 192.168.101.254 netmask 255.255.255.0 60

Note http://drb.nchc.org.tw Clonezilla live 使用 save/restore Onethefly 網路芳鄰 :192.168.167.11 Path: share administrator/[ 空 ] Clonezilla live 客制化 Include image Include without image, customized pre-run Debian live templet customize 61