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 root@192.168.100.254:/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…

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值