I need some help.. I have to backup an entire 60 GB HD into a new, identical 60 GB HD. I have to perform a sector-by-sector copy of the entire HD.
I wrote a DOS program which uses the INT 13h LBA extensions and works just fine.. only problem is that it's slow, since in DOS UltraDMA is not supported, but just PIO.
Please, can anybody help me about:

which are the functions to read/write (at high speed) sectors from any HD, in Windows 2000 or 9x? And to enumerate the hard disks (I wouldn't want to write to my other HD :D ).

So I can write a Windows version of my little program and exploit the UltraDMA.

Thanks for your help,
Posted on 2002-03-07 19:58:57 by Maverick
Best way should be, to get a Floppy-Linux distribution and copy the entire HD with "dd". Take a look at this one: http://www.itm.tu-clausthal.de/~perle/hal91/index.html
Posted on 2002-03-08 01:32:44 by bazik
If you have to backup a whole disk (works to save single partition too), have a look at Norton Ghost from Symantec...
It is not free, but it does the job well, is fast, especially when dealing with compression and the main dos exe is relatively small.

(No, I don't work for Symantec :tongue: )
Some similar tools may exist as freewares...

That said, it may be fun to code your own program, though...
Posted on 2002-03-08 01:52:04 by JCP

I agre with readiosys here, unless you need the practice of coding this, get a copy of norton ghost that is late enough to handle disks over 32 meg.

I bought Systemworks 2002 just for the version of ghost in it, the rest is a crock of sh*t but I needed ghost to back up my win98 box that has one disk that is 40 gig.


Posted on 2002-03-08 02:32:55 by hutch--
Sorry pals but my Dos routines to read a sector and write a sector took 3 seconds to write.. why should it take more on Windows?
I could even write UltraDMA I/O routines for Dos.. but I needed to do it quickly, it's a bit urgent. Even finding Ghost (or worse paying for it just for a single backup) is overkill.

INT 13H cannot be used directly from a Dos Box.. I'll try to use it directly from a Windows application.

Thanks for your help anyway.


PS: bAZiK: I'm afraid that dd won't allow UltraDMA.. so that would be like using my Dos program.. anyway I'll check it out if Windows doesn't support INT 13H from applications.
Posted on 2002-03-08 05:11:39 by Maverick
On Windows 2000 and later, you can use CreateFile (using PHYSICALDRIVE1 or something like that as the file) to have an access to the whole disk... and create an image file of it very easily...
Posted on 2002-03-08 05:27:02 by JCP
Maverick, if your chipset is supported by linux, dd should use UDMA.

Norton ghost is an excellent product, I used it a lot when I ran 9x...
it's great for backups (compressed image files), and it can clone
partitions/drives directly as well, *I think* using UDMA.

The solution from (NT) windows would be using CreateFile with
PHYSICALDRIVEx argument - I don't know how well it's going to
use if your source drive is an active drive, though. But worth a try :).
Posted on 2002-03-08 05:42:54 by f0dder

Maverick, if your chipset is supported by linux, dd should use UDMA.

My ATA100 controller isn't supported by some older kernels.
An easy workaround:

Do a

cat /proc/pci

Then search for the Promise entry:

Bus 0, device 12, function 0:
Unknown mass storage controller: Promise Technology Unknown device (rev 2).
Vendor id=105a. Device id=d30.
Medium devsel. IRQ 11. Master Capable. Latency=32.
(-1-) I/O at 0x9400 [0x9401].
(-2-) I/O at 0x9000 [0x9001].
(-3-) I/O at 0x8800 [0x8801].
(-4-) I/O at 0x8400 [0x8401].
I/O at 0x8000 [0x8001].
Non-prefetchable 32 bit memory at 0xd5800000 [0xd5800000].

And append the following to your Bootloader (LILO or GRUB):

ide2=0x9400,0x9002 ide3=0x8800,0x8402

Posted on 2002-03-08 06:02:51 by bazik
i do not think Win9x will allow you to use BIOS ints in a win32 application, int13h is designed for 16 bit code (unfortunately) and can noy work in a flat memory model

I guess you should use/write a VXD or send some IOCTL to existing VXD's but even so i do not think Windows will let you copy its booting HDD or the HDD that has the swap file on it, after all windows consideres that HDD "locked" and you can unlock it only from dos (but i am not sure)
Posted on 2002-03-08 16:27:48 by BogdanOntanu
Why not use the situation as an excuse to reinstall windows?
Posted on 2002-03-10 15:46:54 by eet_1024
Norton Ghost only works from DOS as does Drive Image and a lot of other mirroring utilities.

IMO they're fast because they don't do a sector -> sector copy, they just copy significant stuff like the MBR, the directory tables/structure and add all the files.
Posted on 2002-03-10 16:35:07 by Hiroshimator