如何复制硬盘分区?

时间:2022-09-24 11:08:41

Hii

I wanna copy an NTFs partition to another partition of same type and same size.And I tried with windows function Copyfile() and it worked but slow speed is a problem.Then I did with readfile() and WriteFile() instead of Copyfile() again speed is a problem.

我想将一个NTFs分区复制到相同类型和相同大小的另一个分区。我尝试使用Windows函数Copyfile()并且它工作但速度慢是一个问题。然后我使用readfile()和WriteFile()而不是Copyfile( )再次速度是一个问题。

How can I get a better speed...??

我怎样才能获得更好的速度......?

I did the same operation in kernel mode and getting slow performance using zwCreatefile() ,zwReadfile() & zwWriteFile()...

我在内核模式下执行了相同的操作,并使用zwCreatefile(),zwReadfile()和zwWriteFile()来降低性能...

How can I get a better speed .....?

我怎样才能获得更好的速度.....?

I want to copy a hard disk partition into another partition. My source and destination partitions are of NTFs and same size. For that purpose first I did by copying all sectors and it is working, But I wanna copy only used sectors…

我想将硬盘分区复制到另一个分区。我的源和目标分区是NTF和相同的大小。为了这个目的,我首先通过复制所有扇区并且它正在工作,但我想复制仅使用过的扇区......

Then I find the used clusters by reading the FSCTL_VOLUME_BITMAP. But this one also a slow one ..I want to get better speed. And I tried to get the used clusters by using the FSCTL_GET_RETEIVAL_POINTER also. But it's a slow one.....

然后我通过读取FSCTL_VOLUME_BITMAP找到使用过的簇。但这一个也很慢..我想获得更好的速度。我还试图通过使用FSCTL_GET_RETEIVAL_POINTER获取使用过的集群。但这是一个缓慢的.....

At last I tried the windows API CopyFile() also…But everything gives a slow performance…

最后我尝试了Windows API CopyFile()......但是一切都表现得很慢......

I know fundamentally Kernel mode(ring 0) is slower than User mode in speed ,(even if ring 0 can access Hardware directly).....

我知道从根本上说内核模式(环0)在速度上比用户模式慢,(即使环0可以直接访问硬件).....

Apart them these I tried also Asynchronous operation by setting OVERLAPPED flag in CreateFile.... getting small improvement....

除了他们这些我还尝试通过在CreateFile中设置OVERLAPPED标志进行异步操作....获得小改进....

And I've taken snapshot (Volume shadow copy)of the Volume and copied the files using Hobo copy method...but everything gives the same speed.....

我已经拍摄了卷的快照(卷影复制)并使用Hobo复制方法复制了文件......但是所有内容都提供相同的速度.....

Any idea to help...

任何想法帮助......

I have used the Software Acronis Disk director suite .I exclaimed after finding it's speed......!!!!!!

我使用了Software Acronis Disk导演套件。我发现它的速度后惊呼...... !!!!!!

Any idea to help me...to get a good speed.......???

有任何想法可以帮助我......获得良好的速度....... ???

Any links to the white papers related to this section...???

任何与本节有关的白皮书的链接...... ???


Thanking you

2 个解决方案

#1


I think the easiest way is to use a Linux Live Distribution or a Linux Rescue Disk.

我认为最简单的方法是使用Linux Live Distribution或Linux Rescue Disk。

After the start in a terminal you have to type (if "/dev/hda1" is the source partition and "/dev/hdb1" is the destination):

在终端中启动后,您必须键入(如果“/ dev / hda1”是源分区,“/ dev / hdb1”是目标):

dd if=/dev/hda1 of=/dev/hdb1 bs=64k

Instead of "dd" with some rescue distributions you can also use "dd_rescue".

您可以使用“dd_rescue”代替“dd”与一些救援发行版。

Be careful to use the right devices! Apart of this it works very well!

小心使用正确的设备!除此之外,它的效果非常好!

Werner

#2


In order to help you you have to share with us your definition of "better speed".

为了帮助您,您必须与我们分享您对“更好的速度”的定义。

In order to calculate expected speed (rough) you need to know 1. What is the raw performance of your block devices (hard disks in your case?) 2. The size of the data you need to transfer

为了计算预期速度(粗略),您需要知道1.块设备的原始性能是什么(在您的情况下是硬盘?)2。您需要传输的数据大小

So if your partitions get X1 and X2 mb/s and there is Y mb to copy and the two partitions are not on the same physical device, you should expect the copy yo be done in y / min(X1, X2) seconds. Again - this is a rough estimate, just some reference point so we can give meaning to the words "better speed"

因此,如果您的分区获得X1和X2 mb / s且要复制Y mb并且两个分区不在同一物理设备上,则应该期望复制以y / min(X1,X2)秒完成。再次 - 这是一个粗略的估计,只是一些参考点,所以我们可以给“更好的速度”这个词赋予意义

How slower than that estimate are the results you are getting?

你得到的结果比估计的慢多少?

#1


I think the easiest way is to use a Linux Live Distribution or a Linux Rescue Disk.

我认为最简单的方法是使用Linux Live Distribution或Linux Rescue Disk。

After the start in a terminal you have to type (if "/dev/hda1" is the source partition and "/dev/hdb1" is the destination):

在终端中启动后,您必须键入(如果“/ dev / hda1”是源分区,“/ dev / hdb1”是目标):

dd if=/dev/hda1 of=/dev/hdb1 bs=64k

Instead of "dd" with some rescue distributions you can also use "dd_rescue".

您可以使用“dd_rescue”代替“dd”与一些救援发行版。

Be careful to use the right devices! Apart of this it works very well!

小心使用正确的设备!除此之外,它的效果非常好!

Werner

#2


In order to help you you have to share with us your definition of "better speed".

为了帮助您,您必须与我们分享您对“更好的速度”的定义。

In order to calculate expected speed (rough) you need to know 1. What is the raw performance of your block devices (hard disks in your case?) 2. The size of the data you need to transfer

为了计算预期速度(粗略),您需要知道1.块设备的原始性能是什么(在您的情况下是硬盘?)2。您需要传输的数据大小

So if your partitions get X1 and X2 mb/s and there is Y mb to copy and the two partitions are not on the same physical device, you should expect the copy yo be done in y / min(X1, X2) seconds. Again - this is a rough estimate, just some reference point so we can give meaning to the words "better speed"

因此,如果您的分区获得X1和X2 mb / s且要复制Y mb并且两个分区不在同一物理设备上,则应该期望复制以y / min(X1,X2)秒完成。再次 - 这是一个粗略的估计,只是一些参考点,所以我们可以给“更好的速度”这个词赋予意义

How slower than that estimate are the results you are getting?

你得到的结果比估计的慢多少?