10

I am trying to fix up an old work computer I have from the early to mid 90's.

Everything works fine, but the hard drive makes a horrible clicking noise when it loads anything, so I decided to replace it. I have seen many videos and articles describing using Compact Flash cards with IDE adapters instead of traditional hard drives, so I decided to try that.

I used my Linux machine to take an image of the original hard disk, which is 160MB. I bought a couple of 512MB Lexar CF cards, and I imaged one with the hard disk image using a CF to USB adapter. I used this adapter to connect the CF card to the computer.

The BIOS detects the drive properly and fills out the Cylinders/Heads/Sectors information, but when it tries to boot from it, it fails and says "Missing operating system". The status LEDs on the adapter indicate that there is power, but the data light only ever flashes once, very briefly, before the error is reported.

I tried connecting the old hard drive and the CF card, but in that case only the hard drive was detected.

I checked the hex dump of the image and confirmed that it does have the magic number for a bootable drive.

I do not have any other systems with IDE connectors available at the moment, but I have tried connecting to the CF card with the adapter to an IDE to USB adapter on a modern computer. In that case, the OS detects the drive, but fails to read from or write to it. However, the card does work using a CF to USB adapter.

What I would like to know is what would cause the computer to fail to boot from the card?

Could it be that that CF card isn't compatible?

I have read online that some cards are more compatible than others, but no one seemed to have a problem with Lexar cards. If the card is the problem, how do I know which card to buy so that it is compatible?


Responses to comments:

I am trying to boot DOS 6.22/Windows 3.1.

I don't have a boot floppy that I can use to see if the card is recognized. That is why I tried using the original hdd in addition to the card, but then the card wasn't recognized. The computer only has one IDE connector, and I couldn't get it to detect the card as either master or slave when the hdd was connected.

The original hard drive works fine, so I don't think there are any problems with corrupt data.

I don't know much about disk geometries, but I am pretty sure they are different. The C/H/S values are different, and the CF card is about 4 times larger than the hdd.

The computer is a DTK Computer. I am not sure of the model. I guess it would fall into the "PC compatible" category.


Update:

I attempted to follow the advice of @Ken Gober and I made a boot disk, copied format.com and fdisk.exe, then booted the disk. I partitioned the card with fdisk and made it active, then formatted the C drive with format.

I got another computer with an IDE port, and used that to copy the data from the hdd to the card in a number of different ways, including:

  • Copying the files using cp on Linux
  • Using format /s and copying over everything that was not already there
  • Using format /s and copying everything, replacing duplicates
  • dd if=/dev/hdd-partition of=/dev/card-partition bs=512
  • dd if=/dev/hdd of=/dev/card bs=512 skip=22 seek=63 count=numSectors
  • format c: /s

As a result, I got one of three responses:

  • "Invalid system disk. Insert another disk and press any key..."
  • "Missing Operating System"
  • "Starting MS-DOS...", then the system hangs indefinitely

Interestingly enough, If I boot from a floppy disk, I can see all of the files on the card, and some of the executables even try to run, before complaining about missing himem.sys, complaining about needing Windows, or halting the system indefinitely while loading or something.

Thank you all so much for the help. At this point, I may just try installing FreeDOS just to see if I can get anything booting off the CF card.

Update 2:

I took @Jules advice and tried sys a: c:. Again, the computer said "Starting MS-DOS..", but then got stuck in a loop or halted with the hard drive access light stuck on. Also, it seems that the original hard drive no longer boots properly, either (it's backed up, so it's fine). It seems that anything which is touched by a newer computer doesn't work with the old one.

I suspect that there is a lower level issue at play. I don't have any other computer old enough care about the disk geometry instead of using LBA, and this one only has one IDE port, so I might just be screwed. I may just try to get an SD adapted as @traal suggested.

2
  • Is it possible that the CF card is faulty?
    – Vikki
    Jun 20, 2021 at 0:46
  • 1
    @Vikki They're second hand off eBay, so it's possible. I'll have to see if I can find a CF adapter to test them
    – theJack
    Jun 22, 2021 at 19:25

6 Answers 6

6

First you need to make sure that your CF card and adapter are working properly. One easy way to do this is to boot from the hard disk and make a boot floppy (FORMAT A: /S). Copy the FDISK and FORMAT utilities to the floppy. Power down, remove the hard disk and install your CF card and adapter, then boot from the floppy. Partition and format the CF card using FDISK and FORMAT /S, then see if you can boot from the CF card. If you can, they are working the way you need them to. (Remember that you may need to reboot in between the FDISK and FORMAT steps to ensure that FORMAT is able to see the new partition).

Next, you need to make sure that you are making an image properly (this includes making sure you're using the right tool for the job). Check to see what the C/H/S values are for the hard disk and the CF card, and make sure the H and S values are the same. If the H and S values on both drives match, you should be able to take a raw sector dump of the entire hard disk (starting at 0/0/0) and just write it to the CF card (starting at 0/0/0).

If either the H or S values are different, then instead of dumping the entire hard disk you will want to just dump the DOS partition (start at whatever C/H/S is listed in the partition table for your DOS partition). In this situation you need to recreate the DOS partition on the CF card manually. Calculate new C/H/S values to use on the CF card so that the total number of blocks in the partition matches the total number of blocks in the hard disk DOS partition. It is ok to round up the number of blocks to the next full track boundary, I doubt that would cause any problems. It might even work to make the new partition on the CF card fill the entire volume but I don't recommend it (even if it works it can cause you problems later).

If you have multiple DOS partitions (a primary and one or more extended) and the H/S values are different, you may need to copy each partition separately using the procedure above.

EDIT:

Assuming your HD has C/H/S of 1011/15/22, and the DOS partition starts at 0/1/1 and fills the drive (the boot sector and partition table would be at 0/0/1 and the remainder of the first track is unused), that means your DOS partition is 333608 sectors (1011 cyls * 15 heads * 22 sectors = 333630, minus 22 sectors for the first track.

If your CF card is 994/16/63, that means each track holds 63 sectors and each cylinder holds 1008 sectors (16 * 63). So, 333608 sectors would require 330 full cylinders, plus another 15 full tracks, plus 23 sectors (23 + 15 * 63 + 330 * 1008 = 333608). If your DOS partition starts at 0/1/1 on the CF card, then it should end at 330/16/23 to be big enough to hold 333608 sectors. Round up to the next track boundary and you should define it to end at 330/16/63.

Once this is done, you can do a raw sector copy of 333608 sectors from the old HD to the new CF card, starting the read at 0/1/1 on the HD and starting the write at 0/1/1 on the CF card. Starting the read at 0/1/1 means skipping the first 22 sectors of the HD (the first track), and starting the write at 0/1/1 means skipping the first 63 sectors of the CF card (the first track).

You will be left with unused space on the CF card; you can create a new partition starting at 331/0/1 and use it as a D: drive if you like.

4
  • Strongly suspect drive geometry is the issue. If the HDD was 160MB, that's from before the move to linear block addressing. I think most IDE/CF adapters use LBA (?) so will only supported partitions written on a disk where sectors=63 and heads=16.
    – Jules
    Feb 28, 2018 at 16:57
  • (Example: looking through my stash of old HDDs, I have a 261MB drive here which has 15 heads and 34 sectors... a raw copy of that drive to a modern device would not work correctly)
    – Jules
    Feb 28, 2018 at 17:06
  • Thank you for the respone. I made a boot floppy and verified that the card and adapter are recognized. I can see the contents of the card, but cannot run programs. The problem is the geometry, as the card is 994/16/63, but the hdd is 1011/15/22. What do I need to calculate to convert from the hdd to the card? Do you mean just reformat the card, then copy the files and mark the partition as active?
    – theJack
    Feb 28, 2018 at 22:28
  • To convert from HD to CF card, first convert the HD C/H/S to the number of sectors, then calculate the C/H/S values on the CF card to reach that number of sectors, accounting for the fact that on the CF card each cylinder is 16 tracks, and each track is 63 sectors. There is not enough room in one comment to do all that, I will edit my answer.
    – Ken Gober
    Feb 28, 2018 at 22:50
6

Some older BIOSes have trouble handling drives larger than 504MB, even though they allow such drive size to be specified in the setup. For such computers, Dynamic Drive Overlay applications can help. These applications install themselves to the MBR and replace the BIOS disk handling routines with their own at the expense of some conventional memory. They will also format partitions to the required size.

Important: once the DDO is installed in the MBR, one should not boot from floppies, because in that case the BIOS disk handling routines remain in effect. The system booted from floppy might not recognize the drive. Workaround: while the system is booting, the DDO software displays a message that by pressing a specific key, booting from floppy is now possible. This way the DDO disk handler routines are already installed, it's safe to boot from a floppy.

I'm using OnTrack Disk Manager 9.57 with great satisfaction, which - according to Phil's computer lab - had been made freely available by the company developed it (Kroll Ontrack). You can download it from Phil's web site: https://www.philscomputerlab.com/ontrack-disk-manager.html

With this application, one of my 286 computers can handle a 2GB CF card at full capacity. The 286's BIOS is only be able to handle drives as large as 106MB.

4

I was having the same issues I could get floppies to boot, but couldn't get the CF card. When you install DOS to a disk it doesn't format the MBR.

  1. boot from floppy
  2. cd c:\
  3. fdisk /mbr (or c:\dos\fdisk mbr)
1
  • Created a new account just to say thank you to @sverasch (lack of reputation pts will not allow upvoting or commenting). This was spot on for my old Compaq CDS520 w/ CF card (starting small with 256MB). Thank you again! Mar 23, 2022 at 5:01
3

Some or all CompactFlash cards aren't fully IDE compliant, and using a(n) SD to IDE adapter like this SD to 44-pin IDE adapter + this 44-pin to 40-pin IDE adapter will often work better. (This combination works perfectly in my Playstation 2.)

0

One problem you may be having, if it isn't due to the file system being formatted for a disk with different geometry (which I suspect is the most likely problem) could be due to BIOS disk size limits: some BIOSes are unable to generate addresses correctly for disks that are over 504MB in size (1024 cylinders * 16 heads * 63 sectors * 512 bytes). You may want to put your CF adapter into another machine and partition it so that your partition exists only within the first 1024 cylinders -- it will waste a few MB of space, but it may make it work with a BIOS that doesn't understand how to use partitions that extend beyond that.

0

I would as well see the C/H/S values as reason. When copying the HD content, all addressing is according to the HD geomtry, which ofc, isn't the same for the CF card. When booting the system releis on the C/H/F based addressing, thus using HD addresses to read the CF card, thus geting the wrong blocks.

Since you said, you can boot the laptop into a MS-DOS floppy, you might as well use that system to format the CF card, right? That way the values should be exactly like the BIOS would like it. So try the whole process on the original machine. Which is the right thing anyway :))

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .