博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
克隆ubuntu硬盘_使用Ubuntu Live CD克隆硬盘
阅读量:2513 次
发布时间:2019-05-11

本文共 3656 字,大约阅读时间需要 12 分钟。

克隆ubuntu硬盘

克隆ubuntu硬盘

Whether you’re setting up multiple computers or doing a full backup, cloning hard drives is a common maintenance task. Don’t bother burning a new boot CD or paying for new software – you can do it easily with your Ubuntu Live CD.

无论是设置多台计算机还是进行完整备份,克隆硬盘驱动器都是一项常见的维护任务。 不必费心刻录新的引导CD或购买新软件-您可以使用Ubuntu Live CD轻松完成此操作。

Not only can you do this with your Ubuntu Live CD, you can do it right out of the box – no additional software needed! The program we’ll use is called dd, and it’s included with pretty much all Linux distributions. dd is a utility used to do low-level copying – rather than working with files, it works directly on the raw data on a storage device.

您不仅可以使用Ubuntu Live CD进行此操作,而且还可以立即使用,无需其他软件! 我们将使用的程序称为dd ,几乎所有Linux发行版都包含该程序。 dd是用于执行低级复制的实用程序-而不是处理文件,它直接对存储设备上的原始数据起作用。

sshot-1

Note: dd gets a bad rap, because like many other Linux utilities, if misused it can be very destructive. If you’re not sure what you’re doing, you can easily wipe out an entire hard drive, in an unrecoverable way.

注意: dd的说唱不好,因为和许多其他Linux实用程序一样,如果滥用,它可能会造成很大的破坏。 如果不确定自己在做什么,则可以以不可恢复的方式轻松擦除整个硬盘。

Of course, the flip side of that is that dd is extremely powerful, and can do very complex tasks with little user effort. If you’re careful, and follow these instructions closely, you can clone your hard drive with one command.

当然,另一方面是dd非常强大,可以用很少的用户精力来完成非常复杂的任务。 如果小心,并严格按照以下说明进行操作,则可以使用一个命令克隆硬盘驱动器。

We’re going to take a small hard drive that we’ve been using and copy it to a new hard drive, which hasn’t been formatted yet.

我们将使用一个一直在使用的小型硬盘驱动器,并将其复制到尚未格式化的新硬盘驱动器上。

To make sure that we’re working with the right drives, we’ll open up a terminal (Applications > Accessories > Terminal) and enter in the following command

为了确保我们使用的驱动器正确,我们将打开一个终端(“应用程序”>“附件”>“终端”),然后输入以下命令

sudo fdisk –l

sudo fdisk –l

screenshot_001

We have two small drives, /dev/sda, which has two partitions, and /dev/sdc, which is completely unformatted. We want to copy the data from /dev/sda to /dev/sdc.

我们有两个小型驱动器,/ dev / sda,具有两个分区,/ dev / sdc,其完全未格式化。 我们想要将数据从/ dev / sda复制到/ dev / sdc。

Note: while you can copy a smaller drive to a larger one, you can’t copy a larger drive to a smaller one with the method described below.

注意:虽然您可以将较小的驱动器复制到较大的驱动器,但是不能使用以下方法将较大的驱动器复制到较小的驱动器。

Now the fun part: using dd. The invocation we’ll use is:

现在有趣的部分:使用dd 。 我们将使用的调用是:

sudo dd if=/dev/sda of=/dev/sdc

须藤dd if = / dev / sda of = / dev / sdc

In this case, we’re telling dd that the input file (“if”) is /dev/sda, and the output file (“of”) is /dev/sdc. If your drives are quite large, this can take some time, but in our case it took just less than a minute.

在这种情况下,我们告诉dd输入文件(“ if”)是/ dev / sda,输出文件(“ of”)是/ dev / sdc。 如果您的驱动器很大,则可能要花一些时间,但对于我们而言,它只花了不到一分钟的时间。

screenshot_002

If we do sudo fdisk –l again, we can see that, despite not formatting /dev/sdc at all, it now has the same partitions as /dev/sda.

如果再次执行sudo fdisk –l ,则可以看到,尽管根本不格式化/ dev / sdc,但它现在具有与/ dev / sda相同的分区。

screenshot_003

 Additionally, if we mount all of the partitions, we can see that all of the data on /dev/sdc is now the same as on /dev/sda.

另外,如果我们挂载了所有分区,我们可以看到/ dev / sdc上的所有数据现在与/ dev / sda上的相同。

screenshot_004

Note: you may have to restart your computer to be able to mount the newly cloned drive.

注意:您可能必须重新启动计算机才能挂载新克隆的驱动器。

And that’s it…If you exercise caution and make sure that you’re using the right drives as the input file and output file, dd isn’t anything to be scared of. Unlike other utilities, dd copies absolutely everything from one drive to another – that means that you can even deleted from the original drive in the clone!

就是这样...如果您谨慎行事,并确保使用正确的驱动器作为输入文件和输出文件,则dd没什么好担心的。 与其他实用程序不同, dd绝对将所有内容从一个驱动器复制到另一个驱动器-这意味着您甚至可以从克隆中原始驱动器删除的!

翻译自:

克隆ubuntu硬盘

转载地址:http://phvwd.baihongyu.com/

你可能感兴趣的文章
字符串常用API
查看>>
Flask的配置文件
查看>>
python中将\\uxxxx转换为Unicode字符串的方法
查看>>
2017-07-19-CR 和 LF
查看>>
Python列表解析与生成器表达式
查看>>
二叉树的先序,中序,后序递归遍历,以及计算节点的数目
查看>>
安卓Android基础第三天——数据库,ListView
查看>>
程序员的自我救赎---3.2:SSO及应用案例
查看>>
PCLint输出格式选项
查看>>
HUAS Summer Trainning #3 B
查看>>
青蛙学Linux—为系统添加新硬盘
查看>>
.net 高级写法总结
查看>>
springMVC入门(六)------json交互与RESTFul风格支持
查看>>
使用phpMyAdmin管理网站数据库(创建、导入、导出…)
查看>>
[NOI2018]屠龙勇士 excrt
查看>>
Educational Codeforces Round 18
查看>>
[bzoj3532][Sdoi2014]Lis
查看>>
Codeforces Round#433 简要题解
查看>>
小白建站初尝试
查看>>
输入数字,用逗号隔开
查看>>