Merge pull request #1494 from GOLinux/master

Translated:20140811 How to Image and Clone Hard Drives with Clonezilla.md
This commit is contained in:
joeren 2014-08-13 16:00:29 +08:00
commit a5bd025d40
2 changed files with 93 additions and 93 deletions

View File

@ -1,93 +0,0 @@
Translating by GOLinux ...
How to Image and Clone Hard Drives with Clonezilla
================================================================================
![Figure 1: Creating a partition on the USB stick for Clonezilla.](http://www.linux.com/images/stories/41373/fig-1-gparted.jpeg)
Figure 1: Creating a partition on the USB stick for Clonezilla.
Clonezilla is a partition and disk cloning application for Linux, Free-, Net-, and OpenBSD, Mac OS X, Windows, and Minix. It supports all the major filesystems including EXT, NTFS, FAT, XFS, JFS, and Btrfs, LVM2, and VMWare's enterprise clustering filesystems VMFS3 and VMFS5. Clonezilla supports 32- and 64-bit systems, both legacy and UEFI BIOS, and both MBR and GPT partition tables. It's a good tool for backing up a complete Windows system with all of your installed applications, and I like it for making copies of Linux test systems so that I can trash them with mad experiments and then quickly restore them.
Clonezilla can also copy unsupported filesystems with the dd command, which copies blocks rather than files, so it doesn't need to understand filesystems. So, the short story is Clonezilla can copy anything. (A quick note on blocks: disk sectors are the smallest addressable storage units on hard disks, and blocks are logical data structures made up of single or multiple sectors.)
Clonezilla comes in two versions: Clonezilla Live and Clonezilla Server Edition (SE). Clonezilla live is ace for cloning single computers to a local storage device or network share. Clonezilla SE is for larger deployments, and fast multicast cloning an entire network of PCs at once. Clonezilla SE is a wonderful bit of software that we shall cover in the future. Today we shall create a Clonezilla Live USB stick, clone something, and restore it.
### Clonezilla and Tuxboot ###
When you visit the download page you'll see [Stable and Alternative Stable releases][1]. There are also Testing releases, which I recommend if you're interested in helping to improve Clonezilla. Stable is based on Debian and includes no non-Free software. Alternative Stable is based on Ubuntu, includes some non-Free firmwares, and it supports UEFI Secure Boot.
After you [download Clonezilla][2], install [Tuxboot][3] to copy Clonezilla to a USB stick. Tuxboot is a modification of Unetbootin that supports Clonezilla; you can't use Unetbootin because it won't work. Installing Tuxboot is a bit of pain, though Ubuntu users can install Tuxboot the easy way from a personal packages archive (PPA):
$ sudo apt-add-repository ppa:thomas.tsai/ubuntu-tuxboot
$ sudo apt-get update
$ sudo apt-get install tuxboot
If you're not running Ubuntu and your Linux distribution doesn't include a packaged version of Tuxboot, [download the source tarball][4] and follow the instructions in the README.txt file to compile and install it.
Once you get Tuxboot installed, use it to create your nice live bootable Clonezilla USB stick. First create a FAT32 partition of at least 200 megabytes; figure 1 (above) shows how it's done in GParted. I like to use labels, like "clonezilla", so I know what it is. This example shows a 2GB stick formatted as a single partition.
Then fire up Tuxboot (figure 2). Check "Pre-downloaded" and click the button with the ellipsis to select your Clonezilla file. It should find your USB stick automatically, and you should check the partition number to make sure it found the right one. In my example that is /dev/sdd1. Click OK, and when it's finished click Exit. It asks you if you want to reboot now, but don't worry because it won't. Now you have a nice portable Clonezilla USB stick you can use almost anywhere.
![Figure 2: Fire up Tuxboot.](http://www.linux.com/images/stories/41373/fig-2-tuxboot.jpeg)
Figure 2: Fire up Tuxboot.
### Creating a Drive Image ###
Boot up your Clonezilla USB stick on the computer that you want to backup, and the first thing you'll see is a normal-looking boot menu. Boot to the default entry. You'll be asked language and keyboard questions, and when you arrive at the Start Clonezilla menu select Start Clonezilla. In the next menu select device_image, then go to the next screen.
This screen is a little confusing, with options for local_dev, ssh_server, samba_server, and nfs_server. This is where you select the location for your backup image to be copied to. The size of your destination partition or drive must be the same size or larger than the volume you're copying. If you choose local_dev, then you'll need a local partition with enough room to store your image. An attached USB hard drive is a nice fast and easy option. If you choose any of the server options you'll need a wired Ethernet connection, the IP address of your server, and your login. I'll use a local partition, which means selecting local_dev.
When you select local_dev Clonezilla scans all of your locally-attached storage, including hard disks and USB storage devices, and makes a list of your partitions. Select the one you want to store your new image in, and then it asks which directory to use and shows you a list. Select your desired directory, and the next screen shows all of your mounts and used/available space. Press Enter, and the next screen gives you the option of Beginner or Expert mode. I choose Beginner.
In the next screen you can choose savedisk, which creates an image of an entire hard disk, or save_parts, which allows you to select individual partitions. I want to select partitions.
The next screen asks for a name for your new image. After accepting the default or entering your own name, go to the next screen. Clonezilla scans your partitions and creates a checklist so you can pick the ones you want to copy. After making your selections, the next screen gives you the option to do a filesystem check and repair. I'm impatient, so I skip this part.
The next screen asks if you want Clonezilla to check your newly-created image to make sure it is restorable. I always say yes. Next, it gives you a command-line hint in case you ever want to use the command-line instead of the GUI, and you must press Enter again. You get one more confirmation, and then type y for Yes to make the copy.
You get to watch a nice red, white, and blue progress screen while Clonezilla creates your new image (figure 3).
![Figure 3: Watch the creation of your new image.](http://www.linux.com/images/stories/41373/fig-3-export.jpeg)
Figure 3: Watch the creation of your new image.
When it's all finished press Enter and then select reboot, and remember to remove your Clonezilla USB stick. Boot up your computer normally, and go look at your nice new Clonezilla image. You should see something like this:
$ ls -l /2014-08-07-11-img/
total 1241448
-rw-r--r-- 1 root root 1223 Aug 7 04:22 blkdev.list
-rw-r--r-- 1 root root 636 Aug 7 04:22 blkid.list
-rw-r--r-- 1 root root 3658 Aug 7 04:24 clonezilla-img
-rw-r--r-- 1 root root 12379 Aug 7 04:24 Info-dmi.txt
-rw-r--r-- 1 root root 22685 Aug 7 04:24 Info-lshw.txt
-rw-r--r-- 1 root root 3652 Aug 7 04:24 Info-lspci.txt
-rw-r--r-- 1 root root 171 Aug 7 04:24 Info-packages.txt
-rw-r--r-- 1 root root 86 Aug 7 04:24 Info-saved-by-cmd.txt
-rw-r--r-- 1 root root 5 Aug 7 04:24 parts
-rw------- 1 root root 1270096769 Aug 7 04:24 sda6.ext4-ptcl-img.gz.aa
-rw-r--r-- 1 root root 37 Aug 7 04:22 sda-chs.sf
-rw-r--r-- 1 root root 1048064 Aug 7 04:22 sda-hidden-data-after-mbr
-rw-r--r-- 1 root root 512 Aug 7 04:22 sda-mbr
-rw-r--r-- 1 root root 750 Aug 7 04:22 sda-pt.parted
-rw-r--r-- 1 root root 625 Aug 7 04:22 sda-pt.parted.compact
-rw-r--r-- 1 root root 514 Aug 7 04:22 sda-pt.sf
### Restoring a Clonezilla Image ###
Restoring your image is similar to creating it. Again, boot up Clonezilla, go through the same initial steps, select dev_image, and then on the local_dev screen select the location of your image that you want to restore, whether it's on a local device or network share. Then continue through the rest of the screens, making sure that you have the correct restore image and target locations selected.
You can learn more of Clonezilla's amazing powers at the [Clonezilla Live Documentation page][5].
--------------------------------------------------------------------------------
via: http://www.linux.com/learn/tutorials/783416-how-to-image-and-clone-hard-drives-with-clonezilla
作者:[Carla Schroder][a]
译者:[译者ID](https://github.com/译者ID)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.linux.com/community/forums/person/3734
[1]:http://www.linux.com/learn/tutorials/783416-how-to-image-and-clone-hard-drives-with-clonezilla#57_why_ubuntu_based_clonezilla_live.faq
[2]:http://clonezilla.org/downloads.php
[3]:http://tuxboot.sourceforge.net/
[4]:http://sourceforge.net/projects/tuxboot/files/
[5]:http://clonezilla.org/clonezilla-live-doc.php

View File

@ -0,0 +1,93 @@
使用Clonezilla对硬盘进行镜像和克隆
================================================================================
![Figure 1: Creating a partition on the USB stick for Clonezilla.](http://www.linux.com/images/stories/41373/fig-1-gparted.jpeg)
图1 在USB存储棒上为Clonezilla创建分区
Clonezilla是一个用于LinuxFree-Net-OpenBSDMac OS XWindows以及Minix的分区和磁盘克隆程序。它支持所有主要的文件系统包括EXTNTFSFATXFSJFS和BtrfsLVM2以及VMWare的企业集群文件系统VMFS3和VMFS5。Clonezilla支持32位和64位系统同时支持旧版BIOS和UEFI BIOS并且同时支持MBR和GPT分区表。它是一个用于完整备份Windows系统和所有安装于上的应用软件的好工具而我喜欢用它来为Linux测试系统做备份以便我可以在其上做疯狂的实验搞坏后可以快速恢复它们。
Clonezilla也可以使用dd命令来备份不支持的文件系统该命令可以复制块而非文件因而不必弄明白文件系统。因此简单点说就是Clonezilla可以复制任何东西。关于块的快速说明磁盘扇区是磁盘上最小的可编址存储单元而块是由单个或者多个扇区组成的逻辑数据结构。
Clonezilla分为两个版本Clonezilla Live和Clonezilla Server EditionSE。Clonezilla Live对于将单个计算机克隆岛本地存储设备或者网络共享来说是一流的。而Clonezilla SE则适合更大的部署用于一次性快速多点克隆整个网络中的PC。Clonezilla SE是一个神奇的软件我们将在今后讨论。今天我们将创建一个Clonezilla Live USB存储棒克隆某个系统然后恢复它。
### Clonezilla和Tuxboot ###
当你访问下载页时,你会看到[稳定版和可选稳定发行版][1]。也有测试版本如果你有兴趣帮助改善Clonezilla那么我推荐你使用此版本。稳定版基于Debian不含有非自由软件。可选稳定版基于Ubuntu包含有一些非自由固件并支持UEFI安全启动。
在你[下载Clonezilla][2]后,请安装[Tuxboot][3]来复制Clonezilla到USB存储棒。Tuxboot是一个Unetbootin的修改版它支持Clonezilla你不能使用Unetbootin因为它无法工作。安装Tuxboot有点让人头痛然而Ubuntu用户通过个人包归档压缩包PPA方便地安装
$ sudo apt-add-repository ppa:thomas.tsai/ubuntu-tuxboot
$ sudo apt-get update
$ sudo apt-get install tuxboot
如果你没有运行Ubuntu并且你的发行版不包含打包好的Tuxboot版本那么请[下载源代码tarball][4]并遵循README.txt文件中的说明来编译并安装。
安装完Tuxboot后就可以使用它来创建你精巧的可直接启动的Clonezilla USB存储棒了。首先创建一个最小200MB的FAT 32分区图1上面展示了使用GParted来进行分区。我喜欢使用标签比如“Clonezilla”这会让我知道它是个什么东西。该例子中展示了将一个2GB的存储棒格式化成一个单个分区。
Then fire up Tuxboot (figure 2). Check "Pre-downloaded" and click the button with the ellipsis to select your Clonezilla file. It should find your USB stick automatically, and you should check the partition number to make sure it found the right one. In my example that is /dev/sdd1. Click OK, and when it's finished click Exit. It asks you if you want to reboot now, but don't worry because it won't. Now you have a nice portable Clonezilla USB stick you can use almost anywhere.
然后启动Tuxboot图2。选中“预下载的Pre-downloaded”然后点击带省略号的按钮来选择Clonezilla文件。它会自动发现你的USB存储棒而你需要选中分区号来确保它找到的是正确的那个我的例子中是/dev/sdd1。点击确定然后当它完成后点击退出。它会问你是否要重启动请不要担心因为它不会的。现在你有一个精巧的便携式Clonezilla USB存储棒了你可以随时随地使用它了。
![Figure 2: Fire up Tuxboot.](http://www.linux.com/images/stories/41373/fig-2-tuxboot.jpeg)
图2 启动Tuxboot
### 创建磁盘镜像 ###
在你想要备份的计算机上启动Clonezilla USB存储棒第一个映入你眼帘的是常规的启动菜单。启动到默认条目。你会被问及使用何种语言和键盘而当你到达启动Clonezilla菜单时请选择启动Clonezilla。在下一级菜单中选择设备镜像然后进入下一屏。
这一屏有点让人摸不着头脑里头有什么local_devssh_serversamba_server以及nfs_server之类的选项。这里就是要你选择将备份的镜像拷贝到哪里目标分区或者驱动器必须和你要拷贝的卷要一样大甚至更大。如果你选择local_dev那么你需要一个足够大的本地分区来存储你的镜像。附加USB硬盘驱动器是一个不错的快速而又简单的选项。如果你选择任何服务器选项你需要有线连接到服务器并提供IP地址并登录上去。我将使用一个本地分区这就是说要选择local_dev。
当你选择local_dev时Clonezilla会扫描所有连接到本地的存储折本包括硬盘和USB存储设备。然后它会列出所有分区。选择你想要存储镜像的分区然后它会问你使用哪个目录并列出目录。选择你所需要的目录然后进入下一屏它会显示所有的挂载以及已使用/可用的空间。按回车进入下一屏,请选择初学者还是专家模式。我选择初学者模式。
在下一屏中,你可以选择存盘,就是选择创建整个硬盘的镜像,还是创建分区镜像,创建分区镜像允许你选择单个分区。我想要选择分区。
下一屏中它会问你新建镜像的名称。在接受默认名称或者输入你自己的名称后进入下一屏。Clonezilla会扫描你所有的分区并创建一个检查列表你可以从中选择你想要拷贝的。选择完后在下一屏中会让你选择是否进行文件系统检查并修复。我才没这耐心所以直接跳过了。
下一屏中会问你是否想要Clonezilla检查你新创建的镜像以确保它是可恢复的。选是吧确保万无一失。接下来它会给你一个命令行提示如果你想用命令行而非GUI那么你必须再次按回车。你需要再次确认并输入y来确认制作拷贝。
在Clonezilla创建新镜像的时候你可以好好欣赏一下这个友好的红、白、蓝三色的进度屏图3
![Figure 3: Watch the creation of your new image.](http://www.linux.com/images/stories/41373/fig-3-export.jpeg)
图3 守候创建新镜像
全部完成后按回车然后选择重启记得拔下你的Clonezilla USB存储棒。正常启动计算机然后去看看你新创建的Clonezilla镜像吧。你应该看到像下面这样的东西
$ ls -l /2014-08-07-11-img/
total 1241448
-rw-r--r-- 1 root root 1223 Aug 7 04:22 blkdev.list
-rw-r--r-- 1 root root 636 Aug 7 04:22 blkid.list
-rw-r--r-- 1 root root 3658 Aug 7 04:24 clonezilla-img
-rw-r--r-- 1 root root 12379 Aug 7 04:24 Info-dmi.txt
-rw-r--r-- 1 root root 22685 Aug 7 04:24 Info-lshw.txt
-rw-r--r-- 1 root root 3652 Aug 7 04:24 Info-lspci.txt
-rw-r--r-- 1 root root 171 Aug 7 04:24 Info-packages.txt
-rw-r--r-- 1 root root 86 Aug 7 04:24 Info-saved-by-cmd.txt
-rw-r--r-- 1 root root 5 Aug 7 04:24 parts
-rw------- 1 root root 1270096769 Aug 7 04:24 sda6.ext4-ptcl-img.gz.aa
-rw-r--r-- 1 root root 37 Aug 7 04:22 sda-chs.sf
-rw-r--r-- 1 root root 1048064 Aug 7 04:22 sda-hidden-data-after-mbr
-rw-r--r-- 1 root root 512 Aug 7 04:22 sda-mbr
-rw-r--r-- 1 root root 750 Aug 7 04:22 sda-pt.parted
-rw-r--r-- 1 root root 625 Aug 7 04:22 sda-pt.parted.compact
-rw-r--r-- 1 root root 514 Aug 7 04:22 sda-pt.sf
### 恢复Clonezilla镜像 ###
恢复镜像和创建镜像类似。再次使用Clonezilla启动经过同样的初始化步骤后选择dev_image然后在local_dev屏选择你要恢复的镜像所在的位置它要么在本地设备上要么在网络共享上。然后继续下面的操作确保你的恢复镜像正确并选择了正确的位置。
你可以在[Clonezilla Live文档页][5]获得更多Clonezilla的神奇力量。
--------------------------------------------------------------------------------
via: http://www.linux.com/learn/tutorials/783416-how-to-image-and-clone-hard-drives-with-clonezilla
作者:[Carla Schroder][a]
译者:[GOLinux](https://github.com/GOLinux)
校对:[校对者ID](https://github.com/校对者ID)
本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创翻译,[Linux中国](http://linux.cn/) 荣誉推出
[a]:http://www.linux.com/community/forums/person/3734
[1]:http://www.linux.com/learn/tutorials/783416-how-to-image-and-clone-hard-drives-with-clonezilla#57_why_ubuntu_based_clonezilla_live.faq
[2]:http://clonezilla.org/downloads.php
[3]:http://tuxboot.sourceforge.net/
[4]:http://sourceforge.net/projects/tuxboot/files/
[5]:http://clonezilla.org/clonezilla-live-doc.php