tags:

views:

234

answers:

3

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.

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

I did the same operation in kernel mode and getting slow performance using 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…

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.....

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

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

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

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.....

Any idea to help...

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

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

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


Thanking you

A: 

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

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"

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

KIV
A: 

Hiiii

The hard disk specification is "Seagate 80GB HardDisk (7200 RPM) ". Presently I copy 1gb Ntfs source partition (almost filled with data) to same type,size of destination partition . If I get this correctly, then I wanna try on bigger size partitions.

Currently I get an average 3( 2 to 3 ) minutes speed (in my system 2.93ghz,1gb ram). So I wanna increase the speed of copying.

The current result is 50 % less of my expected speed. Because I found one third party do the same operation with 1.30 minuets ..same time my application takes double time like 3 minutes....

I think the current speed is 40 mbps....

With regards


Could you use DiskMon from Sysinternals (http://technet.microsoft.com/en-us/sysinternals/bb896646.aspx) to compare the disk access fith the third party program and yours. I am sure comparing the output will lead you to the answer.
KIV
+1  A: 

Hi,

I think the easiest way is to use a Linux Live Distribution or a 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):

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

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

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

Werner