Author Topic: How to clone DOS drive?  (Read 7040 times)

0 Members and 3 Guests are viewing this topic.

Offline geggi1

  • Frequent Contributor
  • **
  • Posts: 429
Re: How to clone DOS drive?
« Reply #25 on: March 27, 2022, 09:50:38 pm »
The limitation in MSdos is not Dos, but the FAT16 disc system.
Try a partition that is less than 2GB. Back in the flopppydisc times Dos came on 5 or 6 1,44 discs so you dont need a very large drive.
MSdos can take up to about 9GB  split in several partitions that is 2GB or less.

Use a disc image tool and create a image. Use Rufus to extrect the image to your drive.
 

Offline jmelsonTopic starter

  • Super Contributor
  • ***
  • Posts: 2765
  • Country: us
Re: How to clone DOS drive?
« Reply #26 on: March 28, 2022, 01:03:26 am »
The limitation in MSdos is not Dos, but the FAT16 disc system.
Try a partition that is less than 2GB. Back in the flopppydisc times Dos came on 5 or 6 1,44 discs so you dont need a very large drive.
MSdos can take up to about 9GB  split in several partitions that is 2GB or less.

Use a disc image tool and create a image. Use Rufus to extrect the image to your drive.
The only partition on the disk is 162 MB.  I have been using Linux dd to copy the whole disk rather than the partition (sdd vs sdd1).
Yes, it is FAT16.
Thanks,
Jon
 

Offline jmelsonTopic starter

  • Super Contributor
  • ***
  • Posts: 2765
  • Country: us
Re: How to clone DOS drive?
« Reply #27 on: March 28, 2022, 01:11:36 am »
I would replace DOS with modern FREEDOS.

Did that for myself times ago to move deprecated stuff
I really don't have this option.  I have an antique special device with a large ISA data acquisition card.  We have a fully working, but very old, PATA hard drive from the original computer.  It is an ~ 168 MB drive.  We want to just clone this drive to a new drive, but every attempt I have made has resulted in "missing operating system".  I have now tried this about 20 times, on a wide variety of drives, from 500 GB to 20 GB.  For some reason, the boot code in the MBR just can't boot the copy, but it boots the original drive just fine.
Reinstalling the programs for this special hardware might be VERY difficult, especially if the 20+ year old distribution floppies are no good.  I have not seen a 3.5" floppy drive in quite a while and I wouldn't trust one with irreplaceable media, anyway.
Thanks,
Jon
 

Offline bw2341

  • Regular Contributor
  • *
  • Posts: 160
  • Country: ca
Re: How to clone DOS drive?
« Reply #28 on: March 28, 2022, 02:40:37 am »
It's been a long time since I used MS-DOS. If I remember correctly, LBA came out many years after MS-DOS. For compatibility, hard drives report a CHS geometry. If you switch the drive to bigger drive, the geometry won't be the same. The entries in the partition table will point to a particular C, H and S as the start of the partition. Since you did a straight LBA to LBA copy, the partition table is now pointing to the wrong LBA as the start of the partition.

You are seeing the "missing operating system" message because the position of first track on the old hard drive will match on the new hard drive. However, as the old drive runs out of sectors and switches to the next head, the new drive still has more sectors. This is where the disk geometry address will get scrambled.

I don't have a particular recommendation for your problem. My first guess would be to try a file level copy instead. I would boot from an MS-DOS installation disk and fdisk, format and sys the new drive on the new computer. After the computer is running properly, I would install the old hard drive into the new machine and xcopy /e or xcopy /s to copy the old drive to the new.

If you are lucky and the software doesn't have copy protection, it should boot properly. Check the config.sys and autoexec.bat files for drivers that could affect the hard disk. Even older MS-DOS systems needed crazy workarounds before larger and larger hard disks were supported.
 

Offline jmelsonTopic starter

  • Super Contributor
  • ***
  • Posts: 2765
  • Country: us
Re: How to clone DOS drive?
« Reply #29 on: March 28, 2022, 02:46:48 am »
It's been a long time since I used MS-DOS. If I remember correctly, LBA came out many years after MS-DOS. For compatibility, hard drives report a CHS geometry. If you switch the drive to bigger drive, the geometry won't be the same. The entries in the partition table will point to a particular C, H and S as the start of the partition. Since you did a straight LBA to LBA copy, the partition table is now pointing to the wrong LBA as the start of the partition.

You are seeing the "missing operating system" message because the position of first track on the old hard drive will match on the new hard drive. However, as the old drive runs out of sectors and switches to the next head, the new drive still has more sectors. This is where the disk geometry address will get scrambled.

I don't have a particular recommendation for your problem. My first guess would be to try a file level copy instead.
I tried this first, but maybe I need to try this with a smaller destination drive.  I'll keep plugging away at it.
Thanks,
Jon
 

Offline bw2341

  • Regular Contributor
  • *
  • Posts: 160
  • Country: ca
Re: How to clone DOS drive?
« Reply #30 on: March 28, 2022, 03:00:39 am »
If you've already tried a file level copy, how did it fail?
 

Offline jmelsonTopic starter

  • Super Contributor
  • ***
  • Posts: 2765
  • Country: us
Re: How to clone DOS drive?
« Reply #31 on: March 28, 2022, 03:19:11 pm »
If you've already tried a file level copy, how did it fail?
I think I got the "missing operating system".  But, that was some weeks ago, and I was doing it on a larger hard drive.
Now I have found a good 20 GB hard drive, but it reports 65535 cylinders to the BIOS.  Not sure if that will cause problems.
I'm wondering if I can make this boot with LILO or GRUB, but I'll have to supply the right boot information.  I'm guessing it is /DOS/MSDOS.SYS
that needs to be loaded to boot.
Jon
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: How to clone DOS drive?
« Reply #32 on: March 28, 2022, 11:12:14 pm »
I've just been looking into alternative bootloaders, but I can't find anything relevant.  Most (all?) do their DOS compatibility by chainloading directly to the MBR already on the disk (not much use here as that is likely what's failing).  Freedos appears to have been designed to allow linux-style bootloader boots, ie it doesn't provide a useful alternative bootloader that you could try and shoehorn in here.  GRUB can make a fake disk from a file via its ramdisk features, but even if that works it prevents you from ever saving your changes back to disk.

What I really wanted to know is whether or not there is a way of overwriting the BIOS' CHS numbers, but it looks like an INT13h is used to query disk geometry from the BIOS, so you will have to patch that interrtupt handler (I'm way out of my depth here, but I presume this means modifying the BIOS.  Or would it be "easy" to write your own handler and override the BIOS' one, then try chainloading the DOS MBR?  Still sounds nasty and hard).

The best solution seems to be trying to get more (smaller) disks with better behaved CHS numbers?  The only solution I've tried successfully before was a CF card (+ a CF to IDE adaptor, which is just a passive connector as CF cards support IDE natively).

Some relevant CHS info from around the web:

GRUB manual
Quote
In traditional disk calls (called CHS mode), there is a geometry translation problem, that is, the BIOS cannot access over 1024 cylinders, so the accessible space is limited to at least 508 MB and to at most 8GB.

Phil Storrs PC Hardware Book
Quote
DOS versions up to and including DOS 3.3 imposed very restrictive limits on Hard Disk Drive Interfaces. The worst limit involved Hard Disk Drives larger than 32 MByte. A Drive larger than 32 MByte had to be split into sections and no section could be larger than 32 MByte. This limitation was overcome in later DOS versions and DOS 6.22 can theoretically address a Hard Disk Drive of up to two tera-bytes (two trillion bytes). The only problem is the 16 bit FAT used by DOS and older Windows Operating Systems, lowers this limit to 2.1 GByte.

This is really only a theoretical limit and in practice a limit of 528 MBytes was imposed by the original BIOS.
« Last Edit: March 28, 2022, 11:24:52 pm by Whales »
 

Offline Whales

  • Super Contributor
  • ***
  • Posts: 1899
  • Country: au
    • Halestrom
Re: How to clone DOS drive?
« Reply #33 on: March 28, 2022, 11:21:15 pm »
If we are not able to help here, then VOGONs might be a better forum to ask for help in:

https://www.vogons.org/

They might be able to recommend specific models of parts (SATA<->PATA adapters, SD card<->PATA, CF cards, specific modern disks, etc) that they know work.

Offline jmelsonTopic starter

  • Super Contributor
  • ***
  • Posts: 2765
  • Country: us
Re: How to clone DOS drive?
« Reply #34 on: March 29, 2022, 05:51:31 pm »
Well, I finally bit the bullet and built a new DOS 7.1 system, and then loaded all the files that I think will be needed.  With DOS, there is no registry, so just getting all the files in the right place should work.  If not, then I can start copying more stuff.
Thanks, everybody for trying to help!
Jon
 
The following users thanked this post: Whales

Offline Twoflower

  • Frequent Contributor
  • **
  • Posts: 737
  • Country: de
Re: How to clone DOS drive?
« Reply #35 on: March 29, 2022, 06:07:36 pm »
Right, DOS doesn't has a registry, but you should check the config.sys and autoexec.bat as they might start some drivers you need. If you run into problems: The order of the commands might be important as well.

Copy this files will probably not work out of the box over several mayor versions. Some manual adaption might needed. They are human readable. But that might look like a lost language. Like latin only few people might be able to read it, even fewer are able to write it. ;-)
 

Offline james_s

  • Super Contributor
  • ***
  • Posts: 21611
  • Country: us
Re: How to clone DOS drive?
« Reply #36 on: March 29, 2022, 08:33:56 pm »
Copying the DOS boot files manually doesn't work, I don't remember the details but something has to be in just the right place. You can use sys c: if you have sys.com or you can format c:/s, both will copy the needed system files and make the drive bootable.
 

Offline nightfire

  • Frequent Contributor
  • **
  • Posts: 585
  • Country: de
Re: How to clone DOS drive?
« Reply #37 on: March 30, 2022, 10:19:12 am »
Yes, the Floppy disk has to be bootable- so the simple way is with the "sys" command, but theoretically you could do it also with tools that modify the mbr like fdisk and then copy stuff like command.com, config.sys and autoexec.bat to the floppy.
 

Offline jmelsonTopic starter

  • Super Contributor
  • ***
  • Posts: 2765
  • Country: us
Re: How to clone DOS drive?
« Reply #38 on: April 01, 2022, 12:56:26 am »
OK, problem solved!  I built a DOS 7.1 system, copied all the files over, and then added in the specific lines from the old CONFIG.SYS and AUTOEXEC.BAT files,  and the special app ran, but did not show the right graphics.  So, I had to install ANSI.SYS and load it in CONFIG.SYS, then the whole thing worked!
Thanks for all the help.
Jon
 
The following users thanked this post: Whales, james_s

Offline m k

  • Super Contributor
  • ***
  • Posts: 1996
  • Country: fi
Re: How to clone DOS drive?
« Reply #39 on: April 03, 2022, 05:33:48 pm »
What happens if you make a partition smaller than 512MB? I vaguely remember having to use overlay programs on some older machines when larger hard drives became available. I have a 5GB drive in my IBM XT and it works fine, although I'm using a XT-IDE card with modern BIOS on it.
The only partition on the disk is 162 MB.  But, I think the problem is the stupid PATA-SATA adaptor makes some crazy C/H/S settings.
Jon
Ugh!  The drive that boots up win95 fine in my P&P machine shows up as 65525 cylinders on the new computer.  So,  maybe the diff is the MBR code on that one can handle it.
This is getting confusing!
Jon

Do you know drive geometries?
You can't use CHS geometry in LBA disk, access is not possible.

Can you connect 2nd drive to that old machine?
You can also connect only that new drive and check its geometry.

Your problem seems to be that you're using Linux in between and it understands more than this old DOS.
You need that original DOS doing the thing.

There's nothing magic with DOS, FORMAT /S D: or SYS D: will do the trick.
Then copying COMMAND.COM if it's missing and you have a functional system disk.
After partitioning the disk first of course, and don't forget to activate the partition.
http://facstaff.uwa.edu/bmoore/340/theBasics/Operations%20of%20FDISK%20The%20Basics%20of%20FDISK.htm

Physical locations of those hidden system files are fixed, no restrictions after that.
But something else in your system can also have a fixed location.
If so then you need to maintain the geometry and duplicate the disk.
Some copy protections had that kind of easter eggs.
Advance-Aneng-Appa-AVO-Data Tech-Fluke-General Radio-H. W. Sullivan-Heathkit-HP-Kaise-Kyoritsu-Leeds & Northrup-Mastech-REO-Simpson-Sinclair-Tektronix-Triplett-YFE
(plus lesser brands from the work shop of the world)
 

Offline SL4P

  • Super Contributor
  • ***
  • Posts: 2318
  • Country: au
  • There's more value if you figure it out yourself!
Re: How to clone DOS drive?
« Reply #40 on: April 04, 2022, 12:07:57 am »
Im jumping in here, having read only 20% of the thread, but what about some attempt with Ghost from the early 2000s?
Playing with the target options, you might get lucky creating a bootable working version of the original image.
If you can get it to load, you may then be able to update any drivers etc that have fallen by the wayside…
Don't ask a question if you aren't willing to listen to the answer.
 

Online BeBuLamar

  • Super Contributor
  • ***
  • Posts: 1191
  • Country: us
Re: How to clone DOS drive?
« Reply #41 on: June 23, 2022, 11:38:04 pm »
I generally have to use a floppy disk to partition, set the partition as startup, format the drive with system files. The simply copy the rest over.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf