[parted-devel] reading/writing sectors... 2 questions

Bart Hakvoort bart at hakvoort.be
Sat Jul 29 16:34:31 UTC 2006


Hi folks,

I was not entirely sure whether to send this mail to the normal helplist
or to this devellist. In the end i chose for this list, because it's not
something a user would ever need :)

While copying and moving filesystems in gparted, the real work is done by
ped_device_read_write() and ped_device_write(). I read a couple of sectors
and write them wherever needed.
Lately i observed that copying from left to right is considerabely faster
than  copying from right to left. Take e.g. the following case with 10
sectors:
0 1 2 3 4 5 6 7 8 9

If i read/write them from 0 - 9 it's much faster than when i do the same
from 9 - 0.
I _guess_ this has something to do with the movement of the header(s), but
my knowledge of HD internals is not very impressive, so i'd appreciate
some insight in the matter.
If needed i can provide some examplecode, but i think it's quite clear.

Another issue. The above mentioned functions allow you to move more than 1
sector at a time around. Copying more sectors at once is a great
time-saver, but how to decide the optimal amount of sectors?
Is there a nice way to calculate it or should i take the 'probing
approach' (simply try some different amounts and pick the fastest)?

Thanks in advance for the advice :)

Bart (plors)

-- 
--- plors




More information about the parted-devel mailing list