CentOS 7系統上製作Clonezilla(再生龍)啓動U盤並克隆雙系統

筆記本安裝的是雙系統:Win7 64位,CentOS 7 64位。

政採就是個巨大的坑,筆記本標配的是5400轉的機械硬盤,開機時間常常要一至兩分鐘,軟件運行起來時各種數據的讀寫也非常慢,忍無可忍,決定更換成固態硬盤。

但是,CentOS 下許多軟件的安裝和配置都是用命令行完成的,再重裝一遍不僅費時費力,而且不一定能完全還原成現有的樣子,急需一個可以可靠地快速還原這個雙系統的軟件。

再生龍(Clonezilla),就是一款非常適合這個任務的軟件,而且它確實達到了我的要求,硬盤更換變得如此簡單。

這裏記錄一下操作過程,作爲備忘。

步驟一:製作 Clonezilla Live的啓動U盤(可參考這裏)

步驟二:重啓,用含有Clonezilla Live的U盤啓動系統,並外接新硬盤作爲目標硬盤,對舊硬盤進行克隆;克隆結束,拔掉 U 盤,關機。

步驟三:拆掉舊硬盤,並安裝新硬盤;再開機,看新硬盤是否能正常啓動,各個系統都開機試一下,看是否正常。

  1. 在 sourceforge網站 選擇Clonezilla Live的一個穩定發行版,以版本號2.5.2-17爲例,它共有六個不同的文件,需要根據具體情況選取合適的版本:

(1)文件名後綴 (“iso” 、“zip”)表示不同的啓動介質用途,“iso” 用於燒錄 CD/DVD,“zip” 用於製作 USB 或硬盤啓動源;

(2)版本號之後的字符串(“i686”、“i686-pae”、“amd64”)表示基於不同架構的處理器適用版本:

    以 Ubuntu 為基礎之分支, 如: 替代板(含穩定版、測試版), ,提供 2 種 CPU 架構:
        amd64, 在AMD64 或 Intel 64 處理器. 支援多核心處理器與多處理器.
        i386, 一般為 386 CPU 使用. 支援多核或多顆處理器,也支援PAE (Physical Address Extension)。
    若您不確認您的機器為何種核心,建議先嘗試 i386 版本. (最慢,但幾乎支援目前的 x86 CPU). 但若需要支援 uEFI secure boot, 請使用 替代版(Ubuntu-based)的 AMD64 版本 Clonezilla live.
    以 Debian 為基礎之分支, 如:發行版(含穩定版、測試版), 提供3 種不同 CPU 架構:
        amd64, 在 AMD64 或 Intel 64 處理器. 支援多核心處理器與多處理器.
        i686-pae, 最佳化為 i686 CPU 支援 PAE. 支援多核心處理器與多處理器.
        i686, 一般為 686 CPU 使用.支援多核或多顆處理器,但不支援PAE (Physical Address Extension)。
    若您不確認您的機器為何種核心,建議先嘗試 i686 版本. (最慢,但幾乎支援目前的 x86 CPU). 但若需要支援 uEFI secure boot, 請使用 替代版(Ubuntu-based)的 AMD64 版本 Clonezilla live.

———————————————————————————————————————————

Home / clonezilla_live_stable / 2.5.2-17
Name Modified Size Downloads / Week Status
Parent folder
source 2017-06-27 5252 weekly downloads
clonezilla-live-2.5.2-17-i686.zip 2017-06-26 206.2 MB 151151 weekly downloads i
clonezilla-live-2.5.2-17-i686.iso 2017-06-26 212.9 MB 541541 weekly downloads i
clonezilla-live-2.5.2-17-i686-pae.zip 2017-06-26 206.6 MB 5656 weekly downloads i
clonezilla-live-2.5.2-17-i686-pae.iso 2017-06-26 213.9 MB 1,0011,001 weekly downloads i
clonezilla-live-2.5.2-17-amd64.zip 2017-06-26 206.7 MB 576576 weekly downloads i
clonezilla-live-2.5.2-17-amd64.iso 2017-06-26 213.9 MB 1,8621,862 weekly downloads i
Totals: 7 Items 1.3 GB 4,239

——————————————————————————————————————————

根據本機情況,我們選擇clonezilla-live-2.5.2-17-i686.zip 來製作啓動 U 盤。

這個網站下載時容易中斷,我們用wget命令的不限次接續方式來下載:

wget -t 0 -c https://sourceforge.net/projects/clonezilla/files/clonezilla_live_stable/2.5.2-17/clonezilla-live-2.5.2-17-i686.zip

下載完成後,將本機文件的MD5校驗碼與網站上發佈的MD5校驗碼(78c876c63d17ab29fc0c2c72c75ba07c)進行校驗:

[She@localhost ]$ md5sum ./clonezilla-live-2.5.2-17-i686.zip
78c876c63d17ab29fc0c2c72c75ba07c ./clonezilla-live-2.5.2-17-i686.zip

如果二者不一致,則刪除文件再重新下載,直到一致時才進行後面的操作。

  1. 掛載 U 盤,比如:/dev/sdb1 掛載位置爲 /mnt/tmp ,檢查 U 盤採用的文件系統,它可以支持 FAT32 等,但不支持NTFS格式,若不支持則格式化爲 FAT32 格式。
    複製代碼

sudo fdisk -l /dev/sdb

Disk /dev/sdb: 12.8 GB, 12884901888 bytes
15 heads, 63 sectors/track, 26630 cylinders
Units = cylinders of 945 * 512 = 483840 bytes
Disk identifier: 0x00054ba9

Device Boot      Start         End      Blocks   Id  System
/dev/sdb1   *           1       26630    12582643+   b  W95 FAT32

sudo mkfs.vfat -F 32 /dev/sdb1

mkfs.vfat -F 3.02 (12 Mar 2013)

複製代碼

  1. 將下載到的壓縮包解壓到 U 盤中:

$ unzip ./clonezilla-live-2.5.2-17-i686.zip -d /mnt/tmp

  1. 切換到 U 盤下的 utils/linux 目錄下,然後執行以下命令:

She@she-centos7 linux]$ sudo bash makeboot.sh /dev/sdb1

這裏給出該命令執行正確與錯誤的兩種返回結果:

(1)錯誤的返回結果:U 盤不具有 MBR 分區表,這裏的 U 盤是全盤分成了一個唯一的 FAT32 格式的,使該命令無法執行
複製代碼

She@she-centos7 linux]$ sudo bash makeboot.sh /dev/sdb1
The partition table of /dev/sdb is not for MBR (Master Boot Record). Its layout is:
Model: SanDisk Cruzer Edge (scsi)
Disk /dev/sdb: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: loop
Disk Flags:

Number Start End Size File system Flags
1 0.00B 16.0GB 16.0GB fat32

This program is for making a bootable disk with MBR partition table.
For GPT disk, there is no need to run this program. Just make sure the partition is FAT32 with ID=ef00 and all the files are copied on that. That’s all.
Program terminated!

複製代碼

(2)正確的返回結果:U 盤設置爲兩個獨立的分區,分別是4G + 12G,執行過程中提示系統缺少“glibc.i686”的插件,用 “yum install glibc.i686”命令很方便地安裝上該插件,然後再次執行設置 U 盤啓動的命令,OK。
複製代碼

[She@she-centos7 ~]$ sudo bash /run/media/She/Clone/utils/linux/makeboot.sh /dev/sdb1
[sudo] password for She:
This command will install MBR and syslinux/extlinux bootloader on /dev/sdb
Clonezilla files are assumed to be on /dev/sdb1

Machine: Latitude E5270:
Model: SanDisk Cruzer Edge (scsi)
Disk /dev/sdb: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 4302MB 4301MB primary fat32
2 4302MB 16.0GB 11.7GB primary fat32


Are you sure you want to continue?
[y/n] y
OK! Let’s do it!

File system of /dev/sdb1: vfat

sdb1 is not marked as bootable! The partition table of /dev/sdb:

Latitude E5270:
Model: SanDisk Cruzer Edge (scsi)
Disk /dev/sdb: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 4302MB 4301MB primary fat32
2 4302MB 16.0GB 11.7GB primary fat32


Do you want to mark it as bootable ?
[y/n] y
OK! Let’s do it!
Running: parted -s /dev/sdb set 1 boot on

Do you want to install MBR on /dev/sdb on this machine “Latitude E5270” ?
[y/n] y
OK! Let’s do it!
Running: cat “/run/media/She/Clone/utils/mbr/mbr.bin” > /dev/sdb

Do you want to install the syslinux boot files on /dev/sdb1 on this machine “Latitude E5270” ?
[y/n] y
OK! Let’s do it!
A filesystem supporting Unix file mode for syslinux is required. Copying syslinux to /tmp/linux_tmp.9UA4hT
‘/run/media/She/Clone/utils/linux/syslinux’ -> ‘/tmp/linux_tmp.9UA4hT/syslinux’
On x86-64 system, you should install libc6-i386 (for Debian/Ubuntu) or glibc.i686 (for Fedora/CentOS/OpenSuSE) package so that the required libraries to run 32-bit program /tmp/linux_tmp.9UA4hT/syslinux exist.
Program terminated!
[She@she-centos7 ~]$ rpm -qa | grep glibc
glibc-common-2.17-157.el7_3.5.x86_64
glibc-devel-2.17-157.el7_3.5.x86_64
glibc-2.17-157.el7_3.5.x86_64
glibc-headers-2.17-157.el7_3.5.x86_64
[She@she-centos7 ~]$ sudo yum install glibc.i686
已加載插件:fastestmirror, langpacks, priorities
Repodata is over 2 weeks old. Install yum-cron? Or run: yum makecache fast
adobe-linux-x86_64 | 2.9 kB 00:00
base | 3.6 kB 00:00
epel | 4.3 kB 00:00
extras | 3.4 kB 00:00
updates | 3.4 kB 00:00
(1/4): epel/x86_64/group_gz | 170 kB 00:00
(2/4): extras/7/x86_64/primary_db | 191 kB 00:00
(3/4): epel/x86_64/updateinfo | 815 kB 00:03
(4/4): epel/x86_64/primary_db | 4.8 MB 00:04
Loading mirror speeds from cached hostfile

  • base: mirrors.tuna.tsinghua.edu.cn
  • epel: mirrors.aliyun.com
  • extras: mirrors.tuna.tsinghua.edu.cn
  • updates: mirrors.tuna.tsinghua.edu.cn
    正在解決依賴關係
    –> 正在檢查事務
    —> 軟件包 glibc.i686.0.2.17-157.el7_3.5 將被 安裝
    –> 正在處理依賴關係 libfreebl3.so(NSSRAWHASH_3.12.3),它被軟件包 glibc-2.17-157.el7_3.5.i686 需要
    –> 正在處理依賴關係 libfreebl3.so,它被軟件包 glibc-2.17-157.el7_3.5.i686 需要
    –> 正在檢查事務
    —> 軟件包 nss-softokn-freebl.i686.0.3.16.2.3-14.4.el7 將被 安裝
    –> 解決依賴關係完成

依賴關係解決

================================================================================
Package 架構 版本 源 大小

正在安裝:
glibc i686 2.17-157.el7_3.5 updates 4.2 M
爲依賴而安裝:
nss-softokn-freebl i686 3.16.2.3-14.4.el7 base 188 k

事務概要

安裝 1 軟件包 (+1 依賴軟件包)

總下載量:4.4 M
安裝大小:15 M
Is this ok [y/d/N]: y
Downloading packages:
(1/2): nss-softokn-freebl-3.16.2.3-14.4.el7.i686.rpm | 188 kB 00:00
(2/2): glibc-2.17-157.el7_3.5.i686.rpm | 4.2 MB 00:01

總計 2.7 MB/s | 4.4 MB 00:01
Running transaction check
Running transaction test
Transaction test succeeded
Running transaction
正在安裝 : nss-softokn-freebl-3.16.2.3-14.4.el7.i686 1/2
正在安裝 : glibc-2.17-157.el7_3.5.i686 2/2
驗證中 : glibc-2.17-157.el7_3.5.i686 1/2
驗證中 : nss-softokn-freebl-3.16.2.3-14.4.el7.i686 2/2

已安裝:
glibc.i686 0:2.17-157.el7_3.5

作爲依賴被安裝:
nss-softokn-freebl.i686 0:3.16.2.3-14.4.el7

完畢!
[She@she-centos7 ~]$ sudo bash /run/media/She/Clone/utils/linux/makeboot.sh /dev/sdb1
This command will install MBR and syslinux/extlinux bootloader on /dev/sdb
Clonezilla files are assumed to be on /dev/sdb1

Machine: Latitude E5270:
Model: SanDisk Cruzer Edge (scsi)
Disk /dev/sdb: 16.0GB
Sector size (logical/physical): 512B/512B
Partition Table: msdos
Disk Flags:

Number Start End Size Type File system Flags
1 1049kB 4302MB 4301MB primary fat32 boot
2 4302MB 16.0GB 11.7GB primary fat32


Are you sure you want to continue?
[y/n] y
OK! Let’s do it!

File system of /dev/sdb1: vfat

Do you want to install MBR on /dev/sdb on this machine “Latitude E5270” ?
[y/n] y
OK! Let’s do it!
Running: cat “/run/media/She/Clone/utils/mbr/mbr.bin” > /dev/sdb

Do you want to install the syslinux boot files on /dev/sdb1 on this machine “Latitude E5270” ?
[y/n] y
OK! Let’s do it!
A filesystem supporting Unix file mode for syslinux is required. Copying syslinux to /tmp/linux_tmp.ja9xPV
‘/run/media/She/Clone/utils/linux/syslinux’ -> ‘/tmp/linux_tmp.ja9xPV/syslinux’
Running: “/tmp/linux_tmp.ja9xPV/syslinux” -d syslinux -f -i “/dev/sdb1”
//NOTE// If your USB flash drive fails to boot (maybe buggy BIOS), try to use “syslinux -d syslinux -fs /dev/sdb1”, i.e. running with “-fs”.
syslinux ran successfully in installation mode.
Done!
[She@she-centos7 ~]$

複製代碼

  1. 關機。連接 U 盤,再開機,修改 BIOS 中的設置:

(1)修改 BIOS 中的 “General” 欄目下的 “Boot Sequence” 項,取消其它啓動項的勾選,僅保留 U 盤啓動;

(2)設置 BIOS 中的 “Secure Boot” 欄目下的 “Secure Boot Enable” 項爲 “Disabled”。

第(2)項的值默認爲 “Enabled”,如果從"Enabled" 狀態下從 U 盤啓動,則會在屏幕上方報錯:

Operating System Loader has no signature. Incompatible with SecureBoot.

All bootable devices failed Secure Boot verification.
Press F1 key to retry boot.
Press F2 key to reboot inot setup.
Press F5 key to run onboard diagnostics.

  1. 外接新硬盤作爲目標硬盤,對舊硬盤進行克隆,具體界面可以參考這裏:《利用clonezilla克隆、還原CentOS整個系統》,此處不再贅述。

需要注意的是,一定要分清楚源硬盤和目標硬盤!!!!!!

本文使用新硬盤替換舊硬盤,採用的是“Device to Device"方式的克隆,許多項目不知道如何設置,則採用默認設置即可。

克隆開始:

剩下的事情就是等待克隆結束,按提示拔掉 U 盤,關機。

  1. 打開電腦後蓋,拆掉舊硬盤,安裝新硬盤

  2. 開機,恢復 BIOS 的設置:優先從硬盤啓動,並且將“Secure Boot” 欄目下的 “Secure Boot Enable” 項恢復成默認的 “Enabled”,保存退出。

  3. 檢查新硬盤能否正常啓動,各個系統能否正常開機。
    %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%
    附:clonezilla的官方文檔
    This doc generally describes how to use Clonezilla live.
    Here is a screenshot of Clonezilla Live boot menu:

The first one is the default mode for Clonezilla Live. It will default to framebuffer mode with a resolution of 1024x768.

There are more modes which you can choose in the 2nd choice “Other modes of Clonezilla live”, e.g. 800X600 or 640x480 one if you want, as shown here:

The choice, "Clonezilla live (To RAM. Boot media can be removed later), is the same function with the 1st one except when Clonezilla live booting finishes, all the necessary files are copied to memory. Therefore you can remove the boot media (CD or USB flash drive) then.
If you do not need Chinese or Japanese environment or if your computer experiences problems in the framebuffer mode, you can choose the one “Clonezilla Live (no framebuffer)” to clone in the English environment.
The choice, “Clonezilla live (failsafe mode)”, is for something goes wrong when you are not be able to boot your machine, such as ACPI of your machine is not supported in the kernel.
If you want to boot local OS in your harddrive, you can choose the one “Local operating system in harddrive (if available)”. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
The choice, “FreeDOS”, allows you to boot your machine into Free DOS. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
The choice, “Memory test using Memtest86+,” is for memory testing using Memtest86+. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
The choice, “Network boot via etherboot” or “Network boot via gpxe” is used to perform a network boot via Etherboot or gPXE. If your computer does not have a PXE network, you can use this to do boot from a network. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
• After language and keymap are chosen, first you will be prompted to assign the image repository, which can be local disk, ssh server, nfs server, samba server (network neighborhood) or any file system you can mount as /home/partimag. Once the repository is ready, you can proceed to save or restore the image. Just follow the on-screen instructions. Two main screenshots about Clonezilla live:

///Note/// The image name of Clonezilla is actually a directory name. For example, if you give the image name as 2007-05-NOVISTA, all the info will be saved as in the directory /home/partimag/2007-05-NOVISTA/. Inside that directory, MBR, partition table and partition files will be stored. Therefore when you want to restore an image, remember to mount the /home/partimag as the right device or path. i.e. the directory 2007-05-NOVISTA must be in the clonezilla home directory (Ex. /home/partimag)

• [Expert mode] If you want to MANUALLY mount clonezilla image home (/home/partimag), follow this:
Run “sudo su -” to become root.
You must prepare another writable device or space and mount it as /home/partimag (Note! If your boot media is writable, such as USB flash drive or you choose to use To RAM option, the existing /home/partimag is linked to /live_media/home/partimag, You have to remove that file and create a directory /home/partimag as a mount point by "rm -f /home/partimag; mkdir -p /home/partimag).
Ex. If you want to use Clonezilla to save /dev/hda and put the image in /dev/hdb1, then you have to mount /dev/hdb1 as /home/partimag by “mount -t auto /dev/hdb1 /home/partimag”. If the file system of /dev/hdb1 is ntfs, you have to use “ntfs-3g /dev/hdb1 /home/partimag” to mount it so that it’s writable. Remember, sshfs and smbfs are also supported. For example, using sshfs, you can mount your remote ssh server:
sshfs ACCOUNT@SSH_SERVER:/ABSOLUTE_PATH /home/partimag
i.e. if you want to mount your ssh server 192.168.100.254 with directory /work/pool, run it like this:
sshfs [email protected]:/work/pool /home/partimag
If you want to mount your samba server 192.168.200.254 with directory /work/smb, run it like this:
mount -t cifs -o user=your_user_name //192.168.200.254/work/smb /home/partimag
If you want to mount your samba server 192.168.200.254 with directory /work/smb, with username “administrator” and password “pass”, run it like this:
mount -t cifs -o user=administrator,password=pass //192.168.200.254/work/smb /home/partimag
///NOTE/// In the above command, do NOT use smbfs in Linux, use cifs, since cifs has better compatibility with MS windows file sharing. Clonezilla live will FAIL to save a correct image when you use smbfs!
Run “clonezilla” to use Clonezilla, then follow the on-screen instructions.

Save disk image
Description: Save 1st disk (sda) as an image on 2nd disk (sdb) (Step by step)

  1. Boot the machine via Clonezilla live
  2. The boot menu of Clonezilla live
  3. Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process
  4. Choose language
  5. Choose keyboard layout
  6. Choose “Start Clonezilla”
  7. Choose “device-image” option
  8. Choose “local_dev” option to assign sdb1 as the image home
  9. Select sdb1 as image repository, then choose “savedisk” option
  10. Input image name and select source disk
  11. Clonezilla is saving disk image (sda) to the partition of 2nd disk (sdb1)

Restore disk image
Description: Restore an image on 2nd disk (sdb) to 1st disk (sda) (Step by step)

  1. Boot the machine via Clonezilla live
  2. The boot menu of Clonezilla live
  3. Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process
  4. Choose language
  5. Choose keyboard layout
  6. Choose “Start Clonezilla”
  7. Choose “device-image” option
  8. Choose “local_dev” option to assign sdb1 as the image home
  9. Select sdb1 as image repository, then choose “restoredisk” option
  10. Select image name and destination disk
  11. Clonezilla is restoring disk image on 2nd disk (sdb) to 1st disk (sda)

Disk to disk clone
Description: Clone small disk to larger disk (e.g. 8 GB to 20 GB) (Step by step)

  1. Prepare Clonezilla live

  2. Boot your Clonezilla live via USB

  3. Choose “ToRAM” option in the boot menu

  4. Choose language

  5. Choose keyboard layout

  6. Choose “Start Clonezilla”

  7. Choose “disk_to_local_disk”

  8. Choose source disk

  9. Choose target disk

  10. Start cloning

  11. Disk is cloned

One image to multiple disks
Description: Restore an image to multiple disks, e.g. massive production of live USB flash drives.

  1. Boot the machine via Clonezilla live
  2. The boot menu of Clonezilla live
  3. Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process
  4. Choose language
  5. Choose keyboard layout
  6. Choose “Start Clonezilla”
  7. Choose “device-image” option
  8. Choose “local_dev” option to assign sdb1 as the image home
  9. Select sdb1 as image repository, then choose “1-2-mdisks” option
  10. Select image name and destination disk
  11. Clonezilla is restoring disk image on 2nd disk (sdb) to 3rd, 4th, and 5th disks (sdc, sdd, sde)

Create Recovery Clonezilla
Description: Create a autorun recovery Clonezilla live CD or USB flash drive (Step by step)

  1. Boot the machine via Clonezilla live
  2. The boot menu of Clonezilla live
  3. Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process:
  4. Choose language
  5. Choose keyboard layout
  6. Choose “Start Clonezilla”
  7. Choose “device-image” option
  8. Choose “local_dev” option to assign sdb1 as the image home
  9. Select sdb1 as image repository, then choose “restoredisk” option
  10. Choose the image you want to include in the recovery CD or USB flash drive:

Preseed options to do job after booting
Description: Preseed some options to do restoring job after booting

  1. The scenario
  2. The options to be preseeded

Started with sshd on and passwd assigned
Description: Run unattended Clonezilla live via PXE or CD booting and the process can be remotely monitored

  1. A PXE config example for you to boot Clonezilla live via PXE, and ssh service is on, the password of account “user” is assigned

  2. A CD with configured boot parameters for you to boot Clonezilla live, and the ssh service is on, the password of account “user” is assigned

Add extra driver
Description: How to put your own binary driver in Clonezilla live without modifying /live/filesystem.squashfs

  1. How to put your own binary driver in Clonezilla live without modifying /live/filesystem.squashfs

Customized script with PXE
Description: Use customized script with a PXE version of Clonezilla live

  1. To put your customized script with a PXE version of Clonezilla live

Screen session with PXE
Description: Run unattended Clonezilla live via PXE booting and the process can be remotely monitored

  1. Run Clonezilla in screen session so you can access remotely to monitor the progress.

Burn Clonezilla live CD
Description: Create Clonezilla live CD by InfraRecorder

  1. Create Clonezilla live CD by InfraRecorder

LinuxLive USB creator
Description: Create Clonezilla live USB flash drive by LinuxLive USB creator

  1. Create Clonezilla live USB flash drive by LinuxLive USB creator

lite server
Description: Run a Clonezilla lite server to do massive deployment from an image via multicast mechanism

  1. Boot the machine via Clonezilla live
  2. The boot menu of Clonezilla live
  3. Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process
  4. Choose language
  5. Choose keyboard layout
  6. Choose “Start Clonezilla”
  7. Choose “lite-server” option
  8. Start Clonezilla lite server
  9. Now we have to mount the image repository.
  10. Select sdb1 as image repository, then choose “restoredisk” option
  11. Select image name and destination disk

lite server BT from dev
Description: Run a Clonezilla lite server to do massive deployment from raw device via bittorrent mechanism

  1. Boot the machine via Clonezilla live
  2. The boot menu of Clonezilla live
  3. Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process
  4. Choose language
  5. Choose keyboard layout
  6. Choose “Start Clonezilla”
  7. Choose “lite-server” option
  8. Start Clonezilla lite server
  9. Mount the image repository.
  10. Choose the massive deployment mode using BT from raw device mode.
  11. Select source disk.

lite server BT from dev

In this example: Run a Clonezilla lite server to do massive deployment from raw device via bittorrent mechanism

  1. Boot the machine via Clonezilla live
  2. The boot menu of Clonezilla live
  3. Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process
  4. Choose language
  5. Choose keyboard layout
  6. Choose “Start Clonezilla”
  7. Choose “lite-server” option
  8. Start Clonezilla lite server
  9. Mount the image repository.
  10. Choose the massive deployment mode using BT from raw device mode.
  11. Select source disk.
    [Back to ‘Clonezilla Live Doc’]

• Boot the machine via Clonezilla live TOP

In this example, we will replicate the OS on the first hard drive (/dev/sda) in Machine A to other 30 client machines. Hence we will make Machine A as a Clonezilla lite server. Assume we already have an OS on Machine A's /dev/sda, and this OS will be replicated to other computers using Bittorrent mechanism. The nice thing about this method is we do not have to take an image from the raw device of Machine A then replicate the image to other machines. Hence this method will save a lot of time. We will use the existing DHCP service in the LAN when providing network booting service for clients.

Here we describe the details. Once you have the bootable Clonezilla Live CD/DVD or USB flash drive, you can boot the Machine A via Clonezilla live. Remember to use the Clonezilla live CD or USB flash drive to boot the machine. For example, if you have Clonezilla Live in USB flash drive, you have to boot it via USB device (Ex. USB-HDD or USB-ZIP). If necessary, you can set the first boot priority in the BIOS as USB-HDD or USB-ZIP so that it can boot Clonezilla Live from your USB flash drive.
Here we take CD as an example. You can either set CD as first boot priority in machine’s BIOS like this:

Or by pressing a hotkey (e.g. Esc or F9) when you boot the machine, you will see the boot menu of BIOS like this:

Check your motherboard manual for more details about how to boot your machine via CD.

• The boot menu of Clonezilla live TOP

Here is a screenshot of Clonezilla Live boot menu:

The first one is the default mode for Clonezilla Live. It will default to framebuffer mode with a resolution of 1024x768.
There are more modes which you can choose in the 2nd choice “Other modes of Clonezilla live”, e.g. 800X600 or 640x480 one if you want, as shown here:

The choice, “Default settings, KMS” is for you to use KMS (Kernel Mode Setting) for your graphics card. If you have some problem to use the framebuffer mode of your graphics card, you can try it.
The choice, “Clonezilla live (To RAM. Boot media can be removed later)”, is the same function with the 1st one except when Clonezilla live booting finishes, all the necessary files are copied to memory. Therefore you can remove the boot media (CD or USB flash drive) then.
If you do not need Chinese or Japanese environment or if your computer experiences problems in the framebuffer mode, you can choose the one “Clonezilla Live (no framebuffer)” to clone in the English environment.
The choice, “Clonezilla live (failsafe mode)”, is for something goes wrong when you are not be able to boot your machine, such as ACPI of your machine is not supported in the kernel.
If you want to boot local OS in your harddrive, you can choose the one “Local operating system in harddrive (if available)”. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
The choice, “FreeDOS”, allows you to boot your machine into Free DOS. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
The choice, “Memory test using Memtest86+,” is for memory testing using Memtest86+. This is an extra function in the boot media that has nothing to do with Clonezilla Live.
The choice, “Network boot via iPXE” is used to perform a network boot via iPXE. If your computer does not have a PXE network, you can use this to do boot from a network. This is an extra function in the boot media that has nothing to do with Clonezilla Live.

• Here we choose 800x600 mode, after pressing Enter, you will see Debian Linux booting process TOP

• Choose language TOP

• Choose keyboard layout TOP

The default keyboard layout is US keyboard, therefore if you are using US keyboard, just press enter (i.e. use the option “Keep the default keyboard layout - US keyboard”).
If you want to change keyboard layout, you can choose “Change keyboard layout”, then follow the dialog menu to change that.

• Choose “Start Clonezilla” TOP

• Choose “lite-server” option TOP

• Start Clonezilla lite server TOP

Now choose start Clonezilla lite server:

Decide the client machine booting mechanism. Here we choose clients will boot from network (PXE or uEFI network booting):

Here we choose to detect DHCP service automatically. If the existing one is found, we can reuse it. Otherwise we have to start our own DHCP service:

So now Clonezilla lite server will detect the existing DHCP service. Once it is found, the Clonezilla lite server will borrow (reuse) the existing service, i.e., relay the client’s DHCP request to the existing DHCP server:

The existing DHCP service in the LAN has been detected, so now Clonezilla lite server will relay the client’s DHCP request to existing DHCP service.
//NOTE// Pay attention to the prompt. You have to make sure the DHCP service will provide enough IP addresses to all the clients. Besides, this mechanism is risky because all the PXE or uEFI network booting clients will enter DRBL or Clonezilla mode. Please make sure this is what you want.

• Mount the image repository. TOP

Although in this scenario, there is no need to take an image, yet still we have to mount the image repository so that the temporary image for BT from device mode can be saved. This "pseudo" image only contains some metadata files, and it contains no real data from the device /dev/sda.

The best choice here is to choose “ram_disk” option to assign the RAM disk as the image home since it’s usually faster then local disk or any other options:

• Choose the massive deployment mode using BT from raw device mode. TOP

If you choose “Expert” mode, you will have some chances to choose advanced parameters, e.g. imaging program, compression program, etc… You can see more details here.

Since we will do massive deployment, now choose “massive-deployment”:

As described in the beginning, we’d like to replicate the OS on the raw device /dev/sda to other client machines, so now choose “from-device”:

Now select “disk-2-mdisks” option because we want to replicate the OS on the whole disk, not only some partitions:

• Select source disk. TOP

Choose local source disk "sda" on Machine A which we want to replicate to other clients:

Choose to check the source file system integrity before really replicating it to other machines:

It’s recommended to check the file system before replicating it because you do not know if the file system is broken or not. If you are very sure that the integrity is OK, then of course you can choose “-sfck” to skip checking.

Select the mode you want after the image restoring is done in the client machines:

By default we choose “-p reboot” here. But if you have decided, you can choose poweroff the machine, choose in the client when the clone finishes, or do nothing after is restored.

Enter the number of clients. Here assume we will deploy 30 machines:

Since we choose to check the fiel system on the source disk before deploying, now Clonezilla will check the file system integrity:

Clonezilla will prompt us the command to replicate the source disk using BT mechanism. This command is very useful when you want to create a customized Clonezilla live. In addition, it now starts all the services on the server and wait for the network booting clients to boot and receive the data to replicate to the disk /dev/sda:

As described in the screen, only when all clients have finished jobs you can press “y” to terminate the required services. Do not press “y” if there are some clients still restoring.

Now you can boot the client machine via PXE or uEFI network booting to receive the image and write to its disk /dev/sda. All the steps in the client machine should be in unattended mode.

Once all the clients are done, you can press “y” twice to terminate the required services:

Check the prompt in the end. Once you press “Enter”, Clonezilla will show you the prompt to poweroff, reboot, or rerun…

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章