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 ~]$
5. 关机。连接 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.
6. 外接新硬盘作为目标硬盘,对旧硬盘进行克隆,具体界面可以参考这里:《利用clonezilla克隆、还原CentOS整个系统》,此处不再赘述。
需要注意的是,一定要分清楚源硬盘和目标硬盘!!!!!!
本文使用新硬盘替换旧硬盘,采用的是“Device to Device"方式的克隆,许多项目不知道如何设置,则采用默认设置即可。